Sometimes in order to avoid master.info and relay log crashes, the cost of tolerating extra Fsync () is recommended to set
Sync_master_info = 1
Sync_relay_log = 1
Sync_relay_log_info = 1
Of course, if the standby and the main library latency is particularly large, the standby IO thread thanks a lot of relay logs, through the Relay_log_purge setting, the SQL thread replay the events in a trunk log after the event will be deleted as soon as possible.
In extreme cases, you need to set relay_log_space_limit so that if the size of the trunk log exceeds this value, the I/O thread will stop waiting for the SQL thread to free up disk space.
Sync_master_info: How many transactions are refreshed Master.info per interval, and if the table (InnoDB) setting is not valid, each transaction will be updated
The effects of this variable in a replication slave depend on whether the slave ' s master_info_repository are set to FILE or TABLE
Sync_relay_log: The default is 10000, which means that sync_relay_log events are flushed to disk every 10,000 times. 0 means no refresh and is left to the OS cache control
If the value of this variable are greater than 0, the MySQL server synchronizes its relay logs to disk (using Fdatasync ()) a fter every Sync_relay_log events is written to the relay log. Setting This variable takes effect for all replication channels immediately, including running channels
Sync_relay_log_info: How many transactions are refreshed Relay-log.info per interval, and if the table (InnoDB) setting is not valid, each transaction will be updated
Master_info_repository: Record the information of the main library binlog, you can set file (master.info) or table (Mysql.slave_master_info)
Relay_log_info_repository: Log The information of the repository Relaylog, you can set file (relay-log.info) or table (Mysql.slave_relay_log_info)
In order to quickly synchronize the latest data from the library with the main library, you can temporarily modify the following configurations:
Innodb_flush_log_at_trx_commit = 0
Sync_binlog = 0
Sync_master_info = 2000
Sync_relay_log = 2000
Sync_relay_log_info = 2000
MySQL is too many optimizations from the library behind the main library