【MySQL】Last_IO_Errno: 1593 server-uuid重复导致slave报错


【问题描述】:
在slave库上发现报错:
  1. mysql> SHOW SLAVE STATUS\G

…………………………………………

Last_IO_Errno: 1593
Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.
…………………………………………

错误提示很明显,master的uuid和slave的uuid相等,uuid必须不一样才能使复制开始生效。

在两个库上分别查看:

  1. mysql> SHOW VARIABLES LIKE '%server_%';
  2. +---------------------------------+--------------------------------------+
  3. | Variable_name                   | Value                                |
  4. +---------------------------------+--------------------------------------+
  5. | innodb_ft_server_stopword_table |                                      |
  6. | server_id                       | 11                                   |
  7. | server_id_bits                  | 32                                   |
  8. | server_uuid                     | feac17c0-d55e-11e5-b426-525400079dc4 |
  9. +---------------------------------+--------------------------------------+
  10. 4 rows in set (0.00 sec)


  11. mysql> SHOW VARIABLES LIKE '%server_%';
  12. +---------------------------------+--------------------------------------+
  13. | Variable_name                   | Value                                |
  14. +---------------------------------+--------------------------------------+
  15. | innodb_ft_server_stopword_table |                                      |
  16. | server_id                       | 22                                   |
  17. | server_id_bits                  | 32                                   |
  18. | server_uuid                     | feac17c0-d55e-11e5-b426-525400079dc4 |
  19. +---------------------------------+--------------------------------------+
  20. 4 rows in set (0.00 sec)


产生这个的原因:
拿虚拟机做实验,第一台装好了mysql-server,然后直接拿第一台copy成第二台导致。


导致$datadir/auto.cnf里的内容一致:
[auto]
server_uuid= xxxxxxxx




【解决方案】:

我的做法是随机拿一个uuid()函数产生的值复制并修改即可:

  1. mysql> SELECT uuid();




不过这个参数是静态的,所以需要重启mysql。


作者微信公众号(持续更新)


请使用浏览器的分享功能分享到微信等