程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> MySQL5.1主從同步湧現Relay log read failure毛病處理辦法

MySQL5.1主從同步湧現Relay log read failure毛病處理辦法

編輯:MySQL綜合教程

MySQL5.1主從同步湧現Relay log read failure毛病處理辦法。本站提示廣大學習愛好者:(MySQL5.1主從同步湧現Relay log read failure毛病處理辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是MySQL5.1主從同步湧現Relay log read failure毛病處理辦法正文


盡人皆知MySQL5.1的Replication是比擬爛的。MySQL的每個版本更新關於同步方面每次都是可以看到一年夜堆。但MySQL 5.1機能是比擬凸起的。所以經不住引誘應用MySQL 5.1。所以也要常常碰到一些Bug。如:

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.10.118
                  Master_User: repl_wu
                  Master_Port: 3306
                Connect_Retry: 30
              Master_Log_File: mysql-bin.005121
          Read_Master_Log_Pos: 64337286
               Relay_Log_File: relay-bin.003995
                Relay_Log_Pos: 18446697137031827760
        Relay_Master_Log_File: mysql-bin.005121
             Slave_IO_Running: Yes
            Slave_SQL_Running: No
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   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: 4
              Relay_Log_Space: 64337901
              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: 0
                Last_IO_Error:
               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.
1 row in set (0.00 sec)

從下面可以看到是中繼日值或是Master上的日值出成績了。

起首假如是中繼日值壞失落,那只須要找到同步的時光點,然後從新同步,如許便可以有新的中繼日值了。假如Master上的日值壞了就費事了。

從經歷來看,這是中繼日值出成績了。處置辦法:

須要找到同步的點。

日值為:Master_Log_File: mysql-bin.005121,Relay_Master_Log_File: mysql-bin.005121以Relay_Master_Log_File為准,Master_Log_File為參考。

日值履行時光點:
Exec_Master_Log_Pos: 4

那末如今便可以:

mysql>stop slave;
 
mysql>change master to Master_Log_File='mysql-bin.005121', Master_Log_Pos=4;
  
mysql>start slave;
 
mysql>show slave status\G;

停止確認。

建議:

在應用MySQL-5.1.36以下的版本的同窗,請盡快進級到MySQL-5.1.40 & MySQL-5.1.37sp1

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved