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
18
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
970
Property Based Testing
aniketmaithani
1
78
Testing your "TESTS"
aniketmaithani
0
70
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
38
Other Decks in Programming
See All in Programming
Site Reliability Engineering for GMO
pyama86
8
1.1k
CDKコントリビュートの最初の壁を越えよう! -簡単issueの見つけ方-
badmintoncryer
3
210
Goのmultiple errorsについて (2024年4月版)
syumai
4
1.2k
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
380
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
440
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
130
Documentation for users with AsciiDoc and Antora
ahus1
0
370
Implementing Design Systems in Swift
seyfoyun
1
460
Polars入門
daikikatsuragawa
1
170
SIMD Parallel Programming with the Vector API
josepaumard
0
230
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
Next.js App Router
quramy
12
1.8k
Featured
See All Featured
Embracing the Ebb and Flow
colly
80
4.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
20
1.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
We Have a Design System, Now What?
morganepeng
43
6.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
13
8.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Web Components: a chance to create the future
zenorocha
306
41k
A designer walks into a library…
pauljervisheath
201
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