[Kea-users] Kea/docker/postgres configuration help

Toby Walsh walshtj at gmail.com
Sat Nov 11 12:56:14 UTC 2017


I have set up a Postgres Docker container with kea user and kea database
and all the schema applied (and some test host reservations) as per the
documentation.

I have set up a Kea Docker container and I'm linking in the Postgres
container, port 5432 and /var/run/postgresql and /var/lib/postgresql/data
are volume mapped.

Within the Kea container I can start up psql with "psql -U kea -d kea -W"
and see the full schema and my test entries.

>From outside the container I can start it up with:

docker run --rm -it --link postgresdb -v
/somedir/postgresql/data:/var/lib/postgresql/data -v
/somedir/run/postgresql:/var/run/postgresql -p 5432 -it kea:1.3.0 psql -U
kea -d kea -W

and it connects just fine and I can see everything applied. So I know the
postgres database is readable from within the kea container and it thinks
it's at localhost (per the linking).

Within the Kea container I cannot run kea-dhcp4. My kea.conf is fine. I
tested that. It's the database connection. It fails with:

"2017-11-11 12:45:59.324 ERROR [kea-dhcp4.dhcp4/15] DHCP4_CONFIG_LOAD_FAIL
configuration error using file: kea.conf, reason: Unable to open database:
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?

2017-11-11 12:45:59.324 ERROR [kea-dhcp4.dhcp4/15] DHCP4_INIT_FAIL failed
to initialize Kea server: configuration error using file 'kea.conf': Unable
to open database: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?"

This seems at odds with me being able to connect using psql. In my kea.conf
I am specifying "Dhcp4": { "hosts-database": { *"host" : ""*, ... }, ... } but
I don't believe I should have to specify a host address. psql certainly
doesn't think it's connecting remotely. Same problem from outside the
container, with:

docker run /* all the same settings as for psql */ kea-dhcp4 -c kea.conf

Same errors. Has anyone encountered this scenario before? Anyone got any
advice on how to proceed?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20171111/b21d1203/attachment.htm>


More information about the Kea-users mailing list