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
22
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
96
Testing your "TESTS"
aniketmaithani
0
93
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
48
Other Decks in Programming
See All in Programming
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
580
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.4k
Discover Metal 4
rei315
2
100
Is Xcode slowly dying out in 2025?
uetyo
1
240
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
620
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
160
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
130
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
150
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
540
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
270
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
2
320
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Designing for Performance
lara
609
69k
Optimizing for Happiness
mojombo
379
70k
Typedesign – Prime Four
hannesfritz
42
2.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
A Tale of Four Properties
chriscoyier
160
23k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.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