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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Aniket Maithani
November 20, 2020
Programming
0
24
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.2k
Property Based Testing
aniketmaithani
1
100
Testing your "TESTS"
aniketmaithani
0
99
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
54
Other Decks in Programming
See All in Programming
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
230
Claude Code Skill入門
mayahoney
0
290
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
130
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.6k
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
130
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
910
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
370
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
260
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
420
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
920
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
370
Featured
See All Featured
Music & Morning Musume
bryan
47
7.1k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
110
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
100
A Modern Web Designer's Workflow
chriscoyier
698
190k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
210
Un-Boring Meetings
codingconduct
0
220
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
150
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