Appearance
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/roleon each node's metrics listener (-metrics-addr):200on the active node,503on the standby.
- For Linux mode, waap needs the
CAP_NET_ADMINandCAP_NET_RAWcapabilities, 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=eth0yaml
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
reachabilitytarget 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 isha.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 (alarmha.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 raisesha.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:)
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Virtual addresses (virtual_addresses) | Addresses the active node holds. | none | up to 8, with prefix length (192.0.2.10/24, 2001:db8::10/64) | Linux mode |
Interface (interface) | Interface that carries them. | none | interface name | required with virtual addresses |
Address mode (address_mode) | Whether waap moves addresses. | linux with virtual addresses, else external | linux, external | all |
Heartbeat interval (heartbeat_interval) | How often nodes send a heartbeat. | 200ms | 50ms to 5s | all |
Peer timeout (peer_timeout) | Silence after which a peer is lost. | 1s | at least 3 heartbeat intervals, at most 30s | all |
Failback (failback) | The node with the better (lower) priority takes the role back when healthy. | false | true, false | all |
Reachability (reachability) | TCP targets; a node that reaches none is not eligible. | none | up to 4 host:port | all |
Probe port (probe_port) | Checked on the virtual addresses before a takeover while the peer is lost. | the first listener's port | port | Linux mode |
Announce (announce.count, announce.interval) | Burst of ARP or neighbour advertisements on takeover. | 3 every 200ms | count, duration | Linux mode |
Lease (lease) | Kernel lifetime of a held address. | 3s | longer than the peer timeout plus one heartbeat, at most 1m | Linux mode |
Limits
| Limit | Value |
|---|---|
| Virtual addresses | 8 |
| Reachability targets | 4 |
| Peer timeout | 3 heartbeats to 30 s |
| Detection time with defaults | about 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 statuson both nodes, and theha.peer_link_downalarm. - Fix: restore the peer link, add a second peer address, and configure
reachability.
The virtual address does not move
- Cause: waap lacks
CAP_NET_ADMINorCAP_NET_RAW, or the interface is down. - Fix: run waap as root or with the capabilities, and check the interface.