keepalived basics

Install/configure

Both Machines

yum install keepalived
cd /etc/keepalive/
      

Master/Primary

cp keepalive.conf keepalive.dist
      

On the master: (priority is what changes, not state)

vim keepalive.conf
vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 50
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass PASSWORDHERE
    }
    virtual_ipaddress {
        10.24.11.67/16 dev eth0 label eth0:1
    }
}
      
chkconfig keepalived on
service keepalived start
      

Slave/Secondary

On the slave: (priority is what changes, not state)

vim keepalive.conf
vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 75
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass PASSWORDHERE
    }
    virtual_ipaddress {
        10.24.11.67/16 dev eth0 label eth0:1
    }
}
      
chkconfig keepalived on
service keepalived start
      

References