錯誤總結:
Slave_IO_Running: No
Slave_SQL_Running: Yes
[ERROR] Slave I/O: 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). Error_code: 1593
egrep server-id /data/3306/my.cnf /data/3307/my.cnf
/data/3306/my.cnf:server-id = 6
/data/3307/my.cnf:server-id = 7
如何解決:
mysql> CHANGE MASTER TO
-> MASTER_HOST='172.16.1.51',
-> MASTER_PORT=3306,
-> MASTER_USER='rep',
-> MASTER_PASSWORD='oldboy123',
-> MASTER_LOG_FILE='oldboy-bin.000001',
-> MASTER_LOG_POS=405;
本來該寫到3307的寫到3306.修改后正確
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Slave_IO_Running: No
Slave_SQL_Running: Yes
[ERROR] Slave I/O: 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). Error_code: 1593
egrep server-id /data/3306/my.cnf /data/3307/my.cnf
/data/3306/my.cnf:server-id = 6
/data/3307/my.cnf:server-id = 7
如何解決:
mysql> CHANGE MASTER TO
-> MASTER_HOST='172.16.1.51',
-> MASTER_PORT=3306,
-> MASTER_USER='rep',
-> MASTER_PASSWORD='oldboy123',
-> MASTER_LOG_FILE='oldboy-bin.000001',
-> MASTER_LOG_POS=405;
本來該寫到3307的寫到3306.修改后正確
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
*****20170320*****
如果克隆虛擬機推了整個目錄,啟動slave會報錯 Slave_IO_Running: No
Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.
解決辦法: cd /application/mysql/data mv auto.cnf auto.cnf.bak /etc/init.d/mysqld restart
Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.
解決辦法: cd /application/mysql/data mv auto.cnf auto.cnf.bak /etc/init.d/mysqld restart
*****20170321*****
如果沒有修改級聯server-id和master不一樣就會報如下錯誤
[ERROR] Slave I/O: 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).
Error_code: 1593
解決辦法:修改server-id和master庫不一樣
*****20170323*****
Slave_IO_Running:Yes
Slave_SQL_Running:NO
Seconds_Behind_Master:NULL
error cant't create database database 'xiaoliu';database exits' on query.Default database:'xiaoliu'.query
解決辦法:
解決1:
stop slave; #臨時停止同步開關
set global sql_slave_skip_counter = 1; #將同步指針向下移動一個,如果多次不同步,可以重復操作。
start slave;
解決2:
根據可以忽略的錯誤號事先在配置文件中配置,
跳過指定的不影響業務數據錯誤,如
[root@db03-53 ~]# grep slave-skip /data/3306/my.cnf slave-skip-errors = 1032,1062