acassen / keepalived

Keepalived
https://www.keepalived.org
GNU General Public License v2.0
3.96k stars 737 forks source link

Both VRRP peers become master when uincast_peer is configured #2458

Closed subhajit-cdot closed 1 month ago

subhajit-cdot commented 1 month ago

Hi

We are using keepalived version v1.2.24 on a Debian based VM.

1.) With multicast advertising, the VRRP master-backup selection worked fine. We changed the advertisement through unicast peer addresses (configuration attached for both nodes). We found that both the nodes became master (logs of both nodes attached).

2.) We increased the VRRP priority at node A and it became master and node B became backup, as expected.

3.) When we reverted back one of the nodes to multicast advertisement (say node A) and kept the other with unicast (node B), node A became master and node B became backup.

vrrp_a_conf.txt vrrp_a_log.txt vrrp_b_conf.txt vrrp_b_log.txt

Thanks

pqarmitage commented 1 month ago

The log entries:

VRRP (vyatta-dp0p0s20.2024-220) recv_ifindex: 11 xmit_ifindex: 11 fd_in: 25 fd_out: 26
Socket recv_ifindex: 2 xmit_ifindex: 2 fd_in: 19 fd_out: 24
Socket recv_ifindex: 11 xmit_ifindex: 11 fd_in: 25 fd_out: 26
Found a socket that matches the VRRP group.

which occur several times in the log files provided are not produced by the upstream keepalived code, which suggests you are running a modified version of keepalived.

I notice that you have virtual_ipaddress 31.8.101.1/16 on interface dp0p0s20.2024 and 31.8.1.1/16 on interface dp0p0s21.2025. This means that you have the same subnet on both interfaces. Is that what is intended?

If both nodes are becoming master when you use unicast then it suggests that you either have a configuration error (e.g. incorrect unicast addresses specified) or for some reason the unicast adverts are not being received by the node that should be receiving them (this can be caused by firewalls not allowing the VRRP protocol, number 112. In your case it might be allowed for multicast but not unicast).

I suggest you try capturing packets with tcpdump or equivalent on each system and then analysing what is being sent and received. This is not a known keepalived issue.

subhajit-cdot commented 1 month ago

But I am not sure how both multicast with same vrrp priority and unicast with different vrrp priority working fine. Yes there are some prints added in the keepalived. I will add packet dump here