Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RS Setup Automation using Python
Search
Aniket Maithani
November 20, 2020
Programming
0
22
RS Setup Automation using Python
- RS Setup Automation using Python
Aniket Maithani
November 20, 2020
Tweet
Share
More Decks by Aniket Maithani
See All by Aniket Maithani
Wifi Captive Portal Using Raspberry Pi
aniketmaithani
1
1.1k
Property Based Testing
aniketmaithani
1
96
Testing your "TESTS"
aniketmaithani
0
93
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
48
Other Decks in Programming
See All in Programming
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
580
Amazon Q CLI開発で学んだAIコーディングツールの使い方
licux
3
130
Gemini CLI のはじめ方
ttnyt8701
1
110
PHPUnitの限界をPlaywrightで補完するテストアプローチ
yuzneri
0
360
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
180
AWS Summit Japan 2024と2025の比較/はじめてのKiro、今あなたは岐路に立つ
satoshi256kbyte
1
260
[SRE NEXT] 複雑なシステムにおけるUser Journey SLOの導入
yakenji
1
860
11年かかって やっとVibe Codingに 時代が追いつきましたね
yimajo
0
220
JetBrainsのAI機能の紹介 #jjug
yusuke
0
160
Jakarta EE Meets AI
ivargrimstad
0
500
[Codecon - 2025] Como não odiar seus testes
camilacampos
0
100
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
9
1.6k
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Designing for humans not robots
tammielis
253
25k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Raft: Consensus for Rubyists
vanstee
140
7k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
770
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Designing for Performance
lara
610
69k
Transcript
Creating Replica Set (automation) using Python
Replica Set • A replica set in MongoDB is a
group of mongod processes that maintain the same data set.
Why do we need Replica Set? • High Availability •
Better Performance Image ref: https://docs.mongodb.com/manu al/_images/replica-set-read- write-operations- primary.bakedsvg.svg
PyMongo + Python • Used the following libraries along with
Python- 3.7 • PyMongo – Native Python Driver for MongDB • SSH2-Python – Substitute for Paramiko and faster compared to other libraries • Terraform – Infrastructure
Server Spawning • Using simple terraform script spawned 4 servers.
• Marked them as Primary, S2, S3 and Arbiter
Steps Involved • Setup IP of machines in /etc/hosts file
in each machine. 10.2.2.1 mongo1 10.2.2.2 mongo2 10.2.2.3 mongo3
Create RBAC in primary
Python script to generate X.509 based certificates.
Screenshots
Copy certificate in each of the machines Copy config file
(mongo.conf) update in each machine and restart the machine
Finally!!
Summary • Took me about 2 days to test this
up and run it on production. • Challenges : – Ensuring no downtime – Implementation – Security Check list • Use of TF and making collection read only • Easy flow control of the Python script • Documentation for further improvements