the master's binary log is corrupted
主從複製報錯,下面是從庫複製狀態:
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.129.150
Master_User: replicat
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000197
Read_Master_Log_Pos: 213271941
Relay_Log_File: mysql-relay-bin.000584
Relay_Log_Pos: 1037392990
Relay_Master_Log_File: mysql-bin.000195
Slave_IO_Running: Yes
Slave_SQL_Running: No
...
Last_Errno: 1594
Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Skip_Counter: 0
Exec_Master_Log_Pos: 1037392827
Relay_Log_Space: 2368588837
...
Last_SQL_Errno: 1594
Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Replicate_Ignore_Server_Ids:
Master_Server_Id: 3
Master_UUID: 58c0c354-8652-11e6-bebe-40f2e9ddc532
Master_Info_File: /data/DB/mysql/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp: 161018 09:38:49
....
中繼日誌讀主庫日誌失敗 ,順道看下錯誤日誌資訊,日誌顯示從庫9點37分時重啟了,38分出現主從故障,看樣子是因為從庫異常重啟導致的!
161018 09:37:39 mysqld_safe Number of processes running now: 0
161018 09:37:39 mysqld_safe mysqld restarted
...
2016-10-18 09:38:49 6042 [ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594
解決方法,重新設定主從程式解決:
mysql> stop slave;
Query OK, 0 rows affected (0.02 sec)
mysql> reset slave;
Query OK, 0 rows affected (0.57 sec)
mysql> change master to master_host='192.168.129.150',
-> master_user='replicat',
-> master_password='passw',
-> master_log_file='mysql-bin.000195',
-> master_log_pos=1037392827;
Query OK, 0 rows affected, 2 warnings (0.07 sec)
mysql> start slave;
Query OK, 0 rows affected (0.03 sec)
以前從庫異常重啟都沒發生這類情況,網上查了相關資料,發現和relay_log_info_repository和relay_log_info_repository這兩個引數有關
mysql> show variables like '%relay_log_info_repository%';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| relay_log_info_repository | FILE |
+---------------------------+-------+
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| relay_log_info_repository | FILE |
+---------------------------+-------+
1 row in set (0.00 sec)
mysql> show variables like '%relay_log_info_repository%';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| relay_log_info_repository | FILE |
+---------------------------+-------+
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| relay_log_info_repository | FILE |
+---------------------------+-------+
1 row in set (0.00 sec)
把FILE修改成TABLE可以降低這種主從失敗發生的機率。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29989552/viewspace-2126637/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Got fatal error 1236 from master when reading data from binary logGoErrorAST
- MySQL Binary LogMySql
- change master 未指定master_log_fileAST
- Mysql Binary Log (1)MySql
- Mysql Binary Log (2)MySql
- show master logs 和 show master status 區別AST
- mysql binlog 刪除master- binlogMySqlAST
- Master of Science in Information System TechnologyASTORM
- mysql的binary-log操作MySql
- Could not find first log file name in binary log index fileIndex
- MySQL案例09:Last_IO_Error: Got fatal error 1236 from master when reading data from binary logMySqlASTErrorGo
- innodb的redo log以及與binary log的區別
- Read of flashback database logfile 502, block 251 found corrupted data.DatabaseBloC
- k8s學習 - 概念 - master/nodeK8SAST
- k8s單master叢集部署K8SAST
- 執行mysqlbinlog出現Found invalid event in binary log錯MySql
- Machine Learning (6) - Logistic Regression (Binary Classification)Mac
- oldwain's blogAI
- biti's blog
- PURGE MASTER LOGS語法--MySql資料庫ASTMySql資料庫
- MariaDB系列之三:基於日誌(binlog)主主複製(Master-Master)AST
- MySQL Master/Slave Master/MasterMySqlAST
- opatch命令報錯Inventory is corrupted
- MySQL Binlogging Fails With Writing One Row To The Row-based Binary Log FailedMySqlAI
- MySQL:簡單記錄刪除binary log的介面MySql
- 【K8S】基於單Master節點安裝K8S叢集K8SAST
- Louise's BlogUI
- WebLeOn's BlogWeb
- Oracle’s NOLOGGINGOracle
- MySQL日誌警告'[Warning] Unsafe statement written to the binary log'MySql
- Master Note: Overview of Redo Logs and Archiving_1503091.1ASTView
- biti_rainy's blogAI
- ! [rejected] master -> master (fetch first)AST
- Mysql5.6 Master+MasterMySqlAST
- mysql關於二進位制日誌binary log的總結MySql
- [0126]理解_corrupted_rollback_segments
- Strategies for a Corrupted Oracle Central Inventory [ID 414600.1]Oracle
- 修復已經CORRUPTED的資料塊