首先我只安装了一台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.’
原因:这种原因有可能是主库重启造成的二进制文件位置从库于主库不一致
解决办法:因为之前已经说过主从复制的如何事项,请参考:https://blog.youkuaiyun.com/super_ye_man/article/details/94027175