<div dir="ltr"><div>Hello,<br><br>We are experiencing issues with configuring a KEA cluster in high-availability mode with a GALERA Cluster database backend.<br><br>As we'd like to use the database cluster for managing leases synchronization :<br><ul><li>we configured KEA High Availability mode like this for disabling lease sync & update :</li></ul><font face="monospace" size="1">"high-availability": [<br>    {<br>        "this-server-name": "kea01",<br>        "mode": "load-balancing",<br>        "heartbeat-delay": 10000,<br>        "max-response-delay": 10000,<br>        "max-ack-delay": 5000,<br>        "max-unacked-clients": 5,<br>        "send-lease-updates": false,<br>        "sync-leases": false,<br>        "sync-page-limit": 10000,<br>        "sync-timeout": 30000,<br>        "multi-threading": {<br>            "enable-multi-threading": true,<br>            "http-dedicated-listener": true,<br>            "http-listener-threads": 0,<br>            "http-client-threads": 0<br>         },<br>        "peers": [<br>            {<br>                "name": "kea0&",<br>                "url": "<a href="http://1.2.3.4:8080/">http://1.2.3.4:8080/</a>",<br>                "role": "primary",<br>                "auto-failover": true<br>            },<br>            {<br>                "name": "kea04",<br>                "url": "<a href="http://5.6.7.8:8080/">http://5.6.7.8:8080/</a>",<br>                "role": "secondary",<br>                "auto-failover": true<br>            }<br>        ]<br>    }<br>]</font><br><ul><li>we configured the lease database like this for connecting to the database cluster :</li></ul></div><font face="monospace" size="1">"lease-database": {<br>    "type": "mysql",<br>    "name": "kea",<br>    "user": "KEA_USER",<br>    "password": "KEA_PASSWORD",<br>    "host": "1.1.1.1",<br>    "max-reconnect-tries" : 10,<br>    "reconnect-wait-time" : 30000<br>},</font><div><ul><li>we tried to connect to the database backend :</li><ul><li>through a VIP with load balancing</li><li>through HAPROXY with / without load balancing</li><li><br></li></ul></ul>When we start KEA service and the servers start, KEA logs show a lot of DATABASE_MYSQL_FATAL_ERROR messages like this : <br><br><font face="monospace" size="1">2025-01-07 16:18:42.483 ERROR [kea-dhcp4.database/4349.0x34cf8b308500] DATABASE_MYSQL_FATAL_ERROR Unrecoverable MySQL error occurred: unable to execute for <SELECT h.host_id, h.dhcp_identifier, h.dhcp_identifier_type, h.dhcp4_subnet_id, h.dhcp6_subnet_id, h.ipv4_address, h.hostname, h.dhcp4_client_classes, h.dhcp6_client_classes, h.user_context, h.dhcp4_next_server, h.dhcp4_server_hostname, h.dhcp4_boot_file_name, h.auth_key, o.option_id, o.code, o.value, o.formatted_value, <a href="http://o.space">o.space</a>, o.persistent, o.cancelled, o.user_context FROM hosts AS h LEFT JOIN dhcp4_options AS o ON h.host_id = o.host_id WHERE h.dhcp4_subnet_id = ? AND h.dhcp_identifier_type = ? AND h.dhcp_identifier = ? ORDER BY h.host_id, o.option_id>, reason: Server has gone away (error code: 2006).<br>2025-01-07 16:18:43.533 INFO  [kea-dhcp4.dhcp4/4349.0x34cf8aa12000] DHCP4_DB_RECONNECT_LOST_CONNECTION database connection lost.<br>2025-01-07 16:18:43.533 INFO  [kea-dhcp4.hosts/4349.0x34cf8aa12000] DHCPSRV_MYSQL_HOST_DB opening MySQL hosts database: host=10.194.50.12 max-reconnect-tries=10 name=prod_kea password=***** reconnect-wait-time=30000 type=mysql universe=4 user=keaCluster<br>2025-01-07 16:18:43.586 INFO  [kea-dhcp4.dhcp4/4349.0x34cf8aa12000] DHCP4_DB_RECONNECT_SUCCEEDED database connection recovered.</font><br><br>As we noticed that the database connection is frequently lost for no apparent reason we suspect that there is an issue with using persistent database connections through a VIP with load balancing (maybe related to multithreading also)</div><div><br>Has anyone successfully configured such a setup ? How ?<br>What do you suggest for avoiding this error message and configuring a high availability DHCP cluster with a high availability database cluster ? <br><br>Any feedback from the community will be appreciated !<br>Kind regards<br><br><br></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br><table width="320" cellspacing="0" cellpadding="0" style="font-size:12.8px;font-family:Times;margin:0px;padding:0px"><tbody><tr><td width="100" style="width:100px;padding:0px"><img src="cid:ii_15f531873412908f" alt="Inline-Bild 1" width="100" height="100"><br></td><td width="10" style="width:10px"> </td><td valign="top" style="padding:0px"><br><table cellspacing="0" cellpadding="0" style="padding:0px;margin:0px;font-family:"Lucida Grande",sans-serif;font-size:12px;color:rgb(176,176,176);border-collapse:collapse"><tbody><tr style="margin:0px;padding:0px"><td style="padding:0px;white-space:nowrap"><strong><a href="mailto:snauer@hotcity.lu" style="color:rgb(17,85,204);border:none" target="_blank"><span style="color:rgb(3,54,108)">Sébastien NAUER</span></a></strong><span style="color:rgb(224,224,224)">|</span> <span style="color:rgb(85,85,85)">Technical Manager</span></td></tr><tr style="margin:0px;padding:0px;color:rgb(176,164,155)"><td style="padding:0px;white-space:nowrap"><a href="http://goo.gl/maps/GqQcf" style="color:rgb(176,176,176);border:none" target="_blank">11, Avenue Guillaume <span style="color:rgb(224,224,224)">|</span> L-1651 Luxembourg</a></td></tr><tr style="margin:0px;padding:0px;color:rgb(176,164,155)"><td style="font-family:"Lucida Grande",sans-serif;padding:0px;white-space:nowrap"><a style="color:rgb(176,176,176)">Phone: <span style="color:rgb(192,192,192)">(+352)</span> 2663 2660 </a><span style="color:rgb(224,224,224)">|</span> <a style="color:rgb(176,176,176)">Fax: <span style="color:rgb(192,192,192)">(+352)</span> 2663 2665</a></td></tr><tr style="margin:0px;padding:0px;color:rgb(176,164,155)"><td style="font-family:"Lucida Grande",sans-serif;padding:0px;white-space:nowrap"><a href="https://www.facebook.com/hotcity.lu" style="color:rgb(192,192,192);border:none" target="_blank">Facebook</a> <span style="color:rgb(224,224,224)">|</span> <a href="https://twitter.com/hotcity_wifi" style="color:rgb(192,192,192);border:none" target="_blank">Twitter</a></td></tr></tbody></table></td></tr></tbody></table></div></div></div></div></div></div>