###########################lb01
cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived_lb01
global_defs {
# notification_email {
# [email protected]
# }
router_id LB01
}
vrrp_script check_lb {
script "/server/scripts/check_lb.sh"
interval 2
weight 2
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.3/24 dev eth0 label eth0:1
}
track_script {
check_lb
}
}
vrrp_instance VI_2 {
state MASTER
interface eth0
virtual_router_id 52
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.4/24 dev eth0 label eth0:2
}
}
#######################lb02
cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived_lb01
global_defs {
# notification_email {
# [email protected]
# }
router_id LB01
}
vrrp_script check_lb {
script "/server/scripts/check_lb.sh"
interval 2
weight 2
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.3/24 dev eth0 label eth0:1
}
track_script {
check_lb
}
}
vrrp_instance VI_2 {
state BACKUP
interface eth0
virtual_router_id 52
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.4/24 dev eth0 label eth0:2
}
}
原文地址:http://blog.51cto.com/13667111/2124815