0

我正在尝试使用带有 MariaDB veriosn 10.0.32 的 MaxScale CDC 设置到 Kafka 的实时数据流。配置复制后,我得到状态:

“从属 I/O 线程停止,因为在尝试 SELECT @master_binlog_checksum 时遇到致命错误”。

以下是我的所有配置:

MariaDB - 配置

server-id               = 1
#report_host            = master1
#auto_increment_increment = 2
#auto_increment_offset  = 1
log_bin                 = /var/log/mysql/mariadb-bin
log_bin_index           = /var/log/mysql/mariadb-bin.index
binlog_format           = row
binlog_row_image        = full
# 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
#log_slave_updates
#read_only

MaxScale 配置

[server1]
type=server
address=192.168.56.102
port=3306
protocol=MariaDBBackend

[Replication]
type=service
router=binlogrouter
version_string=10.0.27-log
user=myuser
passwd=mypwd
server_id=3
#binlogdir=/var/lib/maxscale
#mariadb10-compatibility=1
router_options=binlogdir=/var/lib/maxscale,mariadb10-compatibility=1
#slave_sql_verify_checksum=1

[Replication Listener]
type=listener
service=Replication
protocol=MySQLClient
port=5308

开始复制

CHANGE MASTER TO MASTER_HOST='192.168.56.102', MASTER_PORT=5308, MASTER_USER='myuser', MASTER_PASSWORD='mypwd', MASTER_LOG_POS=328, MASTER_LOG_FILE='mariadb-bin.000018';
START SLAVE;

复制状态

                  Master_Host: 192.168.56.102
                  Master_User: myuser
                  Master_Port: 5308
                Connect_Retry: 60
              Master_Log_File: mariadb-bin.000018
          Read_Master_Log_Pos: 328
               Relay_Log_File: mysqld-relay-bin.000002
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mariadb-bin.000018
             **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: 328
              Relay_Log_Space: 248
              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: 1593
                Last_IO_Error: **The slave I/O thread stops because a fatal error is encountered when it tried to SELECT @master_binlog_checksum. Error:**
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 0
               Master_SSL_Crl:
           Master_SSL_Crlpath:
                   Using_Gtid: No
                  Gtid_IO_Pos:
4

1 回答 1

0

binlogrouter 执行以下查询来设置@master_binlog_checksum(真正的复制从服务器执行相同的查询)的值。

SET @master_binlog_checksum = @@global.binlog_checksum

检查它的输出可能会解释为什么复制不会开始。很可能SET查询失败,这就是后一个SELECT @master_binlog_checksum查询返回意外结果的原因。


在这种情况下,建议在 MaxScale 项目下的 MariaDB Jira上打开错误报告。这样就排除了错误的可能性,如果结果是配置问题,可以更新文档以更清楚地解释如何配置 MaxScale。

于 2018-06-01T06:50:08.357 回答