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
MySQL Failover with Consul vol.2
Search
Michael H. Oshita
December 12, 2014
Technology
3
7.6k
MySQL Failover with Consul vol.2
MySQL Casual Talks vol 7. #mysqlcasual
Michael H. Oshita
December 12, 2014
Tweet
Share
More Decks by Michael H. Oshita
See All by Michael H. Oshita
Fastest AWS re:Invent 2019 story in the galaxy
ijin
0
140
My DevOps toolsets
ijin
1
1.5k
Serverless Communities (AWS Users Group Netherlands)
ijin
0
46
Serverless Communities (Serverless Days Hamburg 2019)
ijin
0
6.3k
Fastest AWS re:Invent 2018 story in the galaxy
ijin
0
6.2k
Accelerating DevOps with Serverless
ijin
0
7k
Fastest AWS re:Invent 2017 story in the galaxy
ijin
0
6.7k
Fastest AWS re:Invent 2016 story in the galaxy
ijin
1
8.1k
To DockerCon you go!
ijin
0
4k
Other Decks in Technology
See All in Technology
[JAWS-UG新潟#20] re:Invent2024 -CloudOperationsアップデートについて-
shintaro_fukatsu
0
120
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
210
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
310
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
podman_update_2024-12
orimanabu
1
290
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
500
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
120
メンタル面でもつよつよエンジニアになる/登壇資料(井田 献一朗)
hacobu
0
110
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
280
いまからでも遅くないコンテナ座学
nomu
0
120
[トレノケ雲の会 mod.13] 3回目のre:Inventで気づいたこと -CloudOperationsを添えて-
shintaro_fukatsu
0
110
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
540
Featured
See All Featured
Done Done
chrislema
182
16k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Unsuck your backbone
ammeep
669
57k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Site-Speed That Sticks
csswizardry
2
190
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Designing Experiences People Love
moore
138
23k
The World Runs on Bad Software
bkeepers
PRO
66
11k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Facilitating Awesome Meetings
lara
50
6.1k
Making Projects Easy
brettharned
116
6k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Transcript
MYSQL FAILOVER WITH CONSUL VOL. 2 12/12/2014 @ijin MySQL Casual
Talks vol.7
ABOUT ME (@IJIN) • Michael H. Oshita • Japanese American
• 10+ Years in Japan • Software/Infra/Cloud Engineer • http://ijin.github.io
ABOUT ME (@IJIN) τϥϒϧˑ͠Ύʔͨʔͣ
https://walti.io WALTI
BLOG https://ijin.github.io
MYSQL FAILOVER • MySQL • MHA (MySQL Master HA) •
Consul INGREDIENTES:
None
CONSUL
CONSUL HTTP APIͱDNSͰૢ࡞͕Ͱ͖ΔKVଂͳࢄܕΫϥελ
CONSUL AGENT HTTP API /v1/kv/<key> key/value endpoint: RESTful: GET, PUT,
DELETE
CONSUL AGENT HTTP API key/value: base64 raw
CONSUL AGENT DNS Interface <node>.node.<datacenter>.<domain> Node Lookup:
CONSUL AGENT DNS Interface
CONSISTENCY
consensus protocol using raft server server (leader) server CONSISTENCY server
server
consensus protocol using raft server server (leader) server write CONSISTENCY
server server
consensus protocol using raft server server (leader) server write CONSISTENCY
server server write
consensus protocol using raft server server (leader) server write CONSISTENCY
server server write write
consensus protocol using raft server server (leader) server write CONSISTENCY
server server write write quorum[(n/2)+1] reached, commited!
CONSISTENCY writes: ! "?state" or "?consistent" parameter ɾdefault ɾstrongly consistent
ɾstale ! consensus protocol using raft reads: ! Always Strongly Consistent
MHA Master Slave Slave Manager MasterͰোൃੜ
Master Master Slave Manager ֤slaveʹ࠷৽binlogΛద༻͠ɺMasterঢ֨ binlog binlog binlog MHA
MHA master_ip_failover
Slave masterdb.node.consul Slave MHA
Master Slave masterdb.node.consul MHA
"Starting master failover."! "* Phase 1: Configuration Check Phase..\n"! "*
Phase 2: Dead Master Shutdown Phase..\n"! ==> ͜͜ͰچMasterใআ (master_ip_failover)! "* Phase 3: Master Recovery Phase..\n"! "* Phase 3.1: Getting Latest Slaves Phase..\n"! "* Phase 3.2: Saving Dead Master's Binlog Phase..\n"! "* Phase 3.3: Determining New Master Phase..\n"! ==> ͜͜Ͱ৽Masterใొ (master_ip_failover)! "* Phase 4: Slaves Recovery Phase..\n" FAILOVERγʔέϯε MHA
MHA & CONSUL master_ip_failover چmaster IPΛແޮԽ ৽master IPΛొ
IN ACTION https://www.youtube.com/watch?v=rA4hyJ-pccU
ALTERNATIVES ɾconsul event & consul watch ! ɾconsul-template
events propagated over gossip protocol event CONSUL EVENT watch watch
CONSUL EVENT
CONSUL-TEMPLATE haproxy.cfg
CONSUL-TEMPLATE
IN CLOSING • Use consul DNS catalog for MHA failover
• Consul-Template over consul event