I am using GeoNode with connection to Geoserver through Docker.(from here: https://github.com/GeoNode/geonode).

I am now trying to connect to a PostGIS database. I have indicated the host ip address on docker network, using the "ip addr show" in Terminal. The port stays same: 5432.

When trying to connect I get the error message: "Error creating data store, check the parameters. Error message: Unable to obtain connection: Cannot create PoolableConnectionFactory (Connection to refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.)".

What could be the solution?

  • did you update the pg_hba.conf file to make sure postmaster is accepting remote connections? updated pg_conf to set listen to *? Can you connect using psql from the geoserver machine to the postgis one? – Ian Turton Jul 23 at 13:45
  • yes I edited pg_hba.conf file, like its written here: docs.geonode.org/en/2.8/tutorials/install_and_admin/… I don't understand the last question. Would be nicer to see visually how it should look like. (e.g. screenshot). – Set Jul 23 at 14:48
  • 1
    psql is a command line tool for talking to remote (and local) postgres/postgis servers - you'd log on and type something like psql -U username -h -p 5432 if it says it can't connect then you have a postgis problem if it can connect then you have a geoserver problem – Ian Turton Jul 23 at 15:43
  • 1
    don't forget to open the firewall to allow connections on this port – JGH Jul 23 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.