Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql MariaDB-中继日志读取失败:无法分析中继日志事件条目_Mysql_Mariadb_Bitnami - Fatal编程技术网

Mysql MariaDB-中继日志读取失败:无法分析中继日志事件条目

Mysql MariaDB-中继日志读取失败:无法分析中继日志事件条目,mysql,mariadb,bitnami,Mysql,Mariadb,Bitnami,检查从属状态时出现以下错误 中继日志读取失败:无法分析中继日志事件条目。可能的原因是:主服务器的二进制日志已损坏(您可以通过在二进制日志上运行'mysqlbinlog'进行检查)、从服务器的中继日志已损坏(您可以通过在中继日志上运行'mysqlbinlog'进行检查)、网络问题或主服务器或从服务器的MySQL代码中的错误。如果要检查主设备的二进制日志或从设备的中继日志,可以通过在此从设备上发出“显示从设备状态”来知道它们的名称 我正在使用Bitnami的MariaDB进行复制,其中我有1个主节点

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

中继日志读取失败:无法分析中继日志事件条目。可能的原因是:主服务器的二进制日志已损坏(您可以通过在二进制日志上运行'mysqlbinlog'进行检查)、从服务器的中继日志已损坏(您可以通过在中继日志上运行'mysqlbinlog'进行检查)、网络问题或主服务器或从服务器的MySQL代码中的错误。如果要检查主设备的二进制日志或从设备的中继日志,可以通过在此从设备上发出“显示从设备状态”来知道它们的名称

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

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

  • 有一个system_用户查询被卡住了,试图终止它,但不幸的是它没有被删除
  • 重新启动从属节点,以便刷新所有查询
  • 服务器重启后,MySQL停止工作,并出现套接字错误

  • 请帮我解决问题,伙计们。无法通过此错误

    我已通过以下步骤解决了相同的问题

    要检查当前从机状态,请执行以下命令:

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

    *************************** 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)
    
    您应该注意的重要值是中继主机日志文件执行主机日志位置。您将需要它们来正确地重新启动从机上的复制

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

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

    show slave status\G
    
    在将从属设备称为已同步之前,请从status命令中检查参数SESSIONS_Behind_Master的值。在我们的例子中,我看到了值(7971秒):

    落后于大师的秒数:7971

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

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

    STOP SLAVE;
    
    RESET SLAVE;
    
    CHANGE MASTER TO master_log_file='mysql-bin.000149', master_log_pos=884187951;
    
    START SLAVE;
    
    show slave status\G