The slave I/O thread stops because master and slave have equal MySQL server UUIDs

实验环境

操作系统:CentOS Linux release 7.3.1611 (Core)

数据库系统: MySQL 5.7.19

部署mysql的ab复制的时候出现的UUID的问题,

mysql> show slave status\G;

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.

问题提示主从使用了相同的server UUID,一个个的检查:

检查主从server_id

mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000001 |      154 |              |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
————————————————
检查从库的uuid

mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000001 |      408 |              |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

发现文件是一样的需要再查看别的
 

vim /var/lib/mysql/auto.cnf

[auto] server-uuid=4f37a731-9b79-11e8-8013-000c29f0700f

发现主从的这个auto.cnf中的uuid是一样的

解决办法

停止从库的mysql

systemctl stop mysqld

然后

所以删除或者是移走从库的auto.cnf

直接重启MySQL 集群

systemctl restart mysqld

进入到mysql的交互

直接查看是两个yes 直接成功

若是出现报错

Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'

 

可以

stop slave;

reset slave;

start slave;

一般的通过这几步骤就可以搞定了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值