Problem started at 05:02:58 on 2019.10.12
Problem name: Slave is stopped on 192.168.56.31:3306
Host: 192.168.56.31
Severity: High
2019-10-12T05:01:16.506540+08:00 1 [Note] Slave I/O thread killed while reading event for channel ''
2019-10-12T05:01:16.506605+08:00 1 [Note] Slave I/O thread exiting for channel '', read up to log 'mybinlog.001265', position 388024306
即非正常停止。
2019-10-12T05:01:59.414412+08:00 373818 [Note] Aborted connection 373818 to db: 'unconnected' user: 'repl' host: '192.168.56.31' (failed on flush_net())
2019-10-12T05:01:59.414424+08:00 407536 [Note] Aborted connection 407536 to db: 'unconnected' user: 'repl' host: '192.168.56.49' (failed on flush_net())
从主库日志可以看出,2个从库是主库主动断开的,而给出的信息也指出了原因failed on flush_net()。另外还有很多 Got timeout reading communication packets 的信息。
出现此类问题的可能是TCP拥堵等情况造成的,因此建议生产环境的操作系统参数进行调整。可参考如下方式修改
/** 在 /etc/sysctl.conf 文件目录末尾增加如下参数 */
kernel.sem=250 32000 100 128
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
/** 使参数生效 */
sysctl -p
精彩推荐:
1. MySQL不停地自动重启怎么办
2. 升级python,就是这么简单
3. MySQL里trx_mysql_thread_id为0 的事务导致大量锁等待超时该咋整
4. mysql8.0新增用户及加密规则修改的那些事
5.Postgresql部署及简单操作
6.比hive快10倍的大数据查询利器-- presto
7. 监控利器出鞘:Prometheus+Grafana监控MySQL、Redis数据库