mysqldump造成sql_thread停止
利用从库备份期间,收到slave sql_thread stop的报警,检查状态如下:
(1)show slave status输出
Relay_Master_Log_File: mysql-bin.009188
Slave_IO_Running: Yes
Slave_SQL_Running: No
(2)error log输出
2017-12-13 10:35:14 61080 [Note] Error reading relay log event: slave SQL thread was killed
2017-12-13 10:44:02 61080 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.009188' at position 85266734, relay log './relay-bin.017692' position: 85266897
对应mysqldump手册检查备份脚本
脚本包含--dump-slave=2 (备份带有注释的change master)
参数解释中有一句话
This option causes mysqldump to stop the slave SQL thread before the dump and restart it again after.
结论:就是备份前stop slave,备份结束再start slave;