mysql - MariaDB - 中继日志读取失败 : Could not parse relay log event entry

标签 mysql mariadb bitnami

检查从站状态时出现以下错误

中继日志读取失败:无法解析中继日志事件条目。可能的原因有:master的二进制日志损坏(可以通过在二进制日志上运行“mysqlbinlog”来检查)、slave的中继日志损坏(可以通过在中继日志上运行“mysqlbinlog”来检查)、网络问题,或者主站或从站的 MySQL 代码中的错误。如果您想检查主站的二进制日志或从站的中继日志,您可以通过在该从站上发出“SHOW SLAVE STATUS”来了解它们的名称。

我正在使用 Bitnami 的 MariaDB 进行复制,其中有 1 个主节点和 2 个从节点,其中一个节点似乎已损坏并出现上述错误。

解释我在节点停止工作后采取的步骤

  1. 有一个 system_user 查询被卡住,尝试终止它,但不幸的是它没有被删除。
  2. 重新启动从属节点,以便刷新所有查询。
  3. 服务器重新启动后,MySQL 停止工作并出现套接字错误。

请大家帮我解决一下。无法解决此错误

最佳答案

我已经通过以下步骤解决了同样的问题。

要检查当前从属状态,请执行命令:

show slave status\G

您应该看到与此类似的结果:

*************************** 1. row ***************************
                Slave_IO_State: Waiting for master to send event
                   Master_Host: provisioner-peer
                   Master_User: repl
                   Master_Port: 3306
                 Connect_Retry: 10
               Master_Log_File: mysql-bin.000149
           Read_Master_Log_Pos: 919065590
                Relay_Log_File: mysql-relay-bin.000450
                 Relay_Log_Pos: 884188250
         **Relay_Master_Log_File: mysql-bin.000149**
              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 run
ning '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: 884187951**
               Relay_Log_Space: 919067911
               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 run
ning '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: 287
                Master_SSL_Crl: 
            Master_SSL_Crlpath: 
                    Using_Gtid: No
                   Gtid_IO_Pos: 
       Replicate_Do_Domain_Ids: 
   Replicate_Ignore_Domain_Ids: 
                 Parallel_Mode: conservative
                     SQL_Delay: 0
           SQL_Remaining_Delay: NULL
       Slave_SQL_Running_State: 
              Slave_DDL_Groups: 0
Slave_Non_Transactional_Groups: 0
    Slave_Transactional_Groups: 1
1 row in set (0.000 sec)

您应该注意的重要值是Relay_Master_Log_FileExec_Master_Log_Pos。您将需要它们来正确地重新启动从属设备上的复制。

要重新启动复制,请执行以下命令:

STOP SLAVE;

RESET SLAVE;

CHANGE MASTER TO master_log_file='mysql-bin.000149', master_log_pos=884187951;

START SLAVE;

要检查复制是否再次工作,请再次执行命令:

show slave status\G

在将从属设备称为已同步之前,请检查状态命令中的参数 Seconds_Behind_Master 的值。在我们的例子中,我看到了值(value)(7971 秒):

Master 落后秒数:7971

在接下来的几分钟内,复制再次与主服务器同步,复制延迟为 0 秒

注意:为了安全起见,首先备份您的数据库

关于mysql - MariaDB - 中继日志读取失败 : Could not parse relay log event entry,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65362492/

相关文章:

mysql - 在这种情况下,是什么导致 MySQL 错误 1071( key 太长)?

mysql - 不用sudo执行mysql

ruby-on-rails - Bitnami GitLab 5.2.0 : gitlab_sidekiq not running and could not be started

mysqldump 未知数据库 bitnami_redmine

MySql - 左连接相关表上的位置

Mysql 选择多列并按单列分组

mysql - 这些 MySQL 索引是否重复?

php - 删除-查询花费太多时间

linux - WordPress unzip_file() 导致 mkdir_failed(权限)

mysql - 将 MySQL 查询从嵌套选择转换为内部连接