本帖最后由 chongzh 于 2023-9-22 14:18 编辑 Gitee :https://gitee.com/GreatSQL/GreatSQL/issues/I83JHV?from=project-issue 【 使用版本 】 8.0.32-24 【 使用环境 】 生产环境 or 测试环境 【问题描述】 如果反馈是误报,我将及时删除 greatdb_ha_mgr_vip_broad 缺省默认为 255.255.255.255, 缺少正确的参数配置指引 官方手册 https://greatsql.cn/docs/8032/user-manual/5-enhance/5-2-ha-mgr-vip.html [mysqld] plugin-load-add=greatdb_ha.so loose-greatdb_ha_enable_mgr_vip=1 loose-greatdb_ha_mgr_vip_ip =172.26.170.91 loose-greatdb_ha_mgr_vip_mask=255.255.255.255 loose-greatdb_ha_mgr_vip_nic=ens160 【复现路径】 my.cnf 正确配置:greatdb_ha_mgr_vip_broad 指定为 vip地址 且 greatdb_ha_mgr_vip_mask 指定为 255.255.255.255 (Fri Sep 22 09:31:41 2023)[root@GreatSQL][(none)]>show variables like '%vip%'; +---------------------------------+-----------------+ | Variable_name | Value | +---------------------------------+-----------------+ | greatdb_ha_enable_mgr_vip | ON | | greatdb_ha_force_change_mgr_vip | OFF | | greatdb_ha_mgr_vip_broad | 172.26.170.91 | | greatdb_ha_mgr_vip_ip | 172.26.170.91 | | greatdb_ha_mgr_vip_mask | 255.255.255.255 | | greatdb_ha_mgr_vip_nic | ens160 | +---------------------------------+-----------------+ 6 rows in set (0.00 sec) [root@test_cdh_003 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:50:56:b2:2d:45 brd ff:ff:ff:ff:ff:ff inet 172.26.170.15/25 brd 172.26.170.127 scope global ens160 valid_lft forever preferred_lft forever inet 172.26.170.91/32 brd 172.26.255.255 scope global ens160:0 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:feb2:2d45/64 scope link valid_lft forever preferred_lft forever [root@test_cdh_003 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens160 TYPE=Ethernet BOOTPROTO=static NAME=ens160 DEVICE=ens160 ONBOOT=yes IPADDR=172.26.170.15 NETMASK=255.255.255.128 GATEWAY=172.26.170.126 DNS1=172.26.177.118 DNS2=172.26.187.110 —————————————————————————————————— my.cnf 错误配置 :greatdb_ha_mgr_vip_broad 为默认缺省为 255.255.255.255(Fri Sep 22 09:42:40 2023)[root@GreatSQL][(none)]>show variables like '%vip%'; +---------------------------------+-----------------+ | Variable_name | Value | +---------------------------------+-----------------+ | greatdb_ha_enable_mgr_vip | ON | | greatdb_ha_force_change_mgr_vip | OFF | | greatdb_ha_mgr_vip_broad | 255.255.255.255 | | greatdb_ha_mgr_vip_ip | 172.26.170.91 | | greatdb_ha_mgr_vip_mask | 255.255.255.255 | | greatdb_ha_mgr_vip_nic | ens160 | +---------------------------------+-----------------+ 【问题现象及影响】 #my.cnf 正确配置的情况下,切换后异机可以在不同的网段 在没有主动/手动 ARP 刷新的情况下,可以直接与vip正常通信 [root@IOV-DB-MYSQL101 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:50:56:b8:54:52 brd ff:ff:ff:ff:ff:ff inet 172.26.171.18/25 brd 172.26.171.127 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:feb8:5452/64 scope link valid_lft forever preferred_lft forever [root@IOV-DB-MYSQL101 ~]# ping 172.26.170.91 PING 172.26.170.91 (172.26.170.91) 56(84) bytes of data. 64 bytes from 172.26.170.91: icmp_seq=1 ttl=56 time=0.470 ms 64 bytes from 172.26.170.91: icmp_seq=2 ttl=56 time=0.598 ms ^C --- 172.26.170.91 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1555ms rtt min/avg/max/mdev = 0.470/0.534/0.598/0.064 ms ———————————————————————————————————— #my.cnf 错误配置的情况下,切换后异机可以在不同的网段 在没有主动/手动 ARP 刷新的情况下,不可以直接与vip正常通信 [root@IOV-DB-MYSQL101 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:50:56:b8:54:52 brd ff:ff:ff:ff:ff:ff inet 172.26.171.18/25 brd 172.26.171.127 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:feb8:5452/64 scope link valid_lft forever preferred_lft forever [root@IOV-DB-MYSQL101 ~]# ping 172.26.170.91 PING 172.26.170.91 (172.26.170.91) 56(84) bytes of data. From 172.26.170.14 icmp_seq=1 Destination Host Unreachable From 172.26.170.14 icmp_seq=2 Destination Host Unreachable From 172.26.170.14 icmp_seq=3 Destination Host Unreachable From 172.26.170.14 icmp_seq=4 Destination Host Unreachable ^C --- 172.26.170.91 ping statistics --- 5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4562ms pipe 4 【对该问题有什么建议】 为了 在任何网络环境都能够正常通信 或者 切换不影响vip对外可用性 建议将参数最佳实践的配置为 greatdb_ha_mgr_vip_ip 为vip地址、greatdb_ha_mgr_vip_broad 为vip地址,greatdb_ha_mgr_vip_mask=255.255.255.255 (请帮忙确认该认知是否正确,以及 这样配置有无风险) [mysqld] plugin-load-add=greatdb_ha.so loose-greatdb_ha_enable_mgr_vip=1 loose-greatdb_ha_mgr_vip_ip = vip地址 loose-greatdb_ha_mgr_vip_mask=255.255.255.255 loose-greatdb_ha_mgr_vip_nic=ens160 greatdb_ha_mgr_vip_broad=vip地址 |
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com