You can configure High Availability (HA) for Kea DHCP servers from within Micetro. However, you can also sync and configure your Kea DHCP servers in an HA environment to communicate with each other before you add them to Micetro. In this case, after setting up the HA environment, the configuration file is parsed and all HA relationships are detected when the primary server is added to Micetro. As a result, the relationships are successfully imported to Micetro, and replication between servers begins.
Here's an example of a hook-libraries section of the configuration
where Micetro will successfully detect the setup and act accordingly:
"hooks-libraries": [{
"library": "/usr/lib/kea/hooks/libdhcp_ha.so",
"parameters": {
"high-availability": [{
"this-server-name": "server1",
"mode": "load-balancing",
"heartbeat-delay": 1000,
"max-response-delay": 10000,
"max-ack-delay": 5000,
"max-unacked-clients": 0,
"peers": [{
"name": "server1",
"url": "http://192.168.56.33:8000/",
"role": "primary",
"auto-failover": true
}, {
"name": "server2",
"url": "http://192.168.56.66:8000/",
"role": "secondary",
"auto-failover": true
}, {
"name": "server3",
"url": "http://192.168.56.99:8000/",
"role": "backup",
"auto-failover": false
}]
}]
}
Additional information about parameters:
this-server-name (Server Tag)- This field must reflect the Kea DHCP server where the configuration file
resides.Note: When the primary server is added to Micetro,
this-server-namemust match the peer with"role: "primary"in thehigh-availabilitysection of the config.This setting is also available in Micetro via by editing the DHCP server configuration under the name Server tag. For more information, refer to Editing DHCP server configuration.
max-response-delay- This value should be greater than
heartbeat-delay, and is typically greater than the combined duration of multipleheartbeat-delayvalues. The default value is 60000 ms.When the server detects that communication is interrupted, it may transition to thepartner-downstate (whenmax-unacked-clientsis 0) or initiate the failure-detection procedure using the values of the two following parameters:- Setting
max-unacked-clientsto 0 ensures vigilant Kea servers that promptly change states if the connection between them is lost. - To allow some flexibility, change the
max-unacked-clientsvalue to a positive number, e.g., 5.
Warning: Ifmax-response-delayis configured incorrectly, the servers will not be able to consistently and efficiently detect downtime between one another, and Micetro won’t be able to ensure the correct replication and operations of the servers. - Setting
Configuring the DHCP Agent to adjust the HA setup
The preferences.cfg file can be used to fine-tune the Kea High
Availability setup within the DHCP Agent. Configure the following preference values
as needed:
keaReplicateConfig: If set to 0, Micetro will not replicate between Kea DHCP servers in a High Availability setup. The default value is 1. Example:<keaReplicateConfig value=”0”/>.keaControlAgentHost: Specifies the host to use when connecting to a control agent. The default value is127.0.0.1if the Kea Control Agent is running on the same machine; otherwise, it is the IP address of the server added to Micetro.keaControlAgentPort: Defines the port to use when connecting to the Kea Control Agent. The default value is8000.