Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijTY1-0004hj-Nr for pgsql-admin@arkaria.postgresql.org; Mon, 23 Dec 2019 19:39:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ijTXz-0005Nx-4B for pgsql-admin@arkaria.postgresql.org; Mon, 23 Dec 2019 19:39:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijTXy-0005Nq-Gk for pgsql-admin@lists.postgresql.org; Mon, 23 Dec 2019 19:39:18 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ijTXw-00044b-2q for pgsql-admin@lists.postgresql.org; Mon, 23 Dec 2019 19:39:17 +0000 Received: by mail-ot1-x343.google.com with SMTP id w21so15572140otj.7 for ; Mon, 23 Dec 2019 11:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=kMhecOwa2GWP0mQ/4Bs2n9PadjhDrOl2vxeqKunt+ks=; b=AXZJcmCz+5DtzMwtqG5KMlZlZMImGcschBTXDEI7DuYztNJ13ANww5DsaZJnSEWtuP eT15+9lgR51jtZV/85PhNikdwZWer14rAK07VzgNAKKxtPKMVmdKpSCixl3ne2yDhHHC AvyQZUmj2gtWRQRxkIPlBawZxpEfM8FPbNIKpyEK6mJY83AnwEFGZXNIzBeYJ6GJsvo6 EQxaYBc9AB367915nBa7mE6Qq2yohlIwi0IAf+1g6SIz3pI2VmVQAsj22qp88O3ZleBF CB5/7hAcPgNfV0udUMSl6lMPTeDOf9Lr6lAHYvtganYgCZvCRcuvAMe4p6lM2fY1ib7K ge0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=kMhecOwa2GWP0mQ/4Bs2n9PadjhDrOl2vxeqKunt+ks=; b=eJYPJ5GlPakTgK3cmOlIfFjLYbgUeuud7rwNYHnrqyjMPzJL6fcTP2Y4PiEtORZ+FT colbMMlUAbu3GOUkbs8W107rGLtsKLMjTVyg/1uf/KZ6/hE9XYLvLB5vR74qoD8YS45D HFLap0JmQ+HedaAMoeqxDlvDBoC/9EYwwWriSJACqF7lJz9SWZNroQF6rPjXLD3iAKtg j9GjjiUl1U00fKAv8ncrPk3/ZT6lZN7RWTG08NX+54ra5L0dPnDKwYkje/x7UtKEQr+1 SZVoXHOWdzcaJ8npS3Cp+vmVf5sqbGJJDqh5JkQwZa+bwzfYTce5jx9L1a5PqFqfoWp9 f7Qg== X-Gm-Message-State: APjAAAUamHE//5YCRk+JwsRO1fe1I2SV++JVCHdaL/BGye8+B9S+LZfl cEVIlLtI2rVa3AKfR2BYHzt6FGHNwN0= X-Google-Smtp-Source: APXvYqxow9d/hsIwrNo0yjFmaOusw44AaY59UPYC4LP2Mdl1IpSrmGr4uxoN81KNYkxXA9arIILyrA== X-Received: by 2002:a05:6830:1f94:: with SMTP id v20mr12902552otr.185.1577129954940; Mon, 23 Dec 2019 11:39:14 -0800 (PST) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id g19sm3170547otj.1.2019.12.23.11.39.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Dec 2019 11:39:14 -0800 (PST) Subject: Re: Cannot connect to postgresql on port 5432 To: pgsql-admin@lists.postgresql.org References: <2A91BEF8171A5349931391E0C721CC537D772EF8@CPEMS-KPN501.KPNCNL.LOCAL> From: Ron Message-ID: <64689969-f920-cc61-479d-f1c2925d7ff2@gmail.com> Date: Mon, 23 Dec 2019 13:39:13 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <2A91BEF8171A5349931391E0C721CC537D772EF8@CPEMS-KPN501.KPNCNL.LOCAL> Content-Type: multipart/alternative; boundary="------------AB79450428208A9B04DB2076" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------AB79450428208A9B04DB2076 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit What's the value of listen_addresses? postgres=# show listen_addresses;  listen_addresses ------------------  localhost (1 row) You probably need to edit postgresql.conf and change listen_addresses from 'localhost' to the IP addresses they need to listen to. And, of course, make sure the firewall allows bi-directional port 5432 between the relevant hosts. On 12/23/19 1:30 PM, soumik.bhattacharjee@kpn.com wrote: > > Hi Experts, > > Post installation of  PostgreSQL it is not listening on an IP, only on > localhost. > > Please suggest your inputs. > > *_Used below command for installations –_* > > *# apt-get install postgresql-12* > > postgres=# select version(); > > version > > ------------------------------------------------------------------------------------------------------------------ > > PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled > by gcc (Debian 8.3.0-6) 8.3.0, 64-bit > > (1 row) > > *_Entries in ::: /etc/postgresql/12/main/pg_hba.conf _* > > # Database administrative login by Unix domain socket > > local   all postgres                                peer > > # TYPE  DATABASE USER            ADDRESS                 METHOD > > # "local" is for Unix domain socket connections only > > local   all all                                     peer > > # IPv4 local connections: > > host    all all             127.0.0.1/32            md5 > > # IPv6 local connections: > > host    all all             ::1/128                 md5 > > # Allow replication connections from localhost, by a user with the > > # replication privilege. > > local   replication all                                     peer > > host    replication all             127.0.0.1/32            md5 > > host    replication all             ::1/128                 md5 > > *_Not connected_* > > *__* > > *postgres@srv:/opt$ netstat -nlp | grep 5432* > > (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 127.0.0.1:5432          0.0.0.0:*               LISTEN > 25857/postgres > > unix  2      [ ACC ] STREAM     LISTENING     74234    25857/postgres > /var/run/postgresql/.s.PGSQL.5432 > > *postgres@srv:~$ telnet 10.133.214.32 5432* > > Trying 10.133.214.32... > > telnet: Unable to connect to remote host: Connection refused > -- Angular momentum makes the world go 'round. --------------AB79450428208A9B04DB2076 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
What's the value of listen_addresses?

postgres=# show listen_addresses;
 listen_addresses
------------------
 localhost
(1 row)


You probably need to edit postgresql.conf and change listen_addresses from 'localhost' to the IP addresses they need to listen to.

And, of course, make sure the firewall allows bi-directional port 5432 between the relevant hosts.

On 12/23/19 1:30 PM, soumik.bhattacharjee@kpn.com wrote:

Hi Experts,

 

Post installation of  PostgreSQL it is not listening on an IP, only on localhost.

 

Please suggest your inputs.

 

 

Used below command for installations –

 

# apt-get install postgresql-12

postgres=# select version();

                                                     version

------------------------------------------------------------------------------------------------------------------

PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit

(1 row)

 

Entries in ::: /etc/postgresql/12/main/pg_hba.conf

# Database administrative login by Unix domain socket

local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only

local   all             all                                     peer

# IPv4 local connections:

host    all             all             127.0.0.1/32            md5

# IPv6 local connections:

host    all             all             ::1/128                 md5

# Allow replication connections from localhost, by a user with the

# replication privilege.

local   replication     all                                     peer

host    replication     all             127.0.0.1/32            md5

host    replication     all             ::1/128                 md5

 

Not connected

 

postgres@srv:/opt$ netstat -nlp | grep 5432

(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 127.0.0.1:5432          0.0.0.0:*               LISTEN      25857/postgres

unix  2      [ ACC ]     STREAM     LISTENING     74234    25857/postgres       /var/run/postgresql/.s.PGSQL.5432

 

 

postgres@srv:~$ telnet 10.133.214.32 5432

Trying 10.133.214.32...

telnet: Unable to connect to remote host: Connection refused

 

 

 


--
Angular momentum makes the world go 'round.
--------------AB79450428208A9B04DB2076--