目前從庫不一樣步,mysql
查看狀態:sql
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: xxxx服務器
Master_User: xxx
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: xxx-bin.000001
Read_Master_Log_Pos: 1440046
Relay_Log_File: host-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File:xxx-bin.000001
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: xxx
Replicate_Ignore_DB: mysql
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 1440046
Relay_Log_Space: 106
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)ide
從服務器大量錯誤日誌:日誌
101027 16:50:58 [Note] Slave I/O thread: connected to master 'xxx@xxxxxx:3306',replication started in log 'xxx-bin.000001' at position 1440046
101027 16:50:58 [ERROR] Error reading packet from server: Could not find first log file name in binary log index file ( server_errno=1236)
101027 16:50:58 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file', Error_code: 1236
101027 16:50:58 [Note] Slave I/O thread exiting, read up to log 'xxx-bin.000001', position 1440046code
主狀態:server
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000001
Position: 1440046
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)ip
按照正常流程解決,應該是:get
slave stop;
CHANGE MASTER TO MASTER_HOST='xxx',MASTER_USER='xx',MASTER_PASSWORD='xx',MASTER_PORT=3306,MASTER_LOG_FILE='xxx-bin.000001',MASTER_LOG_POS=1440046;同步
slave start;
問題依然存在,
後來通過如下步驟解決,不過有點困惑:
一、重啓主庫
二、給從庫從新受權
三、執行如下命令
slave stop; reset slave; slave start;