GreatSQL社区

搜索

[待回复] MGR添加多个仲裁节点失败,有大佬能帮忙看下吗?

173 1 2025-12-22 19:02
本帖最后由 whx 于 2025-12-23 12:12 编辑

社区的大佬们,有个问题要咨询下,我有A和B两个物理节点,现在A作为MGR集群的主控、B作为MGR集群的备控,我在上面各启动一个容器,作为仲裁节点,也就是有四个节点,两个数据库节点,两个仲裁节点,这样可行吗


已经验证,无法添加多个仲裁节点,仲裁节点有单点故障风险


172.16.6.156是物理节点A、172.16.6.158是物理节点B,上面分别部署了容器D1和容器D2,先将物理节点A中的数据库设置为主控,启动MGR,然后再将物理节点B中的数据库加入到MGR集群中,然后将物理节点A中的容器D1中的数据库设置为仲裁节点加入到MGR中,MGR可以正常工作:




最后把物理节点B中的容器D2设置为仲裁节点加入MGR时,无法成功加入,主控报错:
2025-12-23T03:59:25.537316Z 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] ::process_control_message()::Install new view'
2025-12-23T03:59:25.537343Z 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Processing exchanged data while installing the new view'
2025-12-23T03:59:25.537364Z 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Processing exchanged data while installing the new view'
2025-12-23T03:59:25.537382Z 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Processing exchanged data while installing the new view'
2025-12-23T03:59:25.537403Z 0 [Note] [MY-011071] [Repl] Plugin group_replication reported: 'on_view_changed is called'
2025-12-23T03:59:25.537485Z 0 [Note] [MY-011501] [Repl] Plugin group_replication reported: 'Members joined the group: 172.16.6.156:3306'
2025-12-23T03:59:25.537564Z 0 [Note] [MY-011071] [Repl] Plugin group_replication reported: 'handle_leader_election_if_needed is activated,suggested_primary:'
2025-12-23T03:59:25.537700Z 0 [System] [MY-011503] [Repl] Plugin group_replication reported: 'Group membership changed to 172.16.6.156:3308, 172.16.6.158:3308, 172.16.6.156:3306 on view 17664619062603831:7.'
2025-12-23T03:59:25.537864Z 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] ::process_control_message()::Install new view over'
2025-12-23T03:59:25.537955Z 0 [Note] [MY-000000] [Server] Plugin greatdb_ha reported: 'Cur MGR group view_id change to [17664619062603831:7].'
2025-12-23T03:59:25.537961Z 27 [System] [MY-015046] [Repl] Plugin group_replication reported: 'This member 172.16.6.156:3308 will be the one sending the recovery metadata message.'
2025-12-23T03:59:25.538316Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:25.562383Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:25.562668Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:25.585249Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:25.585302Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'try to connect or send message to b18922b5-df23-11f0-9f1f-000c29e4a050 failed when get node bind message'
2025-12-23T03:59:25.623730Z 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] set fd:47 connected'
2025-12-23T03:59:25.623825Z 0 [Note] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] buffered_read_msg sets CON_PROTO for fd:47'
2025-12-23T03:59:25.687476Z 0 [System] [MY-011492] [Repl] Plugin group_replication reported: 'The member with address 172.16.6.156:3306 was declared online within the replication group.'
2025-12-23T03:59:26.092771Z 0 [Note] [MY-000000] [Server] Plugin greatdb_ha reported: 'calculated new vip_tope:[ad1d4a37-df23-11f0-a182-000c2982defe::172.16.6.160].'
2025-12-23T03:59:26.093454Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:26.122960Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:26.123280Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:26.145654Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'connect_with_timeout 172.16.6.158:0 failed return 111'
2025-12-23T03:59:26.145693Z 0 [ERROR] [MY-000000] [Server] Plugin greatdb_ha reported: 'try to connect or send message to b18922b5-df23-11f0-9f1f-000c29e4a050 failed when get node bind message'
2025-12-23T03:59:26.654841Z 0 [Note] [MY-000000] [Server] Plugin greatdb_ha reported: 'calculated new vip_tope:[ad1d4a37-df23-11f0-a182-000c2982defe::172.16.6.160].



下面是配置文件:


物理节点A /etc/my.cnf配置:

[mysql]
loose-skip-binary-as-hex
no-auto-rehash

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
slow_query_log = ON
long_query_time = 1
log_slow_verbosity = FULL
log_error_verbosity = 3
skip_name_resolve=ON
character-set-server=UTF8MB4
mysql_native_password=ON
lock_wait_timeout=3600

max_connections = 200
innodb_print_all_deadlocks=ON
innodb_rollback_on_timeout=ON
innodb_buffer_pool_size = 1G
innodb_log_file_size = 500M
innodb_flush_log_at_trx_commit=1
innodb_redo_log_capacity = 500M
innodb_file_per_table = 1
innodb_doublewrite_pages=128
innodb_thread_concurrency=0
innodb_log_buffer_size = 64M
innodb_spin_wait_delay=20
innodb_flush_method = O_DIRECT
tmp_table_size = 32M
max_heap_table_size = 32M
thread_cache_size = 200
table_open_cache = 1024
open_files_limit = 65535
sql-mode = NO_ENGINE_SUBSTITUTION
port=3308

# add
binlog-format=row
binlog_checksum=CRC32
enforce-gtid-consistency=true
gtid-mode=on
log-bin=/var/lib/mysql/mysql-bin
log_slave_updates=ON
loose-greatdb_ha_enable_mgr_vip=1
loose-greatdb_ha_mgr_vip_ip=172.16.6.160
loose-greatdb_ha_mgr_vip_mask='255.255.0.0'
loose-greatdb_ha_mgr_vip_nic='ens33'
loose-greatdb_ha_send_arp_package_times=5
loose-group-replication-ip-whitelist="172.16.6.156,172.16.6.158"
loose-group_replication_bootstrap_group=off
loose-group_replication_exit_state_action=READ_ONLY
loose-group_replication_flow_control_mode="DISABLED"
loose-greatdb_ha_mgr_read_vip_floating_type = "TO_ANOTHER_SECONDARY"
loose-group_replication_group_name="16078072-7309-4a90-b115-c4eb889ddc7d"
loose-group_replication_group_seeds="172.16.6.156:33061,172.16.6.156:33062,172.16.6.158:33061,172.16.6.158:33062"
loose-group_replication_local_address="172.16.6.156:33061"
loose-group_replication_transaction_size_limit = 10M
loose-group_replication_communication_max_message_size = 10M
loose-group_replication_member_expel_timeout = 10
loose-group_replication_majority_after_mode=ON
loose-group_replication_arbitrator=OFF
loose-group_replication_single_primary_fast_mode = 1
loose-group_replication_autorejoin_tries = 5
loose-group_replication_request_time_threshold = 100
loose-group_replication_single_primary_mode=ON
loose-group_replication_primary_election_mode=GTID_FIRST
loose-group_replication_start_on_boot=on
loose-plugin_load_add='greatdb_ha.so'
loose-plugin_load_add='group_replication.so'
loose-plugin_load_add='mysql_clone.so'
relay_log_recovery=on
server_id=1
replica_checkpoint_period=2
replica_parallel_type=LOGICAL_CLOCK
replica_parallel_workers=8
replica_preserve_commit_order=ON
sql_require_primary_key=1
report_host=172.16.6.156


物理节点B/etc/my.cnf配置:
[mysql]
loose-skip-binary-as-hex
no-auto-rehash


[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
slow_query_log = ON
long_query_time = 1
log_slow_verbosity = FULL
log_error_verbosity = 3
skip_name_resolve=ON
character-set-server=UTF8MB4
mysql_native_password=ON
lock_wait_timeout=3600


max_connections = 200
innodb_print_all_deadlocks=ON
innodb_rollback_on_timeout=ON
innodb_buffer_pool_size = 1G
innodb_log_file_size = 500M
innodb_flush_log_at_trx_commit=1
innodb_redo_log_capacity=1G
innodb_file_per_table = 1
innodb_doublewrite_pages=128
innodb_thread_concurrency=0
innodb_log_buffer_size = 64M
innodb_spin_wait_delay=20
innodb_flush_method = O_DIRECT
tmp_table_size = 32M
max_heap_table_size = 32M
thread_cache_size = 200
table_open_cache = 1024
open_files_limit = 65535
sql-mode = NO_ENGINE_SUBSTITUTION
port=3308


# add
binlog-format=row
binlog_checksum=CRC32
enforce-gtid-consistency=true
gtid-mode=on
log-bin=/var/lib/mysql/mysql-bin
log_slave_updates=ON
loose-greatdb_ha_enable_mgr_vip=1
loose-greatdb_ha_mgr_vip_ip=172.16.6.160
loose-greatdb_ha_mgr_vip_mask='255.255.0.0'
loose-greatdb_ha_mgr_vip_nic='ens33'
loose-greatdb_ha_send_arp_package_times=5
loose-group-replication-ip-whitelist="172.16.6.156,172.16.6.158"
loose-group_replication_bootstrap_group=off
loose-group_replication_exit_state_action=READ_ONLY
loose-group_replication_flow_control_mode="DISABLED"
loose-greatdb_ha_mgr_read_vip_floating_type = "TO_ANOTHER_SECONDARY"
loose-group_replication_group_name="16078072-7309-4a90-b115-c4eb889ddc7d"
loose-group_replication_group_seeds="172.16.6.156:33061,172.16.6.156:33062,172.16.6.158:33061,172.16.6.158:33062"
loose-group_replication_local_address="172.16.6.158:33061"
loose-group_replication_transaction_size_limit = 10M
loose-group_replication_communication_max_message_size = 10M
loose-group_replication_member_expel_timeout = 10
loose-group_replication_majority_after_mode=ON
loose-group_replication_arbitrator=OFF
loose-group_replication_single_primary_fast_mode = 1
loose-group_replication_autorejoin_tries = 5
loose-group_replication_request_time_threshold = 100
loose-group_replication_single_primary_mode=ON
loose-group_replication_primary_election_mode=GTID_FIRST
loose-group_replication_start_on_boot=on
loose-plugin_load_add='greatdb_ha.so'
loose-plugin_load_add='group_replication.so'
loose-plugin_load_add='mysql_clone.so'
relay_log_recovery=on
server_id=3
replica_checkpoint_period=2
replica_parallel_type=LOGICAL_CLOCK
replica_parallel_workers=4
replica_preserve_commit_order=ON
sql_require_primary_key=1
report_host=172.16.6.158



物理节点A中的容器D1映射出来的/data/greatsql/my.cnf配置文件如下:
[mysqld]
user=mysql
basedir=/usr/local/GreatSQL
datadir=/data/
socket=/data/mysql.sock
pid-file=mysql.pid
slow_query_log = ON
long_query_time = 1
log_slow_verbosity = FULL
log_error_verbosity = 3
mysql_native_password=ON
mysqlx = OFF
max_connections = 200
innodb_buffer_pool_size = 500M
innodb_log_file_size = 500MB
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
tmp_table_size = 32M
max_heap_table_size = 32M
thread_cache_size = 200
table_open_cache = 20
open_files_limit = 65535
sql-mode = NO_ENGINE_SUBSTITUTION
port=3306


binlog-format=row
binlog_checksum=CRC32
enforce-gtid-consistency=true
gtid-mode=on
log-bin=/data/mysql-bin
log_slave_updates=ON
loose-group-replication-ip-whitelist="172.16.6.156,172.16.6.158"
loose-group_replication_bootstrap_group=off
loose-group_replication_exit_state_action=READ_ONLY
loose-group_replication_flow_control_mode="DISABLED"
loose-group_replication_group_name="16078072-7309-4a90-b115-c4eb889ddc7d"
loose-group_replication_group_seeds="172.16.6.156:33061,172.16.6.156:33062,172.16.6.158:33061,172.16.6.158:33062"
loose-group_replication_local_address="172.16.6.156:33062"
loose-group_replication_transaction_size_limit = 10M
loose-group_replication_communication_max_message_size = 10M
loose-group_replication_member_expel_timeout = 10
loose-group_replication_majority_after_mode=ON
loose-group_replication_arbitrator=ON
group_replication_arbitrator=ON
loose-group_replication_single_primary_fast_mode = 1
loose-group_replication_autorejoin_tries = 5
loose-group_replication_request_time_threshold = 100
loose-group_replication_single_primary_mode=ON
loose-group_replication_primary_election_mode=GTID_FIRST
loose-group_replication_start_on_boot=off
loose-plugin_load_add='group_replication.so'
relay_log_recovery=on
server_id=2
replica_checkpoint_period=2
replica_parallel_type=LOGICAL_CLOCK
replica_parallel_workers=8
replica_preserve_commit_order=ON
sql_require_primary_key=1
report_host=172.16.6.156


物理节点B中的容器D2映射出来的/data/greatsql/my.cnf配置文件如下:
[mysqld]
user=mysql
basedir=/usr/local/GreatSQL
datadir=/data/
socket=/data/mysql.sock
pid-file=mysql.pid
slow_query_log = ON
long_query_time = 1
log_slow_verbosity = FULL
log_error_verbosity = 3
mysql_native_password=ON
mysqlx = OFF
max_connections = 100
innodb_buffer_pool_size = 500M
innodb_log_file_size = 500MB
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
tmp_table_size = 32M
max_heap_table_size = 32M
thread_cache_size = 200
table_open_cache = 20
open_files_limit = 65535
sql-mode = NO_ENGINE_SUBSTITUTION
port=3306


binlog-format=row
binlog_checksum=CRC32
enforce-gtid-consistency=true
gtid-mode=on
log-bin=/data/mysql-bin
log_slave_updates=ON
loose-group-replication-ip-whitelist="172.16.6.156,172.16.6.158"
loose-group_replication_bootstrap_group=off
loose-group_replication_exit_state_action=READ_ONLY
loose-group_replication_flow_control_mode="DISABLED"
loose-group_replication_group_name="16078072-7309-4a90-b115-c4eb889ddc7d"
loose-group_replication_group_seeds="172.16.6.156:33061,172.16.6.156:33062,172.16.6.158:33061,172.16.6.158:33062"
loose-group_replication_local_address="172.16.6.158:33062"
loose-group_replication_transaction_size_limit = 10M
loose-group_replication_communication_max_message_size = 10M
loose-group_replication_member_expel_timeout = 10
loose-group_replication_majority_after_mode=ON
loose-group_replication_arbitrator=ON
group_replication_arbitrator=ON
loose-group_replication_single_primary_fast_mode = 1
loose-group_replication_autorejoin_tries = 5
loose-group_replication_request_time_threshold = 100
loose-group_replication_single_primary_mode=ON
loose-group_replication_primary_election_mode=GTID_FIRST
loose-group_replication_start_on_boot=off
loose-plugin_load_add='group_replication.so'
relay_log_recovery=on
server_id=4
replica_checkpoint_period=2
replica_parallel_type=LOGICAL_CLOCK
replica_parallel_workers=8
replica_preserve_commit_order=ON
sql_require_primary_key=1
report_host=172.16.6.158









全部回复(1)
yejr 2025-12-23 16:43:27
我部署过多个仲裁节点的场景,是可以支持的。

看了下报错信息,是greatdb_ha plugin引发的报错,不是MGR的报错。

应该是你启用greatdb_ha vip功能时,每个节点没有单独配置不同的 report_port 导致端口冲突了。
此外,看了你的配置文件,也没配置 greatdb_ha_port 端口,也有可能是这个引发冲突。

最后,多一个仲裁节点的方案没必要,画蛇添足了,另一个贴子里(https://greatsql.cn/thread-778-2-1.html)也已回复你。
whx

2

主题

0

博客

10

贡献

新手上路

Rank: 1

积分
18

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2026-1-20 05:02 , Processed in 0.045738 second(s), 10 queries , Redis On.
快速回复 返回顶部 返回列表