Configuring the Kea High Availability setup - User Guide - Micetro - 25.2.0

Micetro Admin Guide

ft:locale
en-US
Product name
Micetro
Version
25.2.0

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.

Note: If the Configuration Backend section is set and configured, Micetro will assume that the config is shared between all members and will not replicate the changes between servers.

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-name must match the peer with "role: "primary" in the high-availability section 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 multiple heartbeat-delay values. The default value is 60000 ms.
When the server detects that communication is interrupted, it may transition to the partner-down state (when max-unacked-clients is 0) or initiate the failure-detection procedure using the values of the two following parameters:
  • Setting max-unacked-clients to 0 ensures vigilant Kea servers that promptly change states if the connection between them is lost.
  • To allow some flexibility, change the max-unacked-clients value to a positive number, e.g., 5.
Warning: If max-response-delay is 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.

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 is 127.0.0.1 if 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 is 8000.