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
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
98
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
53
Other Decks in Programming
See All in Programming
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
160
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
210
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
1.1k
TestingOsaka6_Ozono
o3
0
250
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
150
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
170
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
510
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
240
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
5
1.5k
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
140
Navigating Dependency Injection with Metro
l2hyunwoo
1
200
gunshi
kazupon
1
130
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
120
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
The Invisible Side of Design
smashingmag
302
51k
New Earth Scene 8
popppiees
0
1.3k
We Have a Design System, Now What?
morganepeng
54
8k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
70
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
860
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
380
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Exploring anti-patterns in Rails
aemeredith
2
220
The Art of Programming - Codeland 2020
erikaheidi
56
14k
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