MySQL Master interrupt

Source: Internet
Author: User

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.

  1. 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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.