Re: TCP/IP connections refused - Mailing list pgsql-admin

From Siddharth Karandikar
Subject Re: TCP/IP connections refused
Date
Msg-id CAC6xauNWWj=fyrMtUCraZprjc62No32iECB-Bf2nE5kTaLh2Mg@mail.gmail.com
Whole thread Raw
In response to TCP/IP connections refused  (<soumik.bhattacharjee@kpn.com>)
Responses RE: TCP/IP connections refused  (<soumik.bhattacharjee@kpn.com>)
List pgsql-admin
Did you try connecting to it using `psql`? Do you get the same error with that?

On Thu, Oct 29, 2020 at 1:48 PM <soumik.bhattacharjee@kpn.com> wrote:

Hi Experts,

 

We are trying to connect from Java(Microservices) applications to Database and getting below issues :

 

org.postgresql.util.PSQLException: Connection to XXXXXXX:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

 

Please suggest your inputs and suggestions for solution.

 

The things I did :

 

  1. Firewall/Ports are open from DB server for inbound traffic.
  2. Added application IP ranges in pg_hba.conf file and restarted the Postgres instance.
  3. The listen_addresses=’*’ is set to.
  4. $ lsof -n -u postgres |grep LISTEN

postgres 26802 postgres    3u     IPv4           19104770        0t0      TCP *:postgresql (LISTEN)

postgres 26802 postgres    4u     IPv6           19104771        0t0      TCP *:postgresql (LISTEN)

  1. $ netstat -ltnp | grep postgres

(Not all processes could be identified, non-owned process info

will not be shown, you would have to be root to see it all.)

tcp        0      0 0.0.0.0:5432            0.0.0.0:*      LISTEN      26802/postgres

tcp6       0      0 :::5432                 :::*                    LISTEN      26802/postgres

 

  1. $ cat /etc/postgresql/12/main/postgresql.conf | grep port

port = 5432                             # (change requires restart)

#ssl_passphrase_command_supports_reload = off

 

 

Thanks

 

pgsql-admin by date:

Previous
From:
Date:
Subject: TCP/IP connections refused
Next
From: Sushant Pawar
Date:
Subject: Re: TCP/IP connections refused