Keepalived

From FlimzyWiki

Jump to: navigation, search

This was much easier than I expected!

Set up two Debian systems, install keepalived on both, and then create /etc/keepalived/keepalived.conf on each.

On the "master" node:

vrrp_instance VI_1 {
 state MASTER
 interface eth0
 virtual_router_id 1
 priority 100
 authentication {
  auth_type PASS
  auth_pass password
 }
 virtual_ipaddress {
  172.17.3.220/24 brd 172.17.3.255 dev eth0
 }
}

On the "backup" node:

vrrp_instance VI_1 {
 state BACKUP
 interface eth0
 virtual_router_id 1
 priority 50
 authentication {
  auth_type PASS
  auth_pass password
 }
 virtual_ipaddress {
  172.17.3.220/24 brd 172.17.3.255 dev eth0
 }
}

Then restart keepalived on both machines (/etc/init.d/keepalived restart), and watch /var/log/messages. Whaola!

I also added a section to both machines to alert me via e-mail of any issues:

global_defs {
 notifcation_email {
  email@wherever.fu.bar.com
 }
 notifcation_email_from keepalived@lvs2.dc.nmgi.com
 smtp-server 172.17.1.18
 smtp_connect_timeout 30
}

Links =

Redundant routers with Linux and Keepalived THIS LINK IS BROKEN (fixme)

Description needed ... keepalive does what? (fixme)

Personal tools