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.2k
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
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
270
MUSUBIXとは
nahisaho
0
130
ThorVG Viewer In VS Code
nors
0
770
Implementation Patterns
denyspoltorak
0
280
「ブロックテーマでは再現できない」は本当か?
inc2734
0
940
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
170
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
Patterns of Patterns
denyspoltorak
0
1.4k
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
410
CSC307 Lecture 02
javiergs
PRO
1
770
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Building Applications with DynamoDB
mza
96
6.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
The Curious Case for Waylosing
cassininazir
0
230
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
300
The Curse of the Amulet
leimatthew05
1
8.4k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
930
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Utilizing Notion as your number one productivity tool
mfonobong
3
220
How GitHub (no longer) Works
holman
316
140k
Between Models and Reality
mayunak
1
180
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