Cannot connect to postgresql on port 5432
<[email protected]> Mon, 23 Dec 2019 19:30:16 +0000
| Newsgroups | gmane.comp.db.postgresql.admin |
|---|---|
| Message-ID | <2A91BEF8171A5349931391E0C721CC537D772EF8@CPEMS-KPN501.KPNCNL.LOCAL> |
--_000_2A91BEF8171A5349931391E0C721CC537D772EF8CPEMSKPN501KPNC_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi Experts,
Post installation of PostgreSQL it is not listening on an IP, only on loca=
lhost.
Please suggest your inputs.
Used below command for installations -
# apt-get install postgresql-12
postgres=3D# 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
--_000_2A91BEF8171A5349931391E0C721CC537D772EF8CPEMSKPN501KPNC_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:m=3D"http://schema=
s.microsoft.com/office/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html=
40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"NL" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi Experts,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Post installation of PostgreSQL it is not list=
ening on an IP, only on localhost.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Please suggest your inputs.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:11.5pt;font-=
family:"Arial",sans-serif;color:#1D1C1D;background:#F8F8F8"><o:p>=
</o:p></span></p>
<p class=3D"MsoNormal"><b><u><span lang=3D"EN-GB">Used below command for in=
stallations –<o:p></o:p></span></u></b></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><b><span lang=3D"EN-GB"># apt-get install postgresql=
-12<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">postgres=3D# select version();<=
o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"> &=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p; version<o:p></o:p>=
</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">-------------------------------=
---------------------------------------------------------------------------=
--------<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">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<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">(1 row)<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><b><u><span lang=3D"EN-GB">Entries in ::: /etc/postg=
resql/12/main/pg_hba.conf
<o:p></o:p></span></u></b></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"># Database administrative login=
by Unix domain socket<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">local all &nbs=
p; postgres&nbs=
p; &=
nbsp; &nbs=
p; peer<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"># TYPE DATABASE &nbs=
p; USER &n=
bsp; ADDRESS &nb=
sp; METHOD<o:p></o:p>=
</span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"># "local" is for Unix=
domain socket connections only<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">local all &nbs=
p; all &nb=
sp; =
&n=
bsp; peer<o:p></o:p></=
span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"># IPv4 local connections:<o:p><=
/o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">host all =
; all&nbs=
p; 127.0.=
0.1/32 md=
5<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"># IPv6 local connections:<o:p><=
/o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">host all =
; all&nbs=
p; ::1/12=
8 &n=
bsp; md5<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"># Allow replication connections=
from localhost, by a user with the<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"># replication privilege.<o:p></=
o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">local replication&n=
bsp; all &=
nbsp; &nbs=
p; &=
nbsp; peer<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">host replicat=
ion all &n=
bsp; 127.0.0.1/32 &nbs=
p; md5<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">host replicat=
ion all &n=
bsp; ::1/128 &nb=
sp; md5<o:p></o:p></s=
pan></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><b><u><span lang=3D"EN-GB">Not connected<o:p></o:p><=
/span></u></b></p>
<p class=3D"MsoNormal"><b><u><span lang=3D"EN-GB"><o:p><span style=3D"text-=
decoration:none"> </span></o:p></span></u></b></p>
<p class=3D"MsoNormal"><b>postgres@srv:/opt$ netstat -nlp | grep 5432<o:p><=
/o:p></b></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">(Not all processes could be ide=
ntified, non-owned process info<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">will not be shown, you would ha=
ve to be root to see it all.)<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">tcp &nbs=
p; 0 0 127.0.0.1:5432 =
0.0.0.0:*  =
; LISTEN &=
nbsp; 25857/postgres<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">unix 2 &=
nbsp; [ ACC ] STREAM =
LISTENING 74234 25857/postgres&nb=
sp; /var/run/postgresql/.s.PGSQL.5432<o:p></o=
:p></span></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><b><span lang=3D"EN-GB">postgres@srv:~$ telnet 10.13=
3.214.32 5432<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">Trying 10.133.214.32...<o:p></o=
:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">telnet: Unable to connect to re=
mote host: Connection refused<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>
--_000_2A91BEF8171A5349931391E0C721CC537D772EF8CPEMSKPN501KPNC_--