ITPub博客

首页 > 数据库 > MySQL > 【MySQL】Last_IO_Errno: 1593 server-uuid重复导致slave报错

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

原创 MySQL 作者:神谕丶 时间:2016-02-17 18:41:39 0 删除 编辑

【问题描述】:
在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。


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


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29773961/viewspace-1990172/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
微信公众号:神谕的暗影长廊

注册时间:2014-07-28

  • 博文量
    161
  • 访问量
    1196465