Mysql One example of master-slave replication Interruption
received MySQL Master-Slave interrupt alarm, immediately boarded the server to view, found that the trunk log corruption.
Show slave Status\g, indicating that the relay log is corrupted.
relay log read failure: could not parse relay log event Entry. the possible reasons are: the master ' s binary log is corrupted (you can check this by running ' Mysqlbinlog ' on the binary log), the slave ' s relay log is corrupted (you can check this by running ' Mysqlbinlog ' on the relay log), a network problem, or a bug in the master ' S or slave ' s Mysql code. if you want to check the master ' S binary log or slave ' S relay log, you will be able to know their names by issuing ' Show slave status ' on this slave.
2. starting with the mysql5.5.x version, the Relay_log_recovery parameter is added, and the function of this parameter is: When slave is down from the library, if Relay-log is damaged, Causes a portion of the trunk log to not be processed, automatically discards any relay-log that are not executed, and retrieves the log from master again, which is turned off by default. This parameter is not opened when the master is in charge. Modify my. CNFTo add these two items. (Skip-slave-start, the MySQL service starts skipping auto-start master-slave replication to avoid new problems ) and restarts MySQL, and then manually initiates a master-slave copy.
Relay_log_recovery = 1
Skip-slave-start = 1
3. again check show Slavestatus\g, synchronization has been restored, is applying the relay log, and so on after the synchronization is completed, and then randomly checks a table, data consistent
#########################################################
relay_master_log_file:mysql-bin.000642
Slave_io_running:yes
Slave_sql_running:yes
##############################################
Master_ssl_key:
seconds_behind_master:0
master_ssl_verify_server_cert:no
last_io_errno:0
last_io_error:
last_sql_errno:0
last_ Sql_error: