# Configuration File for Keepalived # Global Configuration global_defs { notification_email { notification@domain.org } notification_email_from keepalived@mailinblack.org smtp_server localhost smtp_connect_timeout 30 router_id LVS_MASTER # string identifying the machine } # describe virtual service ip vrrp_instance VI_1 { # initial state state BACKUP interface eth0 # arbitary unique number 0..255 # used to differentiate multiple instances of vrrpd virtual_router_id 1 # for electing MASTER, highest priority wins. # to be MASTER, make 50 more than other machines. priority 50 authentication { auth_type PASS auth_pass xxx } virtual_ipaddress { 192.168.9.100/24 } # Invoked to master transition notify_master "/etc/keepalived/bypass_ipvs.sh del 192.168.9.100" # Invoked to slave transition notify_backup "/etc/keepalived/bypass_ipvs.sh add 192.168.9.100" # Invoked to fault transition notify_fault "/etc/keepalived/bypass_ipvs.sh add 192.168.9.100" } # describe virtual mail server virtual_server 192.168.9.100 25 { delay_loop 15 lb_algo rr lb_kind DR persistence_timeout 50 protocol TCP real_server 192.168.9.10 25 { TCP_CHECK { connect_timeout 3 } } real_server 192.168.9.20 25 { TCP_CHECK { connect_timeout 3 } } } # describe virtual web server virtual_server 192.168.9.100 80 { delay_loop 30 lb_algo rr lb_kind DR persistence_timeout 50 protocol TCP real_server 192.168.9.10 80 { HTTP_GET { url { path /apache2-default/index.html digest c7b4690c8c46625ef0f328cd7a24a0a3 } connect_timeout 3 nb_get_retry 3 delay_before_retry 2 } } real_server 192.168.9.20 80 { HTTP_GET { url { path /apache2-default/index.html digest c7b4690c8c46625ef0f328cd7a24a0a3 } connect_timeout 3 nb_get_retry 3 delay_before_retry 2 } } }