MySQL Replication Fatal Error 1236
091127 21:50:21 [ERROR] Error reading packet from server: Client requested master to start replication
from impossible position ( server_errno=1236)
091127 21:50:21 [ERROR] Got fatal error 1236: 'Client requested master to start replication
from impossible position' from master when reading data from binary log
091127 21:50:21 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000535', position 193022771
Slave_IO_Running執行緒終止。仔細看上面的報錯資訊,說slave程式試圖從mysql-bin.000535日誌的 position 193022771開始啟動恢復,但是該日誌中是沒有這個position的。
跑到A上透過mysqlbinlog檢視該日誌,發現最後一個有效position是193009460。而要求的193022771已經大於最後有效的position了。這個原因就搞不明白了,難道是因為A庫異常關閉後導致A節點的binlog沒有來得及刷到磁碟,而B節點slave已經恢復到前面去了?
$mysqlbinlog mysql-bin.000535 > 1.txt
$tail -n 7 1.txt
# at 193009460
#091127 20:50:21 server id 1 end_log_pos 193009487 Xid = 194299849
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
嘗試將B節點change master到最後一個有效的position處,問題暫時得到解決:
change master to master_log_file='mysql-bin.000535', master_log_pos=193009460
網上搜尋了一把,發現logzgh之前也碰到過同樣的問題,版本是5.0.51。
=================================================================
轉:http://denniswwh.itpub.net/post/15174/471080
今天幾臺MySQL伺服器突然停電,重啟後複製無法啟動,總是報如下錯誤:
080922 10:29:01 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000778' at position 2874108, relay log '
./relay-bin.003287' position: 2874245
080922 10:29:01 [Note] Slave I/O thread: connected to master 'replication@192.168.0.10:3306', replication started in log 'mysql-b
in.000778' at position 2874108
080922 10:29:01 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( se
rver_errno=1236)
080922 10:29:01 [ERROR] Got fatal error 1236: 'Client requested master to start replication from impossible position' from master wh
en reading data from binary log
為什麼會報impossible position呢?開啟mysql-bin.000778看看。
mysqlbinlog mysql-bin.000778 > log.sql
tail -f log.sql
# at 2871574
#080922 10:20:27 server id 2 end_log_pos 2871601 Xid = 2516638
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/
最後一個position是2871574,而 從庫要從2874108開始,難怪報impossible position,難道是斷電時有部分log在快取中還沒來得及寫入binglog?無論如何先恢復再說吧
stop slave;
CHANGE MASTER TO
MASTER_LOG_FILE='mysql-bin.000778',
MASTER_LOG_POS=2871574;
start slave;
show slave statusG
同步正常。。
後來檢視主庫的啟動日誌中這樣一段
InnoDB: Last MySQL binlog file position 0 2874108, file name ./mysql-bin.000778
080922 10:22:09 InnoDB: Started; log sequence number 6 2534366248
080922 10:22:09 [Note] Recovering after a crash using mysql-bin
080922 10:22:09 [Note] Starting crash recovery...
080922 10:22:09 [Note] Crash recovery finished.
080922 10:22:09 [Note] /usr/sbin/mysqld: ready for connections.
這裡Last MySQL binlog file position 0 2874108也是錯誤的,這個資訊到底是哪裡來的呢?為什麼會這樣呢?不明白。
為了保證以後binglog及時寫入,將主庫 sync_binlog變數設定1。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21601207/viewspace-687697/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Last_IO_Error: Got fatal error 1236ASTErrorGo
- MySQL案例09:Last_IO_Error: Got fatal error 1236 from master when reading data from binary logMySqlASTErrorGo
- MySQL主從複製報錯:Got fatal error 1236 from master when reading data fromMySqlGoErrorAST
- MySQL主從同步報error 1236MySql主從同步Error
- FATAL - Fatal error: Target Interaction Manager failed at StartupErrorAI
- [Code Composer Studio] fatal error #6001Error
- Build mysql replicationUIMySql
- MySQL Group ReplicationMySql
- Mysql:1236常見錯誤MySql
- Fatal error in launcher: Unable to create process using '"'Error
- Fatal NI connect error 12170 錯誤Error
- Fatal error: Uncaught PDOException: could not find driverErrorException
- Fatal error: Cannot redeclare printerror() (previously declared in …Error
- fatal error: libmemcached/memcached.h: No such file or directoryErrorIBM
- fatal error: openssl/sha.h: No such file or directoryError
- fatal error: sys/cdefs.h: No such file or directoryError
- PHP Fatal error: Allowed memory size of 1610612736 bytesPHPError
- MySQL基於GTIDs的MySQL ReplicationMySql
- Mysql replication check指令碼MySql指令碼
- MySQL group replication介紹MySql
- An Overview of PostgreSQL & MySQL Cross ReplicationViewMySqlROS
- Thread 1: Fatal error: init(coder:) has not been implementedthreadError
- 如何修復 “fatal error: security/pam_modError
- Mysql Replication學習記錄MySql
- Fatal error: can't check configuration file '/home/watt/proxy/dError
- fatal: [192.168.65.128]: UNREACHABLE! => {"changed": false, "msg": "SSH Error: data could not be senFalseError
- git push fatal: HttpRequestException encountered. An error occurred while sending the requestGitHTTPExceptionErrorWhile
- Docker安裝MySQL8.0.39報錯:Fatal glibc error: CPU does not support x86-64-v2DockerMySqlError
- MYSQL Group Replication搭建過程記錄MySql
- MGR(MySQL Group Replication)部署搭建測試MySql
- MySQL資料庫1236錯誤模擬和解決MySql資料庫
- Ubuntu下 fatal error: Python.h: No such file or directory 解決方法UbuntuErrorPython
- [ERROR] [MY-012872] [InnoDB] [FATAL] Semaphore wait has lasted > 600 secondsErrorAIAST
- 故障案例:主從同步報錯Fatal error: The slave I/O thread stops because master and slave have equal MySQL server主從同步ErrorthreadASTMySqlServer
- 【MySQL】MySQL Replication 一主一備搭建步驟(GTID方式)MySql
- MySQL8.0.16新特性:The Communication Protocol In Group ReplicationMySqlProtocol
- golang原始碼安裝時fatal error: MSpanList_Insert錯誤Golang原始碼Error
- Composer 記憶體不足解決方案 PHP Fatal error: Out of memory記憶體PHPError
- windows終端輸入pip install requests報錯:Fatal error in launcherWindowsError