MySQL Delayed Replication

MySQL 5.6 supports delayed replication such that a slave server deliberately lags behind the master by at least a specified amount of time. The default delay is 0 seconds. Use the MASTER_DELAY option for CHANGE MASTER TO to set the delay to N seconds:

CHANGE MASTER TO MASTER_DELAY = N;

An event received from the master is not executed until at least N seconds later than its execution on the master. The exceptions are that there is no delay for format

Example:

CHANGE MASTER TO
  MASTER_HOST='10.18.1.1',
  MASTER_USER='repl',
  MASTER_PASSWORD='repl',
  MASTER_PORT=3306,
  MASTER_LOG_FILE='mysql-bin.000102',
  MASTER_LOG_POS=733879632,
  MASTER_DELAY = 7200,
  MASTER_CONNECT_RETRY=10;

共有 0 条评论

Top