! Configuration File for keepalived
 
global_defs {
   notification_email {
        report@xx.com  
 }
   notification_email_from Keepalived@xx.com
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
}
 
vrrp_script chk_http_port {
    script "/etc/keepalived/chk_nginx_pid.sh"
    interval 2
    weight 2
}
 
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 51
    priority 99
    advert_int 1
  
authentication {
        auth_type PASS
        auth_pass 1111
    }
    track_script {
        chk_http_port
    }
    virtual_ipaddress {
        192.168.10.6
    }
}
vrrp_instance VI_2 {
    state MASTER
    interface eth0
    virtual_router_id 52
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    track_script {
        chk_http_port
    }
    virtual_ipaddress {
        192.168.10.5
    }
}
