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
40
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
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
110
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
61
Other Decks in Programming
See All in Programming
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
750
AIエージェント時代のコードレビューを設計する
nogu66
6
2.5k
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
660
Building an Out-of-Order CPU
latte72
1
710
初めての模倣学習とVLA
natsutan
0
500
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
230
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
870
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
Foundry Localでエージェント開発
seosoft
0
150
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
150
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
1k
Press start. Python's next generation.
willingc
PRO
3
310
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
980
Making the Leap to Tech Lead
cromwellryan
135
10k
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Scaling GitHub
holman
464
140k
GitHub's CSS Performance
jonrohan
1033
470k
Faster Mobile Websites
deanohume
310
32k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
410
Exploring anti-patterns in Rails
aemeredith
3
490
Google's AI Overviews - The New Search
badams
0
1.6k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
260
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
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