Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TRUNCATE user;に如何にして立ち向かうか

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for meru_akimbo meru_akimbo
November 20, 2018

TRUNCATE user;に如何にして立ち向かうか

2017年 YAPC::Kansaiでの発表資料です
https://yapcjapan.org/2017kansai/

Avatar for meru_akimbo

meru_akimbo

November 20, 2018
Tweet

Other Decks in Programming

Transcript

  1. ฐࣾͰΑ͋͘Δmysqlߏ੒ • લఏͱͯ͠ΦϯϓϨ • master 1୆ɺslave n୆ɺbackup 1୆ • backup͸24࣌ؒʹ1౓

    • backup༻ͷDBΛҰ౓ࢭΊͯcp͢Δ • ऴΘͬͨΒbackup༻DBΛ࠶౓্ཱͪ͛
  2. /etc/init/mysqlΑΓ # MySQL Service description "MySQL Server" author "Mario Limonciello

    <[email protected]>" start on runlevel [2345] stop on starting rc RUNLEVEL=[016] respawn respawn limit 2 5 env HOME=/etc/mysql umask 007 # The default of 5 seconds is too low for mysql which needs to flush buffers kill timeout 300 ҎԼলུ
  3. START SLAVE ͷUTILΦϓγϣϯ • START SLAVE UTIL RELAY_LOG_FILE = 'log_name',

    RELAY_LOG_POS = log_pos • ࢦఆͷrelaylogͷࢦఆͷpositionͰstop͢Δ Α͏ʹ্ͨ͠Ͱstart slaveͰ͖Δ • ͋ͱ͸RESET SLAVE ALL;ͰmasterʹͳΕΔ