problem phenomenon
Recently, I was testing two dual-machine hot backups. It is obviously configured in non-preemptive mode, but every time the main machine goes down, the VIP can float to the standby machine, but after the main machine restarts, the VIP floats back to the main machine.
Troubleshooting, read the configuration files of the two keepaliveds in detail
Host:
vrrp_instance VI_1 {
state BACKUP
interface ens192
virtual_router_id 67
priority 100
nopreempt
advert_int 1
Standby:
vrrp_instance VI_1 {
state BACKUP
interface ens192
virtual_router_id 67
priority 90
nopreempt
advert_int 1
I carefully checked the two configuration files and found no problems. At the same time, in order to prevent virtual_router_id conflicts, I changed several VIPs and the same phenomenon
Finally, it is found that the firewall on the master is enabled, while the firewall on the backup is off, so that vrrp packets can only go from the master to the backup, and the backup cannot go to the master, and the priority of the master is high. The vip has been snatched back. Turning off the two firewalls will solve the problem
Summarize
The failure to encounter this non-preemptive mode is generally caused by two reasons:
1. Virtual_router_id conflict
2. The firewall is not closed