今天在設置一台新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牛奶” 博客