【问题描述 】:
在slave库上 发现报错:
- 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必须不一样才能使复制开始生效。
在两个库上分别查看:
- mysql> SHOW VARIABLES LIKE '%server_%';
- +---------------------------------+--------------------------------------+
- | Variable_name | Value |
- +---------------------------------+--------------------------------------+
- | innodb_ft_server_stopword_table | |
- | server_id | 11 |
- | server_id_bits | 32 |
- | server_uuid | feac17c0-d55e-11e5-b426-525400079dc4 |
- +---------------------------------+--------------------------------------+
- 4 rows in set (0.00 sec)
-
-
- mysql> SHOW VARIABLES LIKE '%server_%';
- +---------------------------------+--------------------------------------+
- | Variable_name | Value |
- +---------------------------------+--------------------------------------+
- | innodb_ft_server_stopword_table | |
- | server_id | 22 |
- | server_id_bits | 32 |
- | server_uuid | feac17c0-d55e-11e5-b426-525400079dc4 |
- +---------------------------------+--------------------------------------+
- 4 rows in set (0.00 sec)
产生这个的原因:
拿虚拟机做实验,第一台装好了mysql-server,然后直接拿第一台copy成第二台导致。
导致$datadir/auto.cnf里的内容一致:
[auto]
server_uuid= xxxxxxxx
【解决方案】:
我的做法是随机拿一个uuid()函数产生的值复制并修改即可:
- mysql> SELECT uuid();
![](http://img.blog.itpub.net/blog/attachment/201602/17/29773961_1455705574hzJz.png?x-oss-process=style/bb)
不过这个参数是静态的,所以需要重启mysql。
作者微信公众号(持续更新)
![](http://img.blog.itpub.net/blog/attachment/201805/23/29773961_1527063244bg8q.png?x-oss-process=style/bb)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29773961/viewspace-1990172/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29773961/viewspace-1990172/