This commit is contained in:
2023-04-16 21:38:32 +08:00
parent a0849e40ef
commit 0b6c876a0f
59 changed files with 1026 additions and 189 deletions

View File

@@ -0,0 +1,33 @@
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是服务器的网卡名
}
}