[root@s1 keepalived-2.0.18]# pwd /alidata1/server/keepalived-2.0.18 [root@s1 keepalived-2.0.18]# ll total 0 drwxr-xr-x. 2 root root 21 Sep 24 05:18 bin drwxr-xr-x. 4 root root 41 Sep 24 05:18 etc drwxr-xr-x. 2 root root 24 Sep 24 05:18 sbin drwxr-xr-x. 5 root root 40 Sep 24 05:18 share
[root@s1 keepalived-2.0.18]# more etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
router_id server1
vrrp_skip_check_adv_addr
# vrrp_strict
vrrp_garp_interval 0
vrrp_gna_interval 0
}
vrrp_script hf_check{
script "/alidata1/haifeng/sh/check_health.sh"
interval 5
weight -10
}
vrrp_instance VI_1 {
state MASTER
interface ens33
virtual_router_id 50
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.1.220/32 dev ens33
}
track_script{
hf_check weight -5
}
notify_master "/alidata1/haifeng/sh/notify_master.sh"
notify_backup "/alidata1/haifeng/sh/notify_backup.sh"
notify_fault "/alidata1/haifeng/sh/notify_fault.sh"
notify "/alidata1/haifeng/sh/notify.sh"
}