What is the proper way to add IP addresses to a keepalived vrrp_instance
without have the IPs flop around or drop for a second?

- 83,619
- 74
- 305
- 448
2 Answers
Simply killall -HUP keepalived
However it has to be done on all servers at roughly the same time as there is the transmission of the count of IPs for a VRRP. ("receive an invalid ip number count associated with VRID")

- 8,811
- 21
- 32
- 47

- 41
- 2
-
What happens when this stays off for too long? – Theuni Aug 28 '15 at 11:16
This may not be the answer you want to hear as it's a bit of a fudge I think, but I wanted to share an idea with you (as I don't believe there is any supported way of doing this, i.e. having a running keepalived
process reload it's config).
You could manually add the IP's to the keepalived
interface on the VRRP master using CLI, so assume server1 eth1 is 192.168.0.1 and server2 eth1 is 192.168.0.2, and they both have 192.168.0.254 in keepalived
. On server1;
sudo ip a a 192.168.0.253/24 dev eth1
The master now has the additional IP(s).
On server2, make the changes to keepalived
config, add in the new IPs, add them under virtual_ipaddress_excluded, as per this SF query.
Now bounce keepalived
process on server2, the backup server.
Now add the IP(s) into server1 keepalived
confif but don't bounce the daemon, as that will cause downtime. If/when the day comes your master keepalived
box enters the fail over state and the server2 becomes master, bounce keepalived
on server1 then to reload the config (assuming you're not using preempt, server1 will now wait to become master again, and both boxes have the new IP(s) configured).
That is the only way I can see to do this. I'd like to hear a method for making a running keepalived
reload it's config if anyone has such a method.