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