$30 off During Our Annual Pro Sale. View Details »
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
24
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
100
Testing your "TESTS"
aniketmaithani
0
97
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
52
Other Decks in Programming
See All in Programming
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
450
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
8
5.5k
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
150
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.3k
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
730
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
愛される翻訳の秘訣
kishikawakatsumi
1
320
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.6k
WebRTC と Rust と8K 60fps
tnoho
2
2k
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
390
チームをチームにするEM
hitode909
0
310
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Building Adaptive Systems
keathley
44
2.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
A better future with KSS
kneath
240
18k
Mobile First: as difficult as doing things right
swwweet
225
10k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
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