mysql主从复制之异常解决--- Slave_IO_Running: NO 之三大原因

来源:互联网 发布:局域网带宽控制软件 编辑:程序博客网 时间:2024/06/05 00:32

失之毫厘,差之千里,mysql同步数据就是这样

关于 Slave_IO_Running: NO 的错误其实有很多原因,在这先说一种

环境:Centos6.7 , MySQL-5.6.25
首先我只安装了一台linux 又克隆了两台,一主两从 , 关键点就在于我是克隆的,才导致了报Slave_IO_Running: NO
原因一
原因:mysql 有个uuid , 然而uuid 是唯一标识的,所以我克隆过来的uuid是一样的,只需要修改一下uuid 就ok了,找到auto.cnf 文件修改uuid

    auto.cnf文件一般在  ./var/lib/mysql/auto.cnf , 如果没有那就用linux 查询命令找:find -name auto.cnf

原因二

Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have 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 does not always make sense; please check the manual before using it).

原因: 首先确认server-id 是否唯一, mysql 有可能并没有加载my.cnf 文件中的server-id解决办法:①修改server-id (在my.cnf 文件中) ,         ② mysql> set global server_id=119; #此处的server_id的值和my.cnf里设置的一样          mysql> start slave;

原因三

Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ‘binlog truncated in the middle of event; consider out of disk space on master; the first event ‘mysql-bin.000003’ at 9179, the last event read from ‘./mysql-bin.000003’ at 9179, the last byte read from ‘./mysql-bin.000003’ at 9179.’

原因:这种原因有可能是主库重启造成的二进制文件位置从库于主库不一致解决办法:因为之前已经说过主从复制的如何事项,请参考:http://blog.csdn.net/mqsyoung/article/details/78333151
原创粉丝点击