Mysql 5.7搭建多源复制时遇到 Error_code: 1593 these UUIDs must be different for replication to work
作者:
leo
show slave status/G; 显示错误信息
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
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.
错误日志:
2018-04-11T03:56:22.646102Z 8 [Note] Slave I/O thread for channel 'master_2': connected to master 'rep2@192.168.1.33:3306',replication started in log 'master2-bin.000002' at position 154
2018-04-11T03:56:22.648382Z 8 [ERROR] Slave I/O for channel 'master_2': 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. Error_code: 1593
2018-04-11T03:56:22.648407Z 8 [Note] Slave I/O thread exiting for channel 'master_2', read up to log 'master2-bin.000002', position 154
这个原因是因为我是vbox 装的虚拟机,复制2个虚拟机,数据库的service_id 是一样的产生的uuid 一样,后来修改service_id 搭建主从,但是auto.cnf 文件里的uuid 还是原来的
解决方法:
删除从库的datadir目录auto.cnf文件,确认/etc/my.cnt 参数server-id 是否和主库不一样,然后重启数据库生成新的auto.cnf文件,同步正常
[root@www.cndba.cn data]# rm -rf auto.cnf
[root@www.cndba.cn data]# service mysql restart
[root@www.cndba.cn data]# cat auto.cnf
[auto]
server-uuid=c4104861-3c6e-11e8-81e0-08002703bb35
版权声明:本文为博主原创文章,未经博主允许不得转载。