提问人:zerozg 提问时间:3/9/2023 更新时间:3/9/2023 访问量:402
持续的脑裂问题
Keepalived split brain issue
问:
我在 Oracle Linux 8 上遇到 keepalived 问题。VIP 分配给两个节点,并且两个节点都处于 MASTER 模式。
**我的keepalive配置是: ** 节点 1 猫 /etc/keepalived/keepalived.conf
global_defs {
vrrp_priority -20
checker_priority -19
script_user root
}
vrrp_script chk_haproxy {
script "/usr/bin/killall -0 haproxy" # check the haproxy process
interval 2 # every 2 seconds
weight 2 # add 2 points if OK
timeout 3
fall 3
}
vrrp_instance VI_1 {
interface ens192 # interface to monitor
state BACKUP # MASTER on haproxy1, BACKUP on haproxy2
nopreempt
virtual_router_id 52
priority 101 # 101 on haproxy1, 100 on haproxy2
virtual_ipaddress {
VIP_adcat /vardress # virtual ip address
}
track_script {
chk_haproxy
}
}
节点 2 猫 /etc/keepalived/keepalived.conf
global_defs {
vrrp_priority -20
checker_priority -19
script_user root
}
vrrp_script chk_haproxy {
script "/usr/bin/killall -0 haproxy" # check the haproxy process
interval 2 # every 2 seconds
weight 2 # add 2 points if OK
timeout 3
fall 3
}
vrrp_instance VI_1 {
interface ens192 # interface to monitor
state BACKUP # MASTER on haproxy1, BACKUP on haproxy2
nopreempt
virtual_router_id 52
priority 100 # 101 on haproxy1, 100 on haproxy2
virtual_ipaddress {
VIP_adress # virtual ip address
}
track_script {
chk_haproxy
}
}
我已向防火墙添加规则:
防火墙-cmd --列表全部
public (active)
target: default
icmp-block-inversion: no
interfaces: ens192
sources: here are ip addreses of both nodes
services: cockpit dhcpv6-client ssh
ports: 3306/tcp 3305/tcp
protocols:
forward: no
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" destination address="224.1.0.0/16" accept
rule family="ipv4" destination address="224.0.0.18" protocol value="ip" accept
rule protocol value="vrrp" accept
当我禁用防火墙时,一切正常且正常工作,但是使用启动防火墙后,我获得了带有 VIP 的两个节点。
在日志中,我可以找到日志: Keepalived_vrrp[1077307]: (VI_1) 接收通告超时
有什么想法吗?
答: 暂无答案
评论