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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Aniket Maithani
November 20, 2020
Programming
27
0
Share
RS Setup Automation using Python
- RS Setup Automation using Python
Aniket Maithani
November 20, 2020
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
110
Testing your "TESTS"
aniketmaithani
0
100
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
55
Other Decks in Programming
See All in Programming
From Formal Specification to Property Based Test
ohbarye
0
2.5k
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
380
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
400
Are We Really Coding 10× Faster with AI?
kohzas
0
170
Explore CoroutineScope
tomoeng11
0
190
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
20k
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
23
12k
【ディップ|26年新卒研修資料】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
150
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.7k
Making the RBS Parser Faster
soutaro
0
710
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
1k
The Cult of Friendly URLs
andyhume
79
6.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
My Coaching Mixtape
mlcsv
0
130
Claude Code のすすめ
schroneko
67
220k
Everyday Curiosity
cassininazir
0
210
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
49
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
140
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
120
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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