[MySQL O & M] solves a master-slave Fault Caused by relay log errors

Source: Internet
Author: User


Today, a buddy sent a request for help, saying that the master node was never synchronized. He sent an error message to the master node and found that the error message from the error log was not truncated to show slave status \ G ), however, when you view the log information, the following error occurs:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140103/0031514F2-0.jpg "style =" float: none; "title =" err1.png "alt =" wKioJlLCd2ayVzOnAABZB0BrYwM314.jpg "/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140103/0031514057-1.jpg "style =" float: none; "title =" err2.png "alt =" wKioOVLCd1_hnRLVAAD8CzSb0ns805.jpg "/>


The error message above shows that the relay log cannot be read, possibly because the relay log is damaged ~~~ Based on experience, if the relay file name contains localhost, it is determined that the relay log file is damaged because the host name is modified while mysql is running.


Their current database is: Percona-Server-5.5.24-rel26.0-256.Linux.x86_64

What surprised me at this moment ~~~~ Haha ~~~~ At present, his company does not have DBA ...)


Solution:

First, check whether the slave server can be stopped .. In this case, you also have to stop the service) and ask him to stop the mysqld service. Note: before stopping the service, check: show slave status \ G to check the synchronization status of the slave node.

#/Etc/init. d/mysqld stop


Then, locate the relay log directory and delete all files related to the relay log.


Second, start the mysqld service, reset the slave master-slave connection information, and then re-connect to the master: #/etc/init. d/mysqld start

# Mysql-uroot-p

Mysql> Reset slave all; # Use reset salve all to completely clear the previous synchronization status information.Mysql> change master to master_host = '10. 11.10.25 ', master_user = 'repl _ user', master_password = 'xxxx', master_log_file = 'mysql-bin.000072', master_log_pos = 455578221; mysql> start slave;

Mysql> show slave status \ G


Finally, he followed the steps I gave and finally saw two big ones .....


According to this buddy's company's O & M summary of this fault, it is very important for the novice, And the veteran understands it ~~~ Haha: 1. binlog and relaylog log file names must be defined by themselves and written into the configuration file! 2. check before the operation... (nonsense, but many people can directly perform the operation) 3. O & M is not standardized (the host name is localhost), and the basic operation of the application is not defined ~~ 4 .....



This article is from the "->" blog and cannot be reproduced!

Related Article

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.