AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 962670
Accepted
Brian Bauman
Brian Bauman
Asked: 2019-04-12 12:23:37 +0800 CST2019-04-12 12:23:37 +0800 CST 2019-04-12 12:23:37 +0800 CST

MySQL Cluster -> Galera MariaDB Cluster Replication 不工作,但没有错误

  • 772

我正在运行 MySQL Cluster 7.2 (MySQL 5.5) 的 2 节点主集群和运行带有 Galera 集群的 MariaDB 10.3 的 2 节点从集群(加上仲裁器)之间设置数据库迁移。我目前关闭了除了一个 Galera 集群的节点之外的所有节点,以简化编排。

配置显示正确,并且SHOW ALL SLAVES STATUS \G显示的所有内容都表明复制成功。 Read_并且Exec_Master_Log_Pos相互匹配以及主服务器报告的内容,没有记录错误等。事实上,将数据库添加到我们正在复制的主节点将在从节点中创建一个数据库。 但是,没有任何数据行被复制。

mariadb.err 中唯一的奇怪之处如下:

2019-04-11 18:31:19 101 [Warning] Master '[redacted]': 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

主复制配置:

server-id=13
binlog-format = row
log-bin=mysql-bin
sync_binlog = 1

从属复制配置:

server-id               = 1
log_bin                 = /var/log/mysql/mariadb-bin
log_bin_index           = /var/log/mysql/mariadb-bin.index
expire_logs_days        = 10
max_binlog_size         = 100M
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
slave_sql_verify_checksum = 0
log_slave_updates
read_only
binlog_format=row

显示主状态;

File: mysql-bin.000049
Position: 4494988
Binlog_Do_DB: ''
Binlog_Ignore_DB: ''

显示所有从属状态 \G

*************************** 1. row ***************************
               Connection_name: [redacted]13
               Slave_SQL_State: Slave has read all relay log; waiting for the slave I/O thread to update it
                Slave_IO_State: Waiting for master to send event
                   Master_Host: [redacted]
                   Master_User: replicant
                   Master_Port: 3306
                 Connect_Retry: 60
               Master_Log_File: mysql-bin.000049
           Read_Master_Log_Pos: 4494988
                Relay_Log_File: relay-bin-[redacted].000002
                 Relay_Log_Pos: 2982721
         Relay_Master_Log_File: mysql-bin.000049
              Slave_IO_Running: Yes
             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: 4494988
               Relay_Log_Space: 2983028
               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: 0
 Master_SSL_Verify_Server_Cert: No
                 Last_IO_Errno: 0
                 Last_IO_Error: 
                Last_SQL_Errno: 0
                Last_SQL_Error: 
   Replicate_Ignore_Server_Ids: 
              Master_Server_Id: 13
                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
              Slave_DDL_Groups: 0
Slave_Non_Transactional_Groups: 0
    Slave_Transactional_Groups: 0
          Retried_transactions: 0
            Max_relay_log_size: 104857600
          Executed_log_entries: 28995
     Slave_received_heartbeats: 57
        Slave_heartbeat_period: 30.000
                Gtid_Slave_Pos: 
1 row in set (0.000 sec)

启动复制

在 master 上,我执行以下操作:

mysqldump -S /data/mysql/mysql.sock -u [redacted] -p --opt --skip-lock-tables --single-transaction --flush-logs --master-data=2 --databases [redacted] > replication.sql

然后我将 sql 复制到从服务器,并将其通过管道传输到 Galera 节点。这使从站与转储点保持同步。

然后我在从服务器上运行以下命令:

head -n100 replication.sql | grep "MASTER_LOG_POS"

获取正确的起始文件和复制位置,然后在 SQL 中运行以下命令:

CHANGE MASTER '[redacted]' TO MASTER_HOST='[redacted]', MASTER_USER='replicant', MASTER_PASSWORD='[redacted]', MASTER_LOG_FILE='[file]', MASTER_LOG_POS=[position];

在过去的几天里,我已经查看了该网站和其他网站上的数十篇帖子,但尚未找到解决方案。以下是一些证明勤奋的例子:

MySQL 复制不工作 - 没有错误- 我关闭了所有过滤以确保这不是问题。

mysql 复制失败(无错误) - 我们正在使用基于行的 bin-logging

MySQL 主从复制未更新- 这里没有真正的解决方案。我确认第一个答案列出的所有积极指标对我来说也是正确的。

MySQL 说复制很好,但没有复制数据- 不使用过滤,服务器 ID 不同等。

mysql
  • 1 1 个回答
  • 730 Views

1 个回答

  • Voted
  1. Best Answer
    Brian Bauman
    2019-04-23T13:40:51+08:002019-04-23T13:40:51+08:00

    在 docker 容器中对不同版本的 MariaDB 和 MySQL 进行了大量实验后,我确定 MariaDB 10.0 或更高版本会在遇到不可读的行事件时静默失败并继续运行。

    在 docker 容器中使用 MariaDB 5.5 会mysqlbinlog发现以下复制错误:

    ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: 30
    ERROR: Could not read entry at offset 938: Error in log format or read error.
    

    此错误超出了所问问题的范围。

    • 0

相关问题

  • 开源与专有关系 db mgt 系统的优缺点是什么?

  • 在 solaris 10 上为 mysql 设置 max_allowed_pa​​cket

  • 如何移动 MySQL 的数据目录?

  • 通过 VPN 连接什么是远程服务器 IP?

  • mysql崩溃

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve