[ERROR] Slave I/O: Replication event checksum Error_code: 1743

psufnxk2000發表於2015-07-08
 [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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章