我正在尝试为我的服务实现基于 keepalived 的故障转移。请在下面找到我的主节点和备份节点的配置。
主节点:
vrrp_script chk_splunkd {
script "pidof splunkd"
interval 2
fall 2
rise 2
}
vrrp_instance VI_1 {
interface eth0
state MASTER
advert_int 1
virtual_router_id 51
priority 200
nopreempt
smtp_alert
authentication {
auth_type PASS
auth_pass passme
}
virtual_ipaddress {
10.126.246.245
}
track_script {
chk_splunkd
}
notify_master /etc/keepalived/scripts/master.sh
notify_backup /etc/keepalived/scripts/stop_service.sh
notify_fault /etc/keepalived/scripts/stop_service.sh
}
备份节点:
vrrp_script chk_splunkd {
script "pidof splunkd"
interval 2
fall 2
rise 2
}
vrrp_instance VI_1 {
interface eth0
state BACKUP
advert_int 1
virtual_router_id 51
priority 100
nopreempt
smtp_alert
authentication {
auth_type PASS
auth_pass passme
}
virtual_ipaddress {
10.126.246.245
}
track_script {
chk_splunkd
}
notify_master /etc/keepalived/scripts/master.sh
notify_backup /etc/keepalived/scripts/stop_service.sh
notify_fault /etc/keepalived/scripts/stop_service.sh
}
但是,我发现即使一个节点进入故障状态并停止发送 VRRP 通告,另一个节点也不会自动转换到主状态。当我尝试使用监控 VRRP 广告数据包时,tcpdump -vv -i eth0 vrrp
我发现即使在来自一个节点的广告停止之后,另一个节点也不会自动开始发送指示它现在已成为主节点的广告。
请帮我找出我缺少的东西。
谢谢,
克尔塔娜