keepalived+nginx实现双机热备 keepalived启动成功但是虚拟ip不通
! Configuration File for keepalived
global_defs {
router_id nginx01
script_user root
enable_script_security
}
vrrp_script chk_nginx {
script "/etc/keepalived/check_nginx.sh"
interval 2
weight 10
fall 2
rise 2
}
vrrp_instance VI_1 {
state MASTER
interface ens192
virtual_router_id 68
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.169.200
}
track_script {
chk_nginx
}
notify_master /etc/keepalived/to_master.sh
}
! Configuration File for keepalived
global_defs {
router_id nginx02
}
vrrp_script chk_nginx {
script "/etc/keepalived/check_nginx.sh"
interval 2
weight 10
fall 2
rise 2
}
vrrp_instance VI_1 {
state BACKUP
interface ens192
virtual_router_id 68
priority 149
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.169.200
}
track_script {
chk_nginx
}
notify_master /etc/keepalived/to_backup.sh
}
master
backup