Fix bin-log when the log files are missing:
https://www.redips.net/mysql/replication-slave-relay-log-corrupted/
Slave side:
# stop all slaves before resetting the master (mysql) STOP SLAVE;
Master side:
# set the master database to read-only (mysql) FLUSH TABLES WITH READ LOCK; # backup the current database (bash) mysqldump -u root -p -databases db1 db2 | bzip2 > /tmp/bak.sql.bz # reset the binary logs (mysql) RESET MASTER;
Slave side:
(bash) scp -r ericpony@XXX.XXX.XXX.XXX:/tmp/bak.sql.bz /tmp # load the current database from master (mysql) SOURCE /tmp/bak.sql.bz; # reset the binary logs (mysql) RESET SLAVE; # restart slave (mysql) START SLAVE;
Master side:
# unlock the master database (mysql) UNLOCK TABLES;
Slave side:
# check if everything is ok (mysql) SHOW SLAVE STATUS \G
No comments:
Post a Comment