时间:2021-07-01 10:21:17 帮助过:18人阅读
今天在设置一台新SLAVE数据库服务器后,发现MASTER和SLAVE服务器都出现大量 TIME_WAIT数据库连接:
tcp 0 0 19.2.33.156:56247 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56241 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56150 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56144 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56147 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56174 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56160 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56162 19.2.168.228:3306 TIME_WAIT
tcp 0 0 19.2.33.156:56066 19.2.168.228:3306 TIME_WAIT
在新增加SLAVE数据库服务器上查看错误日志,不断出现下面错误信息:
110826 15:44:14 [Note] Slave: received end packet from server, apparent master shutdown:
100826 15:44:14 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log ‘mysql-bin.000017′ at postion 239813
100826 15:44:15 [Note] Slave I/O thread killed while reading event
经过检查发现有二台SLAVE服务器server-id设置一样,更改其中一台server-id并重启服务后数据库同步恢复正常,很多人习惯通过复制my.cnf文件配置数据库同步,切记要变更server-id,对于第一次碰到这个错误信息很难定位错误原因,质疑mysql为什么不能报告更能定位原因的错误信息?.
本文出自 “IT牛奶” 博客