您的位置:首页 > 数据库 > MySQL

mysql 基础-搭建的两台从库server-id相同,会出现什么情况?搭建的主库和从库server-id相同,又会出现什么情况?

2012-08-19 15:01 597 查看
主从相同时 ,出现从库不能io线程不能同步,show slave status:

Fatal error: The slave I/O thread stops because master and slavehave equal MySQL server ids; these ids must be different for replication to work(or the --replicate-same-server-id option must be used on slave but this doesnot always make sense; please check
the manual before using it).

正如上面所说,可以配置--replicate-same-server-id,但是如果配置这个选项就不能配置--slave-log-updates,因为这样可能会导致内循环,如下:

using --replicate-same-server-id in conjunction with--log-slave-updates is impossible, it would lead to infinite loops in thisserver.

从和从相同:

从服务器的io线程总是在这个之间切换,两个从库的io线程轮流争抢主库连接。

Queueing master event to the relay log和 Waiting toreconnect after a failed master event read。

错误日志中循环出现

120810 16:12:53 [Note] Slave: received end packet from server,apparent master shutdown:

120810 16:12:53 [Note] Slave I/O thread: Failed reading log event,reconnecting to retry, log 'mysql-bin.000023' at postion 537

[c1]直接说:主从相同时从库同步会停止,然后再列出错误日志,否则回答的没有重点

[c2]哪个?直接回答:两个从库的io线程会争抢id,交互断开,注意提炼
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐