Home > Database > Mysql Tutorial > mysql多台数据库同步server-id重复导致的问题_MySQL

mysql多台数据库同步server-id重复导致的问题_MySQL

WBOY
Release: 2016-06-01 13:45:27
Original
1122 people have browsed it

bitsCN.com

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

bitsCN.com
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template