MGR参数之group_replication_ip_whitelist

MGR参数之group_replication_ip_whitelist

img

尝试将10.133.1.46加入192.168.2.224的集群失败

需要设置参数group_replication_ip_whitelist

此参数虽然是动态参数, 但是要使之生效需要节点重新加入集群

To specify a whitelist manually, use the group_replication_ip_whitelist option. You cannot change the whitelist on a server while it is an active member of a replication group. If the member is active, you must issue a STOP GROUP_REPLICATION statement before changing the whitelist, and a START GROUP_REPLICATION statement afterwards.

set global group_replication_ip_whitelist = '192.168.0.0/16,10.0.0.0/8';

my.cnf 添加
loose_group_replication_ip_whitelist = '192.168.0.0/16,10.0.0.0/8'

A类IP地址的默认子网掩码为255.0.0.0(由于255相当于二进制的8位1,所以也缩写成“/8”,表示网络号占了8位);B类的为255.255.0.0(/16);C类的为255.255.255.0(/24)。/30就是255.255.255.252。32就是255.255.255.255.

注意这里的16, 24不是看ip a里的值

img

set global group_replication_ip_whitelist = '192.168.0.0/16,10.0.0.0/8';     10.x.x.x都可以
set global group_replication_ip_whitelist = '192.168.0.0/16,10.133.0.0/16';  10.133.x.x都可以
set global group_replication_ip_whitelist = '192.168.0.0/16,10.133.1.0/24';  10.133.1.x都可以

相关异常

 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 23307'
 
 
2019-12-09T08:18:18.804055Z 0 [Warning] Plugin group_replication reported: '[GCS] Connection attempt from IP address 10.133.1.37 refused. Address is not in the IP whitelist.'
2019-12-09T08:18:18.804092Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'
2019-12-09T08:18:18.922608Z 0 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 23307'

注意要加入的节点的group_replication_group_seeds一定要把设置好group_replication_ip_whitelist的节点写在最前面,或者删掉没有设置好group_replication_ip_whitelist的节点, 否则会一直报错

 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 23307'

举例子

192.168.x.224 group_replication_ip_whitelist='';
192.168.x.225 group_replication_ip_whitelist='192.168.0.0/16,10.133.0.0/16';
192.168.x.226 group_replication_ip_whitelist='192.168.0.0/16,10.133.0.0/16';

要把10.133.1.46加入集群, 而它的group_replication_group_seeds192.168.x.224:23310,192.168.x.225:23310,192.168.x.226:23310 那么它会一直报错无法加入集群

同时192.168.x.224会报

img

原因就是224是10.133.1.46的group_replication_group_seeds的第一个…

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值