[Kea-users] kea configuration file limitations
Uwe Toenjes
toenjes at rz.uni-leipzig.de
Wed Jan 31 09:28:13 UTC 2024
Hello Darren,
many thanks for your help. With the code example I was able to solve the problem!
Best Regards
Uwe Toenjes
-----Ursprüngliche Nachricht-----
Von: Kea-users <kea-users-bounces at lists.isc.org> Im Auftrag von Darren Ankney
Gesendet: Dienstag, 30. Januar 2024 14:25
An: Kea user's list <kea-users at lists.isc.org>
Betreff: [Extern] Re: [Kea-users] kea configuration file limitations
Hi Uwe,
The trouble here is the end result should look something like this:
"high-availability": [{
where yours looks like this:
"high-availability": {
This is the difference between:
$array[]['high-availability']
and
$array['high-availability']
Have a look at my "Kea Quick Config" project that makes use of php and json output if you like. Maybe you might find something useful there:
https://gitlab.isc.org/isc-projects/kea-quick-config
Thank you,
Darren Ankney
On Tue, Jan 30, 2024 at 8:07 AM Uwe Toenjes <toenjes at rz.uni-leipzig.de> wrote:
>
> Hello everyone,
>
> We are currently migrating our isc dhcp server to the isc kea server.
>
> In our environment, a new configuration file is regularly created and
> reloaded. Unfortunately, the kea server has limitations in the json
> syntax of the configuration file. This makes it impossible to generate
> the configuration automatically.
>
> Here's an example. The configuration file is created using php and the
> function „json_encode($kea_Dhcp4, JSON_PRETTY_PRINT)“ generated. I
> just copy a section of the generated configuration. But the problem
> can be seen. PHP generates a correct json configuration. However, Kea
> rejects the configuration because it expects a list as syntax. In
> json, however, no list is required at this point. Therefore it is not
> possible to create a kea configuration automatically.
>
> Is there a reason for the limitation? Can this limitation be resolved
> by kea in a future version? Or is there another solution to the
> problem that I missed?
>
>
> => The "high-availability" section expects a list with one element. In
> this case, the json functions do not create a list.
> …..
> "hooks-libraries": [
> {
> "library": "\/usr\/lib64\/kea\/hooks\/libdhcp_lease_cmds.so"
> },
> {
> "library": "\/usr\/lib64\/kea\/hooks\/libdhcp_ha.so",
> "parameters": {
> "high-availability": {
> "this-server-name": "dhcpdup",
> "mode": "hot-standby",
> "heartbeat-delay": 5000,
> "max-response-delay": 35000,
> "multi-threading": {
> "enable-multi-threading": true
> },
> "peers": [
> {
> "name": "dhcpdup",
> "url": "http:\/\/172.26.20.2:8001\/",
> "role": "primary"
> },
> {
> "name": "dhcpdup2",
> "url": "http:\/\/172.26.20.3:8001\/",
> "role": "standby"
> }
> ]
> }
> }
> }
> ],
> …..
> 2024-01-30 13:55:46.111 INFO [kea-dhcp4.hooks/31597.140578571736960]
> HOOKS_LIBRARY_LOADED hooks library
> /usr/lib64/kea/hooks/libdhcp_lease_cmds.so successfully loaded
> 2024-01-30 13:55:46.111 ERROR
> [kea-dhcp4.ha-hooks/31597.140578571736960]
> HA_CONFIGURATION_FAILED failed to configure High Availability hooks library:
> HA configuration must be a list
> 2024-01-30 13:55:46.111 ERROR [kea-dhcp4.hooks/31597.140578571736960]
> HOOKS_LOAD_ERROR 'load' function in hook library
> /usr/lib64/kea/hooks/libdhcp_ha.so returned error 1
>
>
> Thank you for your efforts
>
> Regards
> Uwe
>
> --
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
--
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
Kea-users mailing list
Kea-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users
More information about the Kea-users
mailing list