High-Availability options
Created: 2025-11-12 Wed 08:12
this-server-name parametermode parameter
"Dhcp4": {
"hooks-libraries": [{
"library": "/usr/lib/kea/hooks/libdhcp_lease_cmds.so", "parameters": { }
}, {
"library": "/usr/lib/kea/hooks/libdhcp_ha.so", "parameters": {
"high-availability": [{
"this-server-name": "server1",
"mode": "load-balancing",
"heartbeat-delay": 10000, "max-response-delay": 40000, "max-ack-delay": 5000,
"max-unacked-clients": 5,
"peers": [{
"name": "server1",
"url": "http://192.0.2.33:8000/",
"role": "primary", "auto-failover": true
}, {
"name": "server2",
"url": "http://192.0.2.66:8000/",
"role": "secondary", "auto-failover": true
}, {
"name": "server3",
"url": "http://192.0.2.99:8000/",
"role": "backup",
"basic-auth-user": "foo", "basic-auth-password": "bar",
"auto-failover": false
}]
}]
}
}],
[...]
"Dhcp4": {
"hooks-libraries": [{
"library": "/usr/lib/kea/hooks/libdhcp_lease_cmds.so", "parameters": { }
}, {
"library": "/usr/lib/kea/hooks/libdhcp_ha.so", "parameters": {
"high-availability": [{
"this-server-name": "server1",
"mode": "hot-standby",
"heartbeat-delay": 10000, "max-response-delay": 40000,
"max-ack-delay": 5000, "max-unacked-clients": 5,
"peers": [{
"name": "server1",
"url": "http://192.0.2.33:8000/",
"role": "primary", "auto-failover": true
}, {
"name": "server2",
"url": "http://192.0.2.66:8000/",
"role": "standby", "auto-failover": true
}, {
"name": "server3",
"url": "http://192.0.2.99:8000/",
"basic-auth-user": "foo", "basic-auth-password": "bar",
"role": "backup", "auto-failover": false
}]
}]
}
}],
[...]
ha-sync command triggers the server to sync the lease
database with the selected peer
{ "command": "ha-sync",
"service": [ "dhcp4 "],
"arguments": {
"server-name": "server2",
"max-period": 60
}
}
The command ha-heartbeat can be used to check the current state
of a Kea DHCP server HA node
{ "service": [ "dhcp4" ], "command": "ha-heartbeat" }
The returned JSON structure describes the current DHCP server state
{
"result": 0,
"text": "HA peer status returned.",
"arguments":
{
"state": "partner-down",
"date-time": "Thu, 07 Nov 2019 08:49:37 GMT"
}
}
status-get command, the administrator can request the
current HA configuration from a Kea DHCP server node
{
"result": 0,
"text": "",
"arguments": { "pid": 1234,
"uptime": 3024,
"reload": 1111,
"high-availability": [{
"ha-mode": "load-balancing",
"ha-servers": {
"local": {
"role": "primary",
"scopes": [ "server1" ],
"state": "load-balancing" },
"remote": {
"age": 10,
"in-touch": true,
"role": "secondary",
"last-scopes": [ "server2" ],
[...]
"analyzed-packets": 8 }
}}],
"multi-threading-enabled": true,
"thread-pool-size": 4,
"packet-queue-size": 64
}
}
ha-maintenance-start and ha-maintenance-cancel
commands can be use to bring a server in or out of maintenance
mode