Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
220
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
20 years of Symfony, what's next?
fabpot
2
350
TestingOsaka6_Ozono
o3
0
150
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
400
SwiftUIで本格音ゲー実装してみた
hypebeans
0
320
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
830
チームをチームにするEM
hitode909
0
320
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
310
Integrating WordPress and Symfony
alexandresalome
0
150
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
160
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
YesSQL, Process and Tooling at Scale
rocio
174
15k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
How STYLIGHT went responsive
nonsquared
100
6k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Balancing Empowerment & Direction
lara
5
800
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Practical Orchestrator
shlominoach
190
11k
A Tale of Four Properties
chriscoyier
162
23k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
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