keepalived 的 unicast 单播模式
生活随笔
收集整理的這篇文章主要介紹了
keepalived 的 unicast 单播模式
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
最近遇到一個問題,keepalived 在 OpenStack 環(huán)境下一直腦裂無法選舉。在不支持組播的場景下,可以使用單播模式。
主節(jié)點:
global_defs {
router_id LVS_DEVEL
# vrrp_strict # 嚴格模式不支持單播
vrrp_skip_check_adv_addr
vrrp_garp_interval 0
vrrp_gna_interval 0
vrrp_iptables
script_user root
enable_script_security
}
vrrp_script chk_nginx {
script "/usr/bin/killall -0 nginx && exit 0 || exit 1"
interval 1
weight -10
fall 2
rise 1
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 55
priority 100
advert_int 1
# nopreempt
unicast_src_ip 172.20.47.4
unicast_peer {
172.20.47.5
}
authentication {
auth_type PASS
auth_pass 12345678
}
virtual_ipaddress {
172.20.47.202
}
track_script {
chk_nginx
}
}
備節(jié)點:
global_defs {
router_id LVS_DEVEL
# vrrp_strict # 嚴格模式不支持單播
vrrp_skip_check_adv_addr
vrrp_garp_interval 0
vrrp_gna_interval 0
vrrp_iptables
script_user root
enable_script_security
}
vrrp_script chk_nginx {
script "/usr/bin/killall -0 nginx && exit 0 || exit 1"
interval 1
weight -10
fall 2
rise 1
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 55
priority 95
advert_int 1
# nopreempt
unicast_src_ip 172.20.47.5
unicast_peer {
172.20.47.4
}
authentication {
auth_type PASS
auth_pass 12345678
}
virtual_ipaddress {
172.20.47.202
}
track_script {
chk_nginx
}
}
參考:
https://www.jianshu.com/p/7c709c3be4a9
https://blog.csdn.net/weixin_34362991/article/details/93011752
https://blog.csdn.net/kjh2007abc/article/details/90455558
總結(jié)
以上是生活随笔為你收集整理的keepalived 的 unicast 单播模式的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何在wine下为Source Insi
- 下一篇: 如何在virtualbox中对虚拟机截图