Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kY38S-0001SQ-A0 for pgsql-admin@arkaria.postgresql.org; Thu, 29 Oct 2020 08:18:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kY38R-0006S4-9y for pgsql-admin@arkaria.postgresql.org; Thu, 29 Oct 2020 08:18:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kY38Q-0006Rv-Uy for pgsql-admin@lists.postgresql.org; Thu, 29 Oct 2020 08:18:15 +0000 Received: from cpdelvb-safe102.kpnxchange.com ([195.121.3.36]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kY38N-0002cU-Vd for pgsql-admin@lists.postgresql.org; Thu, 29 Oct 2020 08:18:14 +0000 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_36b20ed42da4410d9ddd1b1bd0140d41kpncom_" DKIM-Signature: v=1; a=rsa-sha256; d=kpn.com; s=safemail01; c=relaxed/relaxed; t=1603959490; h=mime-version:date:message-id:subject:from:to:content-type; bh=HViFL47/h9JGWn4gjSPkEMuY7QUV75mDGN+FEGHZ9LE=; b=omrNIAIOZ05xMOxIZP9BTkgxyjqp9QUmmTF1yr3anro8GhH03ToVe5aTlQsNboANMLEOSg5KZ1S +u/dJtKXM2Kays5cj7BR1fKSlPQ+3f2RZDqcWFp4cGR2E8HOndIT3nlPzjeBMBx15UlJpsVwnxMUd t+9DnWsCp9nXobw+oAA= Received: from CPSUBM-SAFE105.kpnxchange.com ([10.94.186.34]) by cpdelvb-safe102.kpnxchange.com with Microsoft SMTPSVC(8.5.9600.16384); Thu, 29 Oct 2020 09:18:10 +0100 X-KPNSenderID: 4294967167 Received: from CPEMS-KPN107.KPNCNL.LOCAL ([195.121.122.236]) by CPSUBM-SAFE105.kpnxchange.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384); Thu, 29 Oct 2020 09:18:10 +0100 Received: from CPEMS-KPN04.KPNCNL.LOCAL (192.168.99.143) by CPEMS-KPN107.KPNCNL.LOCAL (192.168.100.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Thu, 29 Oct 2020 09:18:09 +0100 Received: from CPEMS-KPN04.KPNCNL.LOCAL ([fe80::fdd3:71c2:6cc7:f0ec]) by CPEMS-KPN04.KPNCNL.LOCAL ([fe80::fdd3:71c2:6cc7:f0ec%7]) with mapi id 15.01.2044.007; Thu, 29 Oct 2020 09:18:09 +0100 From: To: , Subject: TCP/IP connections refused Thread-Topic: TCP/IP connections refused Thread-Index: Adaty+lYJVfzxqHZSR2xY1WKkotFwQ== Date: Thu, 29 Oct 2020 08:18:09 +0000 Message-ID: <36b20ed42da4410d9ddd1b1bd0140d41@kpn.com> Accept-Language: nl-NL, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d2dc6f62-bb58-4b94-b6ca-9af54699d31b_Enabled=true; MSIP_Label_d2dc6f62-bb58-4b94-b6ca-9af54699d31b_SetDate=2020-10-29T08:18:08Z; MSIP_Label_d2dc6f62-bb58-4b94-b6ca-9af54699d31b_Method=Standard; MSIP_Label_d2dc6f62-bb58-4b94-b6ca-9af54699d31b_Name=d2dc6f62-bb58-4b94-b6ca-9af54699d31b; MSIP_Label_d2dc6f62-bb58-4b94-b6ca-9af54699d31b_SiteId=d7790549-8c35-40ea-ad75-954ac3e86be8; MSIP_Label_d2dc6f62-bb58-4b94-b6ca-9af54699d31b_ActionId=185b3376-4064-443b-b567-1d233aea2abd; MSIP_Label_d2dc6f62-bb58-4b94-b6ca-9af54699d31b_ContentBits=0 x-originating-ip: [192.168.100.196] MIME-Version: 1.0 X-OriginalArrivalTime: 29 Oct 2020 08:18:10.0050 (UTC) FILETIME=[09A12E20:01D6ADCC] X-RcptDomain: lists.postgresql.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_36b20ed42da4410d9ddd1b1bd0140d41kpncom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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. Chec= k that the hostname and port are correct and that the postmaster is accepti= ng 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 Pos= tgres instance. 3. The listen_addresses=3D'*' is set to. 4. $ lsof -n -u postgres |grep LISTEN postgres 26802 postgres 3u IPv4 19104770 0t0 T= CP *:postgresql (LISTEN) postgres 26802 postgres 4u IPv6 19104771 0t0 T= CP *: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 2680= 2/postgres tcp6 0 0 :::5432 :::* LISTEN = 26802/postgres 1. $ cat /etc/postgresql/12/main/postgresql.conf | grep port port =3D 5432 # (change requires restart) #ssl_passphrase_command_supports_reload =3D off Thanks --_000_36b20ed42da4410d9ddd1b1bd0140d41kpncom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Experts,

 

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

 

org.= postgresql.util.PSQLException: Connection to XXXXXXX:5432 refused. Check th= at 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 inbou= nd traffic.
  2. Added applicat= ion IP ranges in pg_hba.conf file and restarted the Postgres instance.
  3. The listen_addresses=3D’*’ is set to.
  4. =
  5. $ lsof -n -u postgres |grep LISTEN=

postgres 26802 postgres&= nbsp;   3u     IPv4    &n= bsp;      19104770     &n= bsp;  0t0      TCP *:postgresql (LISTEN)=

postgres 26802 postgres&= nbsp;   4u     IPv6    &n= bsp;      19104771     &n= bsp;  0t0      TCP *:postgresql (LISTEN)=

  1. $ netstat -ltnp | grep postgres

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

will not be shown, you w= ould have to be root to see it all.)

tcp   &nb= sp;    0      0 0.0.0.0:5432 &= nbsp;          0.0.0.0:* =      LISTEN      26802/postgre= s

tcp6   &n= bsp;   0      0 :::5432   = ;             &= nbsp;:::*           =          LISTEN   &n= bsp;  26802/postgres

 =

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

port =3D 5432  = ;            &n= bsp;            = ;  # (change requires restart)

#ssl_passphrase_command_= supports_reload =3D off

 =

 =

Thanks

 =

--_000_36b20ed42da4410d9ddd1b1bd0140d41kpncom_--