I have a postgres docker cluster running in a docker swarm environment with an overlay network. everything looks fine until when I try accessing the created container from a remote host with this command psql -h -p -U .
I'm setting up the postgres initialization parameters using an environment variable file that looks like this
`# the name of the cluster
PATRONI_SCOPE=pg-test-cluster
# create an admin user on pg init
PATRONI_admin_OPTIONS=createdb, createrole
PATRONI_admin_PASSWORD=admin
# host and port of etcd service
PATRONI_ETCD_HOST=etcd:2379
# location of password file
PATRONI_POSTGRESQL_PGPASS=home/postgres/.pgpass
# address patroni will use to connect to local server
PATRONI_POSTGRESQL_LISTEN=0.0.0.0:5432
# replication user and password
PATRONI_REPLICATION_PASSWORD=abcd
PATRONI_REPLICATION_USERNAME=replicator
# address patroni used to receive incoming api calls
PATRONI_RESTAPI_LISTEN=0.0.0.0:8008
# api basic auth
PATRONI_RESTAPI_PASSWORD=admin
PATRONI_RESTAPI_USERNAME=admin
# patroni needs superuser adminstrate postgres
PATRONI_SUPERUSER_PASSWORD=postgres
PATRONI_SUPERUSER_USERNAME=postgres`
The error I get is
`psql: could not connect to server: Connection refused
Is the server running on host "10.66.112.29" and accepting
TCP/IP connections on port 5000?`
Im exposing port 5000 through patroni rest api for master DB.
Any ideas where I'm missing the point? thanks !