[ERROR] Slave I/O: Replication event checksum verification failed while reading from network. Error_code: 1743
的模拟:
目前主从状态是正常的:
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.118.161
Master_User: sla
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: bin.000063
Read_Master_Log_Pos: 120
Relay_Log_File: a.000002
Relay_Log_Pos: 277
Relay_Master_Log_File: bin.000063
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
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: 120
Relay_Log_Space: 436
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: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 2
Master_UUID: 69691b70-04e4-11e5-ad6d-000c292f3ddd
Master_Info_File: /var/lib/mysql/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)
mysql> stop slave;
Query OK, 0 rows affected (0.01 sec)
mysql> show variables like '%master%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| master_info_repository | FILE |
| master_verify_checksum | OFF |
| sync_master_info | 10000 |
+------------------------+-------+
3 rows in set (0.00 sec)
重新启动主: 或者使用flush logs
主:mysql> show variables like '%master%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| master_info_repository | FILE |
| master_verify_checksum | OFF |
| sync_master_info | 10000 |
+------------------------+-------+
3 rows in set (0.00 sec)
mysql> show master status;
+------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------+----------+--------------+------------------+-------------------+
| bin.000064 | 120 | | | |
+------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
在主上使用vi 修改bin.000064
mysql> show binlog events in 'bin.000064';
ERROR 1220 (HY000): Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
在从上:
mysql> start slave;
Query OK, 0 rows affected (0.02 sec)
mysql> show slave status \G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.118.161
Master_User: sla
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: bin.000064
Read_Master_Log_Pos: 4
Relay_Log_File: a.000004
Relay_Log_Pos: 161
Relay_Master_Log_File: bin.000064
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
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: 4
Relay_Log_Space: 477
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: 1595
Last_IO_Error: Relay log write failure: could not queue event from master
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 2
Master_UUID: 69691b70-04e4-11e5-ad6d-000c292f3ddd
Master_Info_File: /var/lib/mysql/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp: 150708 13:34:14
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)
从文件上报出:
2015-07-08 13:34:14 5065 [ERROR] Slave I/O: Replication event checksum verification failed while reading from network. Error_code: 1743
2015-07-08 13:34:14 5065 [ERROR] Slave I/O: Relay log write failure: could not queue event from master, Error_code: 1595
2015-07-08 13:34:14 5065 [Note] Slave I/O thread exiting, read up to log 'bin.000064', position 4
使用mysqlbinlog对主库上的binlog文件进行分析
里面有
ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 287, event_type: 0
ERROR: Could not read entry at offset 216: Error in log format or read error.
这个错误。
能不能使用binlog得到正确的数据,需要看坏的位置 。一般不要这样搞
这是由于 binlog文件坏掉了,所以才有这样的错误,对于主从环境的话, 这时最好还是重建主从。或者从跳过这点,然后使用pt工具进行主从数据的校验。
转载请注明源出处
QQ 273002188 欢迎一起学习
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25099483/viewspace-1726895/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25099483/viewspace-1726895/