2023-04-16 21:38:32 +08:00

34 lines
709 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

global_defs {
router_id nginx1 # 在另一台服务器中,这里配置 nginx2
script_user root
enable_script_security
}
vrrp_script chk_nginx {
script "/sbin/ss -lnt | grep -q ':80\>'"
interval 10
weight 0
fall 2
rise 2
}
vrrp_instance VI_1 {
state BACKUP
virtual_router_id 14
priority 150 # 在另一台服务器中这里配置100
advert_int 2
nopreempt
interface eth0 # 这里的 eth0 是服务器的网卡名
track_script {
chk_nginx
}
authentication {
auth_type PASS
auth_pass El_en_nginx_1234
}
virtual_ipaddress {
虚拟IP/掩码 dev eth0 # 这里的eth0是服务器的网卡名
}
}