线上某台数据库服务起的日志量比较大,发现大量如下日志:
2020-06-12T11:07:43.855027+08:00 31628085 [Note] Start asynchronous binlog_dump to slave (server_id: 1628551066), pos(, 4)
2020-06-12T13:36:13.982917+08:00 31634106 [Note] While initializing dump thread for slave with UUID <cdd1d2c1-aa15-11ea-b8b4-fa160e9d2062>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread(31628085).
2020-06-12T13:36:13.983021+08:00 31634106 [Note] Start binlog_dump to master_thread_id(31634106) slave_server(1628551066), pos(, 4)
2020-06-12T13:36:13.983032+08:00 31634106 [Note] Start asynchronous binlog_dump to slave (server_id: 1628551066), pos(, 4)
2020-06-12T13:36:13.983098+08:00 31628085 [Note] Stop asynchronous binlog_dump to slave (server_id: 1628551066)
2020-06-12T15:53:14.110616+08:00 31639663 [Note] While initializing dump thread for slave with UUID <cdd1d2c1-aa15-11ea-b8b4-fa160e9d2062>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread(31634106).
2020-06-12T15:53:14.110791+08:00 31639663 [Note] Start binlog_dump to master_thread_id(31639663) slave_server(1628551066), pos(, 4)
2020-06-12T15:53:14.110803+08:00 31639663 [Note] Start asynchronous binlog_dump to slave (server_id: 1628551066), pos(, 4)
该问题,主要由以下一下2个参数引发:
1、slave_net_timeout
表示slave在slave_net_timeout时间之内没有收到master的任何数据(包括binlog,heartbeat),slave认为连接断开,会进行重连。
2、MASTER_HEARTBEAT_PERIOD 代表主库 没有二进制日志发送的时候,给从库发送心跳包的时间间隔。
当MASTER_HEARTBEAT_PERIOD<slave_net_timeout 时,并且主库没有二进制日志产的时候,会引发上面的问。
当然这个问题本身问题不大,但是可以避免的时候,我们需要尽量避免。
MASTER_HEARTBEAT_PERIOD 的设置方法,设置master_heartbeat_period 为slave_net_timeout 的一半即可。
mysql> stop slave;
mysql> change master to master_heartbeat_period = 10;
mysql> start slave;
另外,默认master_heartbeat_period 的值为slave_net_timeout 的一半,可以不用设置。
线上数据库服务出现大量'found a zombie dump thread with the same UUID'错误日志,该问题由'slave_net_timeout'和'MASTER_HEARTBEAT_PERIOD'参数引起。当MASTER_HEARTBEAT_PERIOD小于slave_net_timeout且主库无二进制日志时,导致从库重连。解决方案是将MASTER_HEARTBEAT_PERIOD设为slave_net_timeout的一半,或保持默认值。
1424

被折叠的 条评论
为什么被折叠?



