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
97
Testing your "TESTS"
aniketmaithani
0
93
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
48
Other Decks in Programming
See All in Programming
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
24
12k
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
140
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
430
Testing Trophyは叫ばない
toms74209200
0
860
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
430
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
230
ソフトウェアテスト徹底指南書の紹介
goyoki
1
150
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
250
Laravel Boost 超入門
fire_arlo
3
210
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.3k
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
480
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
320
Featured
See All Featured
Speed Design
sergeychernyshev
32
1.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Visualization
eitanlees
148
16k
Typedesign – Prime Four
hannesfritz
42
2.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Automating Front-end Workflow
addyosmani
1370
200k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Building an army of robots
kneath
306
46k
Rails Girls Zürich Keynote
gr2m
95
14k
The Invisible Side of Design
smashingmag
301
51k
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