【问题标题】:mariadb : Relay log write failuremariadb : 中继日志写入失败
【发布时间】:2017-10-31 11:03:50
【问题描述】:

我目前正在尝试让 MariaDB 10.2.9 作为 mysql 5.5 主服务器的从服务器运行,但我不断收到相同的错误(Last_IO_Errno: 1595, Relay log write failure: could not queue event from master)

由于master和slave之间的版本有些差异,我不得不设置

set global binlog_checksum='NONE';

总而言之,我拿了一个 master 的 mysqldump,读取 log_pos/file 和

SET GLOBAL server_id=2;
CHANGE MASTER TO 
MASTER_HOST='10.145.46.11',MASTER_USER='replicant',MASTER_PASSWORD='...', 
MASTER_LOG_FILE='mysql-bin.000042', MASTER_LOG_POS=107;
start slave;

但 IO 线程根本无法启动,mariadb.log 显示:

...
2017-10-31 11:44:41 140026338711296 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000007' at position 107, relay log './mariadb-relay-bin.000001' position: 4
2017-10-31 11:44:41 140027007977216 [Note] Slave I/O thread: connected to master 'replicant@10.145.46.11:3306',replication started in log 'mysql-bin.000007' at position 107
2017-10-31 11:44:42 140027007977216 [Warning] Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error: Unknown system variable 'binlog_checksum', Internal MariaDB error code: 1193
2017-10-31 11:44:42 140027007977216 [ERROR] Slave I/O: Replication event checksum verification failed while reading from network, Internal MariaDB error code: 1743
2017-10-31 11:44:42 140027007977216 [ERROR] Slave I/O: Relay log write failure: could not queue event from master, Internal MariaDB error code: 1595
2017-10-31 11:44:42 140027007977216 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000007', position 107
....

我也不确定哪种校验和在这里失败(mysql 参考说“复制事件校验和”?),我试过了:

set global slave_sql_verify_checksum=0;

当前状态是:

MariaDB [(none)]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: 
                  Master_Host: 10.145.46.11
                  Master_User: replicant
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000007
          Read_Master_Log_Pos: 107
               Relay_Log_File: mariadb-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.000007
             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: 107
              Relay_Log_Space: 256
              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: 1
               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 has read all relay log; waiting for the slave I/O thread to update it

【问题讨论】:

    标签: mysql mariadb replication slave


    【解决方案1】:

    我遇到了同样的问题并找到了answer。在配置文件my.cnf中设置变量slave_sql_verify_checksum。设置slave_sql_verify_checksum = NONE并重启服务器。

    【讨论】:

      猜你喜欢
      • 2021-11-08
      • 2023-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-28
      • 1970-01-01
      • 1970-01-01
      • 2016-04-02
      相关资源
      最近更新 更多