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.
For servers using HTTPS, meaning that they require TLS certificates, you must manually
edit the high-availability section of the configuration to specify the
locations of these certificates. This cannot be done in the Web Application. When Kea
client certificates are defined in the preferences.cfg file for the
DHCP Agent, they will also be used for the peer-to-peer configuration for any failover
relationships in which that server is a member.
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
}]
}]
}
Here's some additional information about the parameters:
this-server-name (Server Tag)- This field must reflect the Kea DHCP server where the configuration file
resides.Note: When the servers are 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 by editing the Server tag field in the DHCP server configuration. 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 by changing the value of themax-unacked-clientsparameter:- 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, such as 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”/>.keaTrustAnchor: Specifies a trust anchor to verify that Micetro can trust the Kea server. Also used for peer-to-peer communication. Use this preference to specify that you want to the client to validate the server's Control Agent, if applicable.- Add the
serverAuthEKU in the certificate to specifies that the key within the certificate is authorized to authenticate the Kea server to the client. - Set
cert-requiredto false, so that you don't need to configure the certificate within the DHCP Agent usingkeaClientCertificateandkeaClientKey.Note: If you leavecert-requiredin the defaulttruevalue, you will need to create client certificates and define them in the DHCP Agent preferences.cfg file.
- Add the
keaClientCertificate: Specifies the client certificate to authenticate Micetro with the Kea server. Also used for peer-to-peer communication.keaClientKey: Specifies the client key to authenticate Micetro with the Kea server. Also used for peer-to-peer communication.KeaAllowHTTP: Set to false to allow only HTTPS requests to Kea.