MySQL master-slave delay setting

Source: Internet
Author: User

Mysql (requires more than 5.6) delays the replication configuration by setting the MASTER to master_delay parameter on the slave:


Change MASTER to Master_delay = N;


n is the number of seconds, the statement set from the database delay of n seconds, and then synchronize data with the primary database replication

Specific operation:

Log in to the slave database server

Mysql>stop slave;

Mysql>change MASTER to Master_delay = 600;

Mysql>start slave;

mysql>show slave status \g;

Viewing the value of Sql_delay is 600, indicating that the setting was successful.


Comments:


Sql_delay: A non-negative integer that represents the number of seconds, slave lags in the master.


Sql_remaining_delay: When Slave_sql_running_state waits until master_delay seconds, the master executes the event,


This field contains an integer that represents the number of seconds or so of a delay. At other times, this field is null.

Reference: MySQL official website (http://dev.mysql.com/doc/refman/5.6/en/replication-delayed.html)


This article is from the "16 Stage One Pit" blog, please be sure to keep this source http://tlinux.blog.51cto.com/7288656/1760755

MySQL master-slave delay setting

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.