Switch keepalived into BACKUP globaly to prevent automatic migration to node with highest priority. It is not suitable for production environment in case of maintance, where you get two sessions interuptions between rebooting master node.
VRRP will normally preempt a lower priority # machine when a higher priority machine comes # online. "nopreempt" allows the lower priority # machine to maintain the master role, even when # a higher priority machine comes back online. # NOTE: For this to work, the initial state of this # entry must be BACKUP. nopreempt
diff --git a/keepalived/files/keepalived.conf b/keepalived/files/keepalived.conf
index 30c8d47..ed429be 100644
--- a/keepalived/files/keepalived.conf
+++ b/keepalived/files/keepalived.conf
@@ -4,8 +4,8 @@
{% for instance_name, instance in cluster.instance.iteritems() %}
vrrp_instance {{ instance_name }} {
- state MASTER
- preempt_delay 7
+ state BACKUP
+ nopreempt
garp_master_delay 5
garp_master_repeat 3
garp_master_refresh 1