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
22
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.1k
Property Based Testing
aniketmaithani
1
98
Testing your "TESTS"
aniketmaithani
0
95
Drupal Insights : Making Your Own Distribution
aniketmaithani
0
50
Other Decks in Programming
See All in Programming
Designing Repeatable Edits: The Architecture of . in Vim
satorunooshie
0
220
ビルドプロセスをデバッグしよう!
yt8492
0
230
iOSでSVG画像を扱う
kishikawakatsumi
0
180
Claude Agent SDK を使ってみよう
hyshu
0
1.5k
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
200
マンガアプリViewerの大画面対応を考える
kk__777
0
450
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
47k
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
250
Webサーバーサイド言語としてのRustについて
kouyuume
1
5.1k
CSC509 Lecture 10
javiergs
PRO
0
160
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
140
エンジニアに事業やプロダクトを理解してもらうためにやってること
murabayashi
0
120
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
192
56k
The Cost Of JavaScript in 2023
addyosmani
55
9.1k
How STYLIGHT went responsive
nonsquared
100
5.9k
The Invisible Side of Design
smashingmag
302
51k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Practical Orchestrator
shlominoach
190
11k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
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