In the hot standby server, switch to master to switch SQL

Source: Internet
Author: User

In the hot standby server, switching SQL from the master node fails in the master node. When a Hot Standby server needs to be switched in time, the original Server Load balancer under the master node also needs to be switched to the new master server in the hot standby mode in a timely manner. The basic principle of switching is that the Server Load balancer and backup server stop running in the same location, then, you only need to redirect the slave to the backup server. Because the backup server is not changed after you stop running, you only need to check the binlog location. Then, stopping slave and the backup server may not be guaranteed to be synchronous and requires manual operations. Use the following statement: show slave status \ G; to query on the Hot Backup Server and slave; log Files and locations; if the data in the backup server is ahead of schedule, you need to manually append the data on the slave; for example, start slave until master_log_file = 'master-bin.00000x ', master_log_pos = xxxxxxxx; select master_pos_wait ('master-bin.00000xxx ', xxxxxxxx); The above can be executed on the slave; after the above operations are completed, there is no problem, query the master location and file on the Hot Standby server; show master status \ G; then perform slave to change master to master_host = '', master_port =, master_user = ''............ and so on; then start slave; complete the switchover operation;

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.