ubantu 5.7版本mysql主從 關(guān)于UUID的解決方法

遇到的問題:Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs;?

解決故障:

###查看auto.cnf文件

[root@dbsrv1 ~] cat /data/mysqldata/auto.cnf? ### 主上的uuid

[auto]

server-uuid=62ee10aa-b1f7-11e4-90ae-080027615026

[root@dbsrv2 ~]# more /data/mysqldata/auto.cnf ###從上的uuid,果然出現(xiàn)了重復(fù),原因是克隆了虛擬機,只改server_id不行

[auto]

server-uuid=62ee10aa-b1f7-11e4-90ae-080027615026

[root@dbsrv2 ~]# mv /data/mysqldata/auto.cnf? /data/mysqldata/auto.cnf.bk? ###重命名該文件

[root@dbsrv2 ~]# service mysql restart? ? ? ? ? ###重啟mysql

[root@dbsrv2 ~]# more /data/mysqldata/auto.cnf? ###重啟后自動生成新的auto.cnf文件,即新的UUID

[auto]

server-uuid=6ac0fdae-b5d7-11e4-a9f3-0800278ce5c9

###再次查看slave的狀態(tài)已經(jīng)正常

[root@dbsrv1 ~]# mysql -uroot -pxxx -e "show slave status\G"|grep Running

Warning: Using a password on the command line interface can be insecure.

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容