[Kea-users] Using Kea with high-availability pgsql
Wilhelm Wijkander
lists at 0x5e.se
Tue Jun 10 15:00:07 UTC 2025
Hey again Darren and sorry for a being a bit late in answering :)
Den ons 4 juni 2025 kl 18:21 skrev Darren Ankney <darren.ankney at gmail.com>:
> Currently, Kea does not support multiple database servers directly.
> This article may be of some use:
> https://kb.isc.org/docs/experimenting-with-postgresql-high-availability
That was a nice read - thanks!
The text mentions that "if the current db01 failed, then the config
above could be changed to connect to db02". This manual config change
in the event of an outage is exactly what I'd like to avoid - instead
pointing Kea to a list of pgsql servers to try in order.
And to an extent this is actually already possible like i mentioned,
although not documented in the ARM what I can see. Specifying two
pgsql servers separated by a comma in the hosts value in the dhcp4/6
configuration will cause Kea to try connecting to the first one, and
if that fails move on to the next one.
So far so good, but the issue is if you use streaming replication all
database servers except the current primary will be read-only. I
tested this by specifying two pgsql hosts as previously described, but
the first one set to read-only. With this setup Kea starts up and I
can do read-only operations, but when I for example try a
"reservation-add" command in the API I get a failure. It seems like
Kea does not check on startup that the database is actually
read-write(but the ARM claims that Kea will refuse to start in this
case, so maybe this is an error?).
Setting target_session_attrs to "read-write" in the underlying call to
libpq should alleviate this, I think? I might attempt to address this,
if I get the time.
All of the above applies to version 2.7.9.
Thanks for your time and help!
Wilhelm
More information about the Kea-users
mailing list