wiki:keepalived

Version 1 (modified by krit, 2 years ago) (diff)

--

Keepalived active stand by

On master site ip 10.7.168.221, file /etc/keepalived/keepalived.conf

root@n4:/etc/keepalived# pwd
/etc/keepalived
root@n4:/etc/keepalived# more keepalived.conf 
vrrp_script chk_service_health {
    #script /etc/keepalived/check_proc.sh
    #script /etc/keepalived/check_ping.sh
    weight 10
    # how often script run in period 10 sec
    interval 5
    # How long to wait for the script to return (5 seconds).
    timeout 5
    # How many times the script must return successfully in order for the host to be considered healthy.
    rise 3
    # How many times the script must return unsuccessfully (or time out) in order for the host to be considered unhealthy
    fall 3
}

vrrp_instance VI_1 {
        #state BACKUP
        state MASTER
        interface ens3
        virtual_router_id 51
        priority 201
        advert_int 10
        authentication {
              auth_type PASS
              auth_pass 1234
        }
        unicast_src_ip 10.7.168.221
        unicast_peer {
             10.7.168.58
        }
        virtual_ipaddress {
             10.7.168.200/24
        }
        track_script {
            chk_service_health
        }
        notify /etc/keepalived/keepalived_notify.sh
        notify_master /etc/keepalived/keepalived_notify_master.sh
        notify_backup /etc/keepalived/keepalived_notify_backup.sh
}


Attachments (8)

Download all attachments as: .zip