问题描述
一主一从mysql架构,在启动slave后 show slave status\G
报错The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.
uuid相同,想到自己用的slave虚拟机是克隆了Mater的虚拟机,所以里面的各项配置都一样
问题解决
先找到 mysql 的 auto.cnf文件
sudo find / -name 'auto.cnf'
sudo vim /var/lib/mysql/auto.cnf
可以先在mysql中生成一个uuid
然后复制到 auto.cnf
中
重启mysql服务
systemctl restart mysql
再次查看slave状态 show slave status\G