Skip to main content

Untested Failover Is Not High Availability

A configured cluster proves nothing until a node has actually been taken away from it. Split-brain, a truncated auth_pass, a health check that never drops priority — every one of these looks correct in the configuration file and fails only under the condition the cluster exists for. Test it deliberately, on a schedule, and keep the output.

Validate prerequisites

Confirm:
  • An active-passive pair is configured. See Monit and Keepalived.
  • Both nodes are healthy and the VIP is currently held by the Master.
  • The test window is approved, and clients affected by a brief handover are known.
  • You have shell access to both nodes.

Confirm the starting state

On the Master, confirm Keepalived owns the VIP and the health check passes:
Expected output on the Master includes:
Confirm the address is Keepalived-owned, not statically assigned:
Expected output on the Master only:
The proto keepalived tag confirms Keepalived owns the address and will withdraw it automatically on failover. An address without that tag was assigned statically and will not move.

Trigger the failover

Open two terminals. Watch the log on the Backup while you stop SafeSquid on the Master.
Within 10–15 seconds the log shows the handover:
Confirm the VIP moved:
Expected result: the address now appears on the Backup and is gone from the Master. Prove it from a client, not only from the nodes. Browse through the VIP and confirm the request appears in the surviving node’s access log — a VIP that moved but carries no traffic is a half-successful failover.

Restore the Master

nopreempt keeps the VIP on the Backup after the Master recovers. This avoids a second interruption during business hours. To move the VIP back deliberately, restart Keepalived on the Master: sudo systemctl restart keepalived.

Capture failover evidence

Store these artifacts with the change record:
  • journalctl -u keepalived extract covering the tested failover, showing the state transition and gratuitous ARP.
  • ip a output before and after failover, showing VIP ownership on each node.
  • /var/log/keepalived_check.log and /var/log/monit.log for the test window.
  • Client-side proof that browsing resumed through the VIP, plus the access-log entries from the surviving node.
  • The date of the last tested failover and the named owner of the next test.
Schedule a failover test on the same cadence as your disaster-recovery restore test. A cluster that has not failed over in a year is a configuration file, not a control.

Troubleshoot failover tests

Next steps