Skip to content

High availability ​

waap ha forms and manages a pair of nodes: init, token, join, status, leave, switchover and maintenance.

The shared pair settings (virtual addresses, timers, reachability, failback) are in the configuration's ha: section. Change them with waap settings get|set ha, or in the UI's Pair settings.

The metrics listener serves GET /ha/role (200 when active or standalone, 503 on standby) for external load balancers.

On the standby node, administration commands that change something (config apply, bans add, admin add and others) are refused. Run them on the active node.

sh
waap ha <init|token|join|status|leave|switchover|maintenance>

waap ha init ​

On a running node, creates a pair with its own CA, and prints a one-time join token valid for 1 hour.

sh
waap ha init -listen HOST:PORT -address HOST:PORT[,HOST:PORT]
FlagWhat it doesDefault
-listenThe peer link listener, on its own port.suggested 9444
-addressWhere the other node reaches this one. Give one per independent network path, at most 4.

waap ha token ​

Prints another join token. Use it, for example, to replace a failed node with the same node ID.

sh
waap ha token

waap ha join ​

Joins the pair. Run it on the second node while that node is stopped.

sh
waap ha join -data-dir DIR -node-id ID -listen HOST:PORT -address HOST:PORT[,...] [-replace] TOKEN
  • The node's data will come from the other node, so an existing database is refused unless -replace moves it aside (waap.db.replaced-<time>).
  • Start the node afterwards with the same -data-dir and -node-id. It starts as standby, copies the active node's data, then follows every change.

waap ha status ​

Shows the pair as this node sees it:

  • its role and term
  • the peer
  • each link: state, round trip, last error
  • the peer's last heartbeat: software version and configuration version
  • whether the two nodes are in sync: configuration, files, country database, replication lag

The heartbeat's config_format is the highest document format the software reads. It is separate from the stored config_version. A missing or zero value means a legacy format 1 peer.

ha status -json includes the local config_format, format_behind and peer.beat.config_format. The text output includes the peer's readable format, and the warning ha.format_behind.

Upgrade the standby first, switch over, then upgrade the other node. Stored migration waits until the active node sees a peer capability of at least 2.

sh
waap ha status [-json]

waap ha leave ​

Returns this node to standalone, keeping its data. The pair settings move to data-dir/ha.left-<time>.

sh
waap ha leave

waap ha switchover ​

On the active node, hands the active role to the standby. It returns when the standby is active, and prints how long it took. It is refused unless the standby is healthy, not in maintenance, and in sync.

sh
waap ha switchover

waap ha maintenance ​

  • on takes this node out of the election. The active node switches over first, and the command is refused if it cannot. The node stays standby, also after a restart, until off.
  • off ends maintenance.
sh
waap ha maintenance on|off