[Kea-users] Using Kea with high-availability pgsql
Wilhelm Wijkander
lists at 0x5e.se
Mon Jun 2 13:20:22 UTC 2025
Hello :)
I'd like to store my host reservations(and leases/config) in a
high-availability pgsql setup, and I'd like to have Kea(2.7.8)
automatically fail over to a secondary server if the first one doesn't
respond. This should be supported in libpq and seems to be working in
Kea as well(though I'm not sure if it is deliberate as I can't see
this mentioned in the ARM?):
"hosts-database": {
"type": "postgresql",
"name": "kea",
"user": "kea",
"password": "kea",
"host": "3fff::1,3fff::2",
"port": 5432
}
However - I'd like to pass the parameter
"target_session_attrs=read-write" in order to make sure that only the
current r/w primary pgsql server is used, and that r/o secondaries are
not considered. I try passing '"host": "3fff::1,3fff::2
target_session_attrs=read-write"' in the hosts-database stanza but get
a cryptic error:
Jun 02 13:02:29 dhcp-server kea-dhcp4[635085]: INFO PGSQL_HB_DB
opening PostgreSQL hosts database: host='3fff::1,3fff::2 name=kea
password=***** port=5432 target_session_attrs=read-write'
type=postgresql universe=4 user=kea
Jun 02 13:02:29 dhcp-server kea-dhcp4[635085]: ERROR
DHCP4_CONFIG_LOAD_FAIL configuration error using file:
/etc/kea/kea-dhcp4.conf, reason: Unable to open database: missing "="
after "3fff::1,3fff::2'" in connection info string
Thankful for any help,
Wilhelm
More information about the Kea-users
mailing list