MySQL-master-slave structure. Add New Slave

Source: Internet
Author: User
Copy from library main steps : ==================== you can see that there is a time lock table when copying from the main library, which affects the use of the main library. If we can replicate directly from the library, it will not have an impact on the main library. However, copying from the library ensures that the data from the library is not changed during the copy process, so you must first stop the library from being removed. 1. Stop from library: mysql> stop slave;2. Look at the current state from the library. As in the previous view of the main library state. But now it is copied from the library, so see:mysql> show slave status from library state; write down Relay_master_log_file and Exec_master_log_pos, and use the same as before. 3. Back up the data from the library. Mysqldump4. Restoring data from a new library 5. Set the new slave parameter from the library. Change Master to Master_host = ' 192.168.3.119 ', master_port = 3306,master_user = ' r Epl_user ', master_password= ' root ', master_log_file= ' master-bin.000005 ', master_log_pos=194244; you can see that although the new from library is the data copied from the library , but actually Binlog's master is still pointing to the main library. In addition, the Master_log_file and Master_log_pos are set as the 2nd step in the Relay_master_log_file and Exec_master_log_posstart slave;

MySQL-master-slave structure. Add New Slave

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.