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
33
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
100
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
57
Other Decks in Programming
See All in Programming
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
560
スマートグラスで並列バイブコーディング
hyshu
0
120
Claspは野良GASの夢をみるか
takter00
0
180
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
Oxcを導入して開発体験が向上した話
yug1224
4
300
さぁV100、メモリをお食べ・・・
nilpe
0
140
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
660
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
200
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
390
New "Type" system on PicoRuby
pocke
1
810
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
780
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
120
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
Exploring anti-patterns in Rails
aemeredith
3
400
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
420
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
270
Being A Developer After 40
akosma
91
590k
Automating Front-end Workflow
addyosmani
1370
210k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Optimizing for Happiness
mojombo
378
71k
Building Adaptive Systems
keathley
44
3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
940
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