MySQL Production library master-Slave resynchronization operation considerations

Source: Internet
Author: User

Be sure to remember reset before restoring from the library, because restarting MySQL does not affect the replication process, and if you forget reset, it will cause you to recover while the main library has actions to write from the library, when you change the master acid can not be guaranteed.

Reset slave All;



After clearing the master-slave information, you can start the recovery from the library with the Master library's full provisioning

[[Email protected]~]# mysql-uroot-p </databackup/fullbackup/20160403.sql


view in the main library backup set Binlog and the position Offset Amount

[Email protected]fullbackup]# cat/databackup/fullbackup/20160403.sql|grep "Change Masterto master_log_file= '"

--Changemaster to master_log_file= ' mysql-bin.000006 ', master_log_pos=120;

of the backup set Binlog The logs are here. mysql-bin.000006 Offset Amount position to the -

From library:

when you read the main library from the library configuration IP address, copy the user name and password from the main library which BINLOG What is the offset of the file starting to read?

mysql> Changemaster tomaster_host= ' 192.168.1.250 ', master_user= ' Mysync ', master_password= ' MANAGER ', master_port=4008, Master_log_file= ' mysql-bin.000006 ', master_log_pos=120;

Turn on the copy switch from the library

Mysql> Startslave;

Query OK, 0 rowsaffected (0.30 sec)

Mysql>show slave status\g;


This article is from the "Age volt" blog, please make sure to keep this source http://suifu.blog.51cto.com/9167728/1828042

MySQL Production library master-Slave resynchronization operation considerations

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.