Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
MySQL Failover with Consul vol.2
Search
Michael H. Oshita
December 12, 2014
Technology
7.8k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MySQL Failover with Consul vol.2
MySQL Casual Talks vol 7. #mysqlcasual
Michael H. Oshita
December 12, 2014
More Decks by Michael H. Oshita
See All by Michael H. Oshita
JAWS-UG Yokohama 100th event
ijin
0
47
AI platform engineering
ijin
0
32
Fastest AWS re:Invent 2025 re:Cap in the galaxy
ijin
0
33
Lambda management with ecspresso and Terraform
ijin
2
330
Vibe Coding Tools
ijin
2
550
My small contributions - Fujiwara Tech Conference 2025
ijin
0
5.2k
re:Invent 2024体験談〜Interactivity/Community編〜
ijin
0
95
Fastest AWS re:Invent 2024 re:Cap in the galaxy
ijin
0
70
AWS Management Services
ijin
0
110
Other Decks in Technology
See All in Technology
導入から定着へ ~コーディングエージェントを日常業務に組み込む実践知~
yukisakai1225
0
140
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
370
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
7
5.2k
Kiro Crewで「みのるん式」仕事術やってみた
minorun365
PRO
3
960
AI時代のGraphQL
joere
1
270
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
170
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
220
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
300
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
330
【データ横丁主催】AI エージェント時代のTranslytical Data Platform
shisyu_gaku
0
150
FinOps Agentが生んだ技術負債:コスト自動調査の落とし穴と解消までの道のり
oasis1994liveforever
3
230
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
Docker and Python
trallard
47
4.2k
New Earth Scene 8
popppiees
4
2.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Tell your own story through comics
letsgokoyo
1
1.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
560
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
860
Six Lessons from altMBA
skipperchong
29
4.5k
Designing for Timeless Needs
cassininazir
1
530
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
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