Skip to content

Failover and the virtual address Since v0.1 ​

Failover moves the active role to the standby when the active node is gone or unhealthy. The shared settings are in the configuration's ha: section, so both nodes agree. Both nodes apply a change at the next heartbeat, without a restart.

Before you begin ​

  • Role: admin.
  • Choose between the two address modes:
    • Linux (virtual addresses): the active node holds the address.
    • External: nothing is moved. A load balancer, floating IP or keepalived checks GET /ha/role on each node's metrics listener (-metrics-addr): 200 on the active node, 503 on the standby.
  • For Linux mode, waap needs the CAP_NET_ADMIN and CAP_NET_RAW capabilities, or root.

Change the pair settings ​

You can fill in the form before the pair is formed.

text
1. Open System > High availability > Pair settings.
2. Enter Virtual addresses, Interface and the timers.
3. Select Preview changes, add a comment and select Apply.
sh
waap settings get ha
waap settings set ha -m "virtual address" virtual_addresses=192.0.2.10/24 interface=eth0
yaml
ha:
  virtual_addresses: [192.0.2.10/24]
  interface: eth0
  reachability: ["192.0.2.1:443"]

How the virtual address moves ​

The active node adds the addresses with a short kernel lifetime (lease, 3 s), renewed on every heartbeat, so a dead process never keeps them. On takeover it announces them: gratuitous ARP for IPv4, unsolicited neighbour advertisements for IPv6. Both nodes' Envoy already listen on the virtual addresses, so a takeover only moves the address.

Who is active ​

A node is eligible only if its checks pass:

  • Envoy runs and accepted the active configuration.
  • An inspection service is connected.
  • The stored configuration is the one running.
  • The virtual address interface is up.
  • At least one reachability target answers, if any is configured.

Then the choice is, in order: an eligible node beats one that is not; a node not in maintenance beats one in maintenance; with failback: true the better priority wins; otherwise the current active node keeps the role, so a recovered node does not take traffic back; then the newer term, priority and name.

What triggers a failover ​

  • Active node stops answering: after peer_timeout (1 s) the standby takes over with a higher term. The audit record is ha.takeover. Default timers fail over within about 1.5 s.
  • Peer link cut, both nodes alive: before taking over, the standby checks the virtual address on probe_port. If it still answers, the active node is alive and the standby stays standby (alarm ha.peer_link_down).
  • Isolated active node: configure reachability, for example the gateway. A node cut off from the network then neither takes over nor keeps the address: an isolated active node steps down.
  • Unhealthy active node: it hands over to a healthy standby after being unhealthy for a peer timeout (ha.step_down). If the standby is not healthy either, it keeps the role and raises ha.unhealthy.
  • Restart: a node always starts as standby. The election makes it active only if its peer is gone or the rules prefer it.

Configure reachability

Without a reachability target, a node cut off from every network cannot tell it is isolated. Add at least one target that is reachable only when the network is healthy.

Settings reference ​

Pair settings (ha:) ​

SettingWhat it doesDefaultAllowed valuesApplies in
Virtual addresses (virtual_addresses)Addresses the active node holds.noneup to 8, with prefix length (192.0.2.10/24, 2001:db8::10/64)Linux mode
Interface (interface)Interface that carries them.noneinterface namerequired with virtual addresses
Address mode (address_mode)Whether waap moves addresses.linux with virtual addresses, else externallinux, externalall
Heartbeat interval (heartbeat_interval)How often nodes send a heartbeat.200ms50ms to 5sall
Peer timeout (peer_timeout)Silence after which a peer is lost.1sat least 3 heartbeat intervals, at most 30sall
Failback (failback)The node with the better (lower) priority takes the role back when healthy.falsetrue, falseall
Reachability (reachability)TCP targets; a node that reaches none is not eligible.noneup to 4 host:portall
Probe port (probe_port)Checked on the virtual addresses before a takeover while the peer is lost.the first listener's portportLinux mode
Announce (announce.count, announce.interval)Burst of ARP or neighbour advertisements on takeover.3 every 200mscount, durationLinux mode
Lease (lease)Kernel lifetime of a held address.3slonger than the peer timeout plus one heartbeat, at most 1mLinux mode

Limits ​

LimitValue
Virtual addresses8
Reachability targets4
Peer timeout3 heartbeats to 30 s
Detection time with defaultsabout 1.5 s

Troubleshooting ​

Both nodes think they are active ​

  • Cause: the peer link is cut and the standby cannot probe the virtual address.
  • Check: waap ha status on both nodes, and the ha.peer_link_down alarm.
  • Fix: restore the peer link, add a second peer address, and configure reachability.

The virtual address does not move ​

  • Cause: waap lacks CAP_NET_ADMIN or CAP_NET_RAW, or the interface is down.
  • Fix: run waap as root or with the capabilities, and check the interface.