[root@localhost ~]# cat /etc/keepalived/keepalived.conf
global_defs{
vrrp_script chk_http {
script "/usr/local/keepalived/nginx_pid.sh"
interval 9
weight 1
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 50
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 123456
}
track_script {
chk_http
}
virtual_ipaddress {
192.168.3.135
}
}
vrrp_instance VI_2 {
state BACKUP
interface eth0
virtual_router_id 49
priority 99
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
track_script {
chk_http
}
virtual_ipaddress {
192.168.3.135
}
}
}
---------------------------------------------------------------------------
[root@localhost ~]# cat /etc/keepalived/keepalived.conf
global_defs{
vrrp_script chk_http {
script "/usr/local/keepalived/nginx_pid.sh"
interval 9
weight 1
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 50
priority 99
advert_int 1
authentication {
auth_type PASS
auth_pass 123456
}
track_script {
chk_http
}
virtual_ipaddress {
192.168.3.135
}
}
vrrp_instance VI_2 {
state MASTER
interface eth0
virtual_router_id 49
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
track_script {
chk_http
}
virtual_ipaddress {
192.168.3.135
}
}
}