Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RS Setup Automation using Python
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Aniket Maithani
November 20, 2020
Programming
44
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RS Setup Automation using Python
- RS Setup Automation using Python
Aniket Maithani
November 20, 2020
Transcript
12 slides
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
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
120
Testing your "TESTS"
aniketmaithani
0
120
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
64
Other Decks in Programming
See All in Programming
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
150
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
110
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
310
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
300
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
180
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.9k
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
670
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
150
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
230
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
570
The Pragmatic Product Professional
lauravandoore
37
7.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
660
BBQ
matthewcrist
90
10k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
590
Docker and Python
trallard
47
4.3k
Done Done
chrislema
187
17k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
610