1.PaaS平台的mysql双主设置报错如下:
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.
#致命错误:从库 I / o线程停止,因为主从的MySQL server UUID相等;这些UUID必须不同才能使复制工作。
2.查看mysql的数据目录:
3.进入数据目录,查看 auto.cnf配置文件:
cat auto.cnf
4.查看另一个mysql的auto.cnf配置文件,发现uuid一致。
5.更改uuid:
备份auto.cnf: cp auto.cnf auto.cnf.bak
docker restart mysql
6.同步2个mysql的binlog日志:
stop slave;
change master to master_host=‘另一个mysql IP地址’,master_user=‘root’,master_password=‘密码’,master_log_file=‘mysql-bin.000008’,master_log_pos=758; #去对端看,show master status;根据实际情况填写。
start slave;
7.show slave status \G;