在mysql 的链式复制中 A-->B-->C 这种结构中 本人遇到一个很有趣的事情
?show slave status\G;
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.1.1.1
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000196
Read_Master_Log_Pos: 84758405
Relay_Log_File: relay-bin.000122
Relay_Log_Pos: 7445153
Relay_Master_Log_File: mysql-bin.000196
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 84758405
Relay_Log_Space: 7666726
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 2
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>
mysql>
?每个节点的复制都是正常的 ,但是就是C点的数据不更新 ,找了很多原因都没发现什么错误 。后来仔细查看发现
?A:server-id =1
?B:server-id=2
?C:server-id=1
?这种设置居然能成功配置并显示slave 正常
?于是修改C :server-id =3 再次观察复制终于工作了数据更新 。
?show slave status\G;
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.1.1.1
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000196
Read_Master_Log_Pos: 84758405
Relay_Log_File: relay-bin.000122
Relay_Log_Pos: 7445153
Relay_Master_Log_File: mysql-bin.000196
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 84758405
Relay_Log_Space: 7666726
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 2
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>
mysql>
?每个节点的复制都是正常的 ,但是就是C点的数据不更新 ,找了很多原因都没发现什么错误 。后来仔细查看发现
?A:server-id =1
?B:server-id=2
?C:server-id=1
?这种设置居然能成功配置并显示slave 正常
?于是修改C :server-id =3 再次观察复制终于工作了数据更新 。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/90618/viewspace-1064209/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/90618/viewspace-1064209/