【问题标题】:How to fix Multi-Master Replication Error in MariaDB如何修复 MariaDB 中的多主复制错误
【发布时间】:2014-06-10 18:05:23
【问题描述】:

我在 MariaDB 中有一个多主环复制设置。 3 台服务器。

我的一个服务器磁盘空间不足,我最终需要重新启动服务器。现在,在这样做之后,两个从服务器在从状态中报告此错误。

Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Error: connecting slave requested to start from GTID 1-1-426253, which is not in the master's binlog'

我真的很困惑如何从这个错误中恢复我的从服务器,谁能告诉我如何告诉这个从服务器从它的主服务器上的正确 GTID 开始?

谢谢

【问题讨论】:

  • 你master的binlog配置是什么?

标签: mariadb multi-master-replication


【解决方案1】:

Moshe L,这是我的主人的 binlog 设置

server-id = 1
gtid_domain_id = 1
gtid_strict_mode = 1
report_host             = MDB1
auto_increment_increment = 3
auto_increment_offset   = 1
slave_parallel_threads = 12
replicate_ignore_db     = mysql
replicate_ignore_table  = MA4_Data.EOD_FileCache
log_bin                 = /var/log/mysql/mariadb-bin
log_bin_index           = /var/log/mysql/mariadb-bin.index
binlog_format           = mixed
#binlog_commit_wait_count = 12
#binlog_commit_wait_usec = 10000
#slave_compressed_protocol = 1
# not fab for performance, but safer
sync_binlog             = 1
expire_logs_days        = 10
max_binlog_size         = 100M
# slaves
relay_log               = /var/log/mysql/relay-bin
relay_log_index = /var/log/mysql/relay-bin.index
relay_log_info_file     = /var/log/mysql/relay-bin.info

【讨论】:

    【解决方案2】:

    我让这一切都恢复了。我只是通过转到主服务器并输入 SHOW MASTER STATUS 找到了主日志和位置编号;

    然后我在奴隶上使用了这些信息并做了这个。

    STOP SLAVE 'MDB1';
    
    CHANGE MASTER "MDB1" TO master_host="xxx.xxx.xxx.xxx", master_port=3306, master_user="****", master_password="****", master_log_file="mariadb-bin.000394", master_log_pos=385;
    
    START SLAVE 'MDB1';
    

    然后检查一切正常,然后我改回使用 GTID

    STOP SLAVE 'MDB1';
    
    CHANGE MASTER "MDB1" TO master_use_gtid=slave_pos;
    
    START SLAVE 'MDB1'; 
    

    在那之后,一切都恢复了并再次运行。

    【讨论】:

      【解决方案3】:

      这是另一种可以尝试的解决方案。

      stop slave; 
      reset slave;
      start slave 
      

      【讨论】:

      • 虽然信息量不大,但这个答案确实对我有所帮助。
      猜你喜欢
      • 2020-10-12
      • 2019-01-31
      • 1970-01-01
      • 1970-01-01
      • 2011-01-27
      • 2021-03-11
      • 2017-10-11
      • 2015-06-08
      • 2017-06-04
      相关资源
      最近更新 更多