pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Cannot connect to postgresql on port 5432
Date: Mon, 23 Dec 2019 13:39:13 -0600
Message-ID: <64689969-f920-cc61-479d-f1c2925d7ff2@gmail.com> (raw)
In-Reply-To: <2A91BEF8171A5349931391E0C721CC537D772EF8@CPEMS-KPN501.KPNCNL.LOCAL>
References: <2A91BEF8171A5349931391E0C721CC537D772EF8@CPEMS-KPN501.KPNCNL.LOCAL>


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.

view thread (8+ messages)  latest in thread

Message-ID: <64689969-f920-cc61-479d-f1c2925d7ff2@gmail.com>
Permalink:  ../64689969-f920-cc61-479d-f1c2925d7ff2@gmail.com/
Also on:    postgresql.org/message-id/64689969-f920-cc61-479d-f1c2925d7ff2@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Cannot connect to postgresql on port 5432
  In-Reply-To: <64689969-f920-cc61-479d-f1c2925d7ff2@gmail.com>
  References: <2A91BEF8171A5349931391E0C721CC537D772EF8@CPEMS-KPN501.KPNCNL.LOCAL> <64689969-f920-cc61-479d-f1c2925d7ff2@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox