kolla-ansible/ansible/roles/haproxy/templates/keepalived.conf.j2
SamYaple 024d76534e Use nopreempt for keepalived
Without this option the vip will always bounce to the highest priority
node that is up. So if you reboot the highest priority node the vip
will fail to the second highest. When the highest priority node
recovers it will claim the vip again leaving you will two fail overs
rather than one.

TrivialFix

Change-Id: I4a3c6c10eee391cdbdd80c44a71a9fafd1069944
2016-03-14 01:36:33 +00:00

47 lines
1010 B
Django/Jinja

vrrp_script check_alive {
script "/check_alive.sh"
interval 2
fall 2
rise 10
}
vrrp_instance kolla_internal_vip {
state BACKUP
nopreempt
interface {{ api_interface }}
virtual_router_id 51
priority {{ groups['haproxy'].index(inventory_hostname) + 1 }}
advert_int 1
virtual_ipaddress {
{{ kolla_internal_vip_address }}
}
authentication {
auth_type PASS
auth_pass {{ keepalived_password }}
}
track_script {
check_alive
}
}
{% if haproxy_enable_external_vip | bool %}
vrrp_instance kolla_external_vip {
state BACKUP
nopreempt
interface {{ kolla_external_vip_interface }}
virtual_router_id 52
priority {{ groups['haproxy'].index(inventory_hostname) + 1 }}
advert_int 1
virtual_ipaddress {
{{ kolla_external_vip_address }}
}
authentication {
auth_type PASS
auth_pass {{ keepalived_password }}
}
track_script {
check_alive
}
}
{% endif %}