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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Michael H. Oshita
December 12, 2014
Technology
3
7.8k
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
Lambda management with ecspresso and Terraform
ijin
2
240
Vibe Coding Tools
ijin
2
450
My small contributions - Fujiwara Tech Conference 2025
ijin
0
4.7k
re:Invent 2024体験談〜Interactivity/Community編〜
ijin
0
52
Fastest AWS re:Invent 2024 re:Cap in the galaxy
ijin
0
38
AWS Management Services
ijin
0
52
Fastest AWS re:Invent 2019 story in the galaxy
ijin
0
190
My DevOps toolsets
ijin
1
1.6k
Serverless Communities (AWS Users Group Netherlands)
ijin
0
77
Other Decks in Technology
See All in Technology
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
0
210
BPaaSオペレーション・kubell社内 n8n活用による効率化検証事例紹介
kubell_hr
0
370
あたらしい上流工程の形。 0日導入からはじめるAI駆動PM
kumaiu
3
530
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
420
The Engineer with a Three-Year Cycle - 2
e99h2121
0
210
一番人に近いコードレビューア CodeRabbit
kinopeee
0
120
Deno・Bunの標準機能やElysiaJSを使ったWebSocketサーバー実装 / ラーメン屋を貸し切ってLT会! IoTLT 2026新年会
you
PRO
0
130
しろおびセキュリティへ ようこそ
log0417
0
200
Introduction to Bill One Development Engineer
sansan33
PRO
0
350
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
1
130
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
140
Databricks Free Edition講座 データサイエンス編
taka_aki
0
250
Featured
See All Featured
KATA
mclloyd
PRO
34
15k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
53
4 Signs Your Business is Dying
shpigford
187
22k
HDC tutorial
michielstock
1
330
Un-Boring Meetings
codingconduct
0
200
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
230
Prompt Engineering for Job Search
mfonobong
0
150
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
810
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1.1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
65
The Spectacular Lies of Maps
axbom
PRO
1
490
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
51
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