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
Continuous Restoreへの道
Search
kakerukaeru
December 12, 2014
Technology
4
6.9k
Continuous Restoreへの道
MySQL Casual Talks vol.7 でしゃべった奴
kakerukaeru
December 12, 2014
Tweet
Share
More Decks by kakerukaeru
See All by kakerukaeru
大規模ImageOptimizer利用案件から学ぶ 安心安全のCDN移行 / Fastly yamagoya 2022
kakerukaeru
1
1.3k
事業と歩む Ameba システム刷新の道 / the-road-to-ameba-system-renovation-aws-summit-online
kakerukaeru
0
1.8k
事業と歩むAmebaシステム刷新の道 / the-road-to-ameba-system-renovation-cadc
kakerukaeru
0
570
The Shining / ~all work and no play makes jack a dull boy~
kakerukaeru
0
350
AmebaとCDNのお付き合いの歴史 / ameba cdn waiwai
kakerukaeru
0
100
fastlyでええかんじにサイトリニューアル @ Yamagoya Meetup 2018 / e-kanzi Website renewal with fastly
kakerukaeru
0
500
ghe_ameba_arekore
kakerukaeru
2
2.1k
20160907_Akamai_Tech_Deep_Dive
kakerukaeru
0
2.1k
はじめるCassandra
kakerukaeru
1
290
Other Decks in Technology
See All in Technology
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
460
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
540
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
5分でわかるDuckDB
chanyou0311
10
3.2k
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
170
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
530
Featured
See All Featured
It's Worth the Effort
3n
183
28k
Producing Creativity
orderedlist
PRO
341
39k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Into the Great Unknown - MozCon
thekraken
33
1.5k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Transcript
Continuous Restoreͷಓ
MySQLCasualͳͷʹ Casual͡Όͳͯ͘ࢮʹͦ ͏Ͱ͢
͍
who are you
͍Θͳ͕͔͚Δ @kakerukaeru ΏͱΓΠϯϑϥԂࣇʹ͋ AmebaεϚϗϓϥοτϑΥʔϜ໘ݟΔϚϯ Amebaը૾৴Ϛϯ ࠷ۙྑ͘৮ͬͯΔσʔλετΞCassandra ΦΤʔʔ!!!!ɹʊʊ_ ɹɹɹ ʊʊ_ʗɹɹ ʋ
ɹɹ ʗɹ ʗɹʗ˶ʋ| ɹɹ/ (ƅ)/ɹʗ /
about Cyberagent
game
pigg
blog
Community
MySQL͍ͬͺ͍ͬͯΔΑ
͍
agenda
• ܧଓతΓ͢ͱ͋ͬͯΈͨ • Ͳ͏࣮ݱ͔ͨ͠ • BackupϚσ • RestoreϚσ • ͏ͪΐͬͱߟ͑Δ
• ͬͯΈͨॴײ • ࠓޙ
ܧଓత Γ͢ͱ͋ͬͯΈͨ
Έͳ͞·
ෆ҆ʹͳͬͨ͜ͱ͋Γ ·ͤΜ͔
ྫ͑
SlaveશͰແݶ࠶ىಈ SlaveҰؾʹམ1 1 ͱ͋ΔDeleteจൃߦˠmysqldམͪΔˠmysqldsafeܦ༝Ͱ্͕ΔˠϨϓϦ࠶։ͰDeleteจൃߦˠmysqldམͪΔˠmysqldsafe(ry
͘͠
͓͔ͪΌΜ͕ ຊ൪DBͰDROP DATABASE2 2 ࡢຊʹ͋ͬͨࣄ݅
ͳ͍͔ (ʈТʈ) ⊃ɹ㱬
͋Δͱ͢Δ͡ΌΖʁ (ʈТʈ) ⊃ɹ㱬
ͦΜͳ͜ΜͳͰ
ʊਓਓਓਓਓਓʊ ʼɹ MySQL܈ɹʻ ʼɹ ಥવͷࢮ ɹʻ ʉY^Y^Y^Y^Yʉ
͜Μͳࣄ͋Ζ͏͔ͱ
ͬͯͯΑ͔ͬͨ BACKUP
Ͱ
͜Εຊʹrestoreग़དྷΔͷʁ
͠ग़དྷͳ͔ͬͨΒͲ͏͠Α͏ɾɾɾ
ΓϚελʔ͚ͩɾɾɾ
ՔಇதͷϚελʔ͔Β σʔλൈ͖ग़͢ࣄʹɾɾɾ
ࣦഊͨ͠ΒͲ͏͠Α
͜Μͳෆ҆ʹ·͞Εͳ͍ͨΊʹ
Backupͷਖ਼ੑʁͷ୲อΛ͓͖͍ͯͨ͠
ͰɺखͰຖճ֬ೝ͢Δͷɾɾɾ
ࣗಈԽͪ͠Ό͍ͳyo
Ͳ͏࣮ݱ͔ͨ͠
Backup·ͰͷྲྀΕ
None
Backup • backup༻slave • backup༻server • backup_serverΑΓ • ఆظxtrabackup •
ਵ࣌binlog_sync
ϦετΞ·ͰͷྲྀΕ
None
Restore • APIܦ༝Ͱinstance࡞ • chef-soloʹͯmysql_setup • BackupαʔόΑΓ࠷৽ͷsnapshotͱbinlogΛసૹ • test-serverͰrestoreॲཧ •
instanceআ
͜ΕͰRestoreͷ୲อ͕ग़དྷͨ
͍ͭͳΜͲ͖αʔό͕ࢮ ΜͰେৎ _(ˇωˇʯ㲃)_ ţźō…
͏ͪΐͬͱߟ͑Δ
ԿΛͬͯϦετΞྃͱ͢Δ͔
ۭͬΆͷςʔϒϧ͕ Restore͞Εͯҙຯͳ͍
ͳͷͰRestoreͷਖ਼ੑʁ ୲อͯ͋͛͠Α͏
Ͳ͜·ͰΔ͔
backup༻ͷSlaveͱ restore͞ΕͨDBͷ߹ੑΛߟ͑Δ
ͭ·Γʁ
BackupલͱRestoreޙͷ֬ೝ߲ʹ diff͕ͳ͍͜ͱΛ֬ೝ
֬ೝ߲ɺԿ͕͋Δ͔ͳʔ • ςʔϒϧഁଛ͕ͳ͍ࣄ • ςʔϒϧͷத͕Ұக͍ͯ͠Δ͜ͱ • ςʔϒϧఆ͕ٛҰக͍ͯ͠Δ͜ͱ • index͕Ұக͍ͯ͠Δ͜ͱ mysqlcheck
--all-databases CHECKSUM TABLE hogehoge SHOW CREATE TABLE hogehoge SHOW INDEXES FROM hogehoge
͜ΕΛ౿·্͑ͨͰcheckͷྲྀΕ
None
None
None
None
None
None
None
None
None
None
• stop Replication • pre_checksum • checksum table,show create table,show
indexes from • backup • start Replication • restore • diff pre_checksum • mysqlcheck
ͨͩ
ຖճ͜ͷchecksumΛྲྀ͢ͱ ͕͔͔࣌ؒΓ͗͢Δ
ͷͰ
࣮ࡍͷӡ༻Ͱ̎छྨʹ͚͍ͯ·͢
• ຖճ࣮ߦ • ςʔϒϧഁଛ͕ͳ͍ࣄ • िҰcheck • ςʔϒϧഁଛ͕ͳ͍ࣄ • ςʔϒϧͷத͕Ұக͍ͯ͠Δ͜ͱ
• ςʔϒϧఆ͕ٛҰக͍ͯ͠Δ͜ͱ • index͕Ұக͍ͯ͠Δ͜ͱ
͜ΕͰdataͷਖ਼ੑ ͋Δఔ୲อͰ͖͔ͨͳ
None
Θ͊ɺಈ͍ͯΔ ͭͳ͗ࠐΈͯ͠શମͰಈ͍ͨͷ͍͖ͭͬ͞
҆৺ͯ͠৸ΕΔ ( ˘ω˘ ) ţźō…
ͬͯΈͨॴײ
ਖ਼ࡢՔಇ࢝͠Ί͔͔ͨͬͩΒ·ͩײͳ͍ খཻͳͷ͔Βେཻͳͷ·Ͱ༷ʑͳαʔϏε͕ཚཱͯ͠Δঢ় گͰɺ̍αʔϏεͣͭrestoreग़དྷΔ͔ͷ֬ೝΛ৺Թ·Δख࡞ۀ Ͱ֬ೝ͠ͳͯ͘ྑ͘ͳͬͨͱ͍͏ਫ਼ਆతͳ҆Β͗Λಘͨɻ ͋ͱɺ͜Ε͙Β͍ͷ༰ྔͩͱRestoreʹͲΕ͙Β͍ͷ͕͔͔࣌ؒ Δ͔ͱ͔͕͔ͬͨΓͯͪ͠ΐͬͱָ͍͠
ࠓޙ
ෆ҆ɺվળ • check߲ͬͱ٧ΊΕΔؾ͕͢Δ • ϚαΧϦ͚Εخ͍͠Ͱ͢(;д) • ͿͬͪΌ͚·ͩ̏Service͙Β͍Ͱ͔͠Քಇͯ͠ͳ͍ • ͲΜͲΜՃ͍ͯ͘͠ •
·ͩ100GB͙Β͍·Ͱͷ༰ྔͷrestore͔ͯ͠͠ͳ͍ • ༰ྔ૿͖͑ͯͨΒࠓͷcheckͩͱऴΘΒͳ͍ؾͯ͠Δ
·ͱΊ
Backup୲อʹΑΓ
շదͳDBഁյϥΠϑΛʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠