Appearance
Form a pair Since v0.1
You start the pair on a running node, which becomes the active node. You then join the second node while it is stopped. It starts as the standby, copies the active node's data and follows every change.
Before you begin
- Role:
admin. Run the commands on the nodes. - Both nodes run the same software version.
- The peer link port, for example
9444, is reachable between the two nodes only. Firewall it from everything else. Replicated data includes password hashes and private keys. - Give each node one peer address per independent network path, for example a dedicated cable and the management network. A peer counts as lost only when no path answers for 1 second.
Create the pair
On the first node, running:
text
1. Open System > High availability. A standalone node shows how to start a pair.
2. Run the shown waap ha init command on the node.
3. Fill in Pair settings if you use a virtual address (optional now).sh
waap ha init -listen 10.0.0.1:9444 -address 10.0.0.1:9444,192.168.50.1:9444The command prints a join token, valid for 1 hour and one use. This node is the active node.
Join the second node
On the second node, stopped:
sh
waap ha join -data-dir /var/lib/waap -node-id waap-b -listen 10.0.0.2:9444 -address 10.0.0.2:9444,192.168.50.2:9444 TOKENAdd -replace if the node has a database to move aside. Start the node with the same -data-dir and -node-id. It starts as the standby.
Check the pair
text
1. Open System > High availability.
2. Check that both nodes show a role, healthy, and In sync.sh
waap ha statuswaap ha status shows the roles, the term, the peer and each link, the peer's last heartbeat (software and configuration version), and whether the nodes are in sync.
Replace a failed node
On the surviving node, create a new token, then join the new node with the same node ID.
text
1. On the active node, open System > High availability.
2. Select Create join token and copy the token.sh
waap ha tokenThen run waap ha join ... on the new node with the same -node-id.
Leave a pair
sh
waap ha leaveThe node becomes standalone and keeps its data. Its pair settings move to DATA-DIR/ha.left-TIME.
Settings reference
waap ha init
| Flag | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
-listen | Peer link listener on this node. | none (required) | host:port | running node |
-address | Where the other node reaches this one, one per network path. | none (required) | up to 4 host:port, comma-separated | running node |
waap ha join
| Flag | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
TOKEN | The join token. | none (required) | token | stopped node |
-data-dir | This node's data directory. | data | path | stopped node |
-node-id | This node's ID. Run it with the same -node-id. | the host's default | node ID | stopped node |
-listen | Peer link listener. | none (required) | host:port | stopped node |
-address | Where the other node reaches this one. | none (required) | host:port, comma-separated | stopped node |
-replace | Moves an existing database aside instead of refusing. | off | flag | stopped node |
Limits
| Limit | Value |
|---|---|
| Nodes in a pair | 2 |
| Peer addresses per node | 4 |
| Join token | 1 hour, one use; failed joins limited to 10 a minute and audited |
| Peer link | mutual TLS 1.3, pair's own CA |
Troubleshooting
ha join refuses: the node has a database
- Cause: the node's data will come from the active node, so an existing database is not kept silently.
- Fix: add
-replace. The old database is moved aside aswaap.db.replaced-TIME.
The standby shows not in sync
- Cause: a difference in configuration, files, country database or replication position lasted more than 10 seconds.
- Check:
waap ha statuslists what differs. The audit log hasha.drift. - Fix: wait for catching up, update the country database on both nodes, or check the peer link.