Automating MongoDB Clusters Jonathan Rudenberg @"tanous
Flynn is an easy PaaS
Flynn git push and Docker deploys HTTPS load balancing Log aggrega<on Everything is highly available
Flynn TCP load balancing Service discovery with DNS Self-bootstrapping and self-hos<ng Database appliances
Databases are hard.
Best prac<ces are expensive.
One command to get a reliable database cluster without talking to a DBA
Produc<on parity Infrastructure portability Self-serve access
Safe out of the box Clusters not singletons Easy management
PostgreSQL
PostgreSQL MySQL
State Machine
P S A
github.com/joyent/manatee-state-machine
PostgreSQL MySQL MongoDB
S P A
S priority:0 P priority:1 A priority:0 hidden
P priority:1 S priority:0
discoverd Peer discovery Compare and swap service metadata Leader registra<on HTTP/DNS
leader.mongodb.discoverd:27017
MongoDB bugs
Replica set reconfigura<on implosion
if (args.force) { incrementVersionByRandom(config); }
Demo
flynn.io | @<tanous
flynn resource add mongodb
MONGO_DATABASE=b5cf103f4f2a1446104a275ebb7aa7af MONGO_HOST=leader.mongodb.discoverd MONGO_PWD=381b4fa2c05073b88ac7b061d06da2ee MONGO_USER=c3fd8b67fef657dcb4074cb409a77e32
flynn mongodb dump
flynn mongodb mongo
Primary handles reads/writes Sync can take over for primary Async can transi6on to sync Unassigned Deposed
Primary → Deposed Sync → Primary Async → Sync Unassigned → {Primary, Sync, Async} Deposed
Genera<on number Current primary Assigned sync Ini<al WAL Async list
Components (HTTP, TCP, TLS, Load Balancing) ROUTER DEPLOY Git Receiver WEB HEALTH USER USER USER USER USER Slugbuilder DASHBOARD SERVICE APPS APPS APPS APPS APPS Blobstore DATABASE APPLIANCES LOG AGGREGATOR CONTROLLER SCHEDULER SERVICE DISCOVERY (Runs containers) HOST SERVICE
DB A A A A DB A A A A A A DB A A A DB A A DB A A A A A A A A A A A A A A A DB F F F F F F F F F
Recommend
More recommend