Re: Cannot connect to postgresql on port 5432
Pepe TD Vo <[email protected]> Mon, 23 Dec 2019 19:39:59 +0000 (UTC)
| Newsgroups | gmane.comp.db.postgresql.admin |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_1890678_2019893661.1577129999413
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
change=C2=A0md5 to trust and try to connect again
Bach-Nga
No one in this world is pure and perfect.=C2=A0 If you avoid people for the=
ir mistakes you will be alone. So judge less, love and forgive more.To call=
him a dog hardly seems to do him justice though in as much as he had four =
legs, a tail, and barked, I admit he was, to all outward appearances. But t=
o those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely =
rich *** Faithful talent *** Sharing success=20
On Monday, December 23, 2019, 02:30:35 PM EST, <soumik.bhattacharjee@kp=
n.com> wrote: =20
=20
<!--#yiv4373058981 _filtered {} _filtered {}#yiv4373058981 #yiv4373058981=
p.yiv4373058981MsoNormal, #yiv4373058981 li.yiv4373058981MsoNormal, #yiv43=
73058981 div.yiv4373058981MsoNormal {margin:0cm;margin-bottom:.0001pt;font-=
size:11.0pt;font-family:"Calibri", sans-serif;}#yiv4373058981 a:link, #yiv4=
373058981 span.yiv4373058981MsoHyperlink {color:#0563C1;text-decoration:und=
erline;}#yiv4373058981 a:visited, #yiv4373058981 span.yiv4373058981MsoHyper=
linkFollowed {color:#954F72;text-decoration:underline;}#yiv4373058981 span.=
yiv4373058981EmailStyle17 {font-family:"Calibri", sans-serif;color:windowte=
xt;}#yiv4373058981 .yiv4373058981MsoChpDefault {font-family:"Calibri", sans=
-serif;} _filtered {}#yiv4373058981 div.yiv4373058981WordSection1 {}-->
Hi Experts,
=20
=C2=A0
=20
Post installation of =C2=A0PostgreSQL it is not listening on an IP, only on=
localhost.
=20
=C2=A0
=20
Please suggest your inputs.
=20
=C2=A0
=20
=C2=A0
=20
Used below command for installations =E2=80=93
=20
=C2=A0
=20
# apt-get install postgresql-12
=20
postgres=3D# select version();
=20
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 version
=20
---------------------------------------------------------------------------=
---------------------------------------
=20
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
=20
(1 row)
=20
=C2=A0
=20
Entries in ::: /etc/postgresql/12/main/pg_hba.conf
=20
# Database administrative login by Unix domain socket
=20
local=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 postgres=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 peer
=20
# TYPE=C2=A0 DATABASE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 USER=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ADDRESS=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 METHOD
=20
# "local" is for Unix domain socket connections only
=20
local=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0peer
=20
# IPv4 local connections:
=20
host=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 127.0.0.1/32=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 md5
=20
# IPv6 local connections:
=20
host=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 ::1/128=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 md5
=20
# Allow replication connections from localhost, by a user with the
=20
# replication privilege.
=20
local=C2=A0=C2=A0 replication=C2=A0=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 peer
=20
host=C2=A0=C2=A0=C2=A0 replication=C2=A0=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 127.0.0.1/32=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 md5
=20
host=C2=A0=C2=A0=C2=A0 replication=C2=A0=C2=A0=C2=A0=C2=A0 all=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ::1/128=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 md5
=20
=C2=A0
=20
Not connected
=20
=C2=A0
=20
postgres@srv:/opt$ netstat -nlp | grep 5432
=20
(Not all processes could be identified, non-owned process info
=20
will not be shown, you would have to be root to see it all.)
=20
tcp=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 0 127.0.0.1:5432=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
0.0.0.0:*=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 LISTEN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 25857/postgres
=20
unix=C2=A0 2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [ ACC ]=C2=A0=C2=A0=C2=A0=C2=A0 =
STREAM=C2=A0=C2=A0=C2=A0=C2=A0 LISTENING=C2=A0=C2=A0=C2=A0=C2=A0 74234=C2=
=A0=C2=A0=C2=A0 25857/postgres=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /var/run=
/postgresql/.s.PGSQL.5432
=20
=C2=A0
=20
=C2=A0
=20
postgres@srv:~$ telnet 10.133.214.32 5432
=20
Trying 10.133.214.32...
=20
telnet: Unable to connect to remote host: Connection refused
=20
=C2=A0
=20
=C2=A0
=20
=C2=A0
=20
------=_Part_1890678_2019893661.1577129999413
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html><head></head><body><div class=3D"ydpb105e2f7yahoo-style-wrap" style=
=3D"font-family: verdana, helvetica, sans-serif; font-size: 16px;"><div><di=
v dir=3D"ltr" data-setdir=3D"false">change <span><span style=3D"font-f=
amily: Helvetica Neue, Helvetica, Arial, sans-serif;">md5 to trust and try =
to connect again</span></span></div><div><br></div><div class=3D"ydpb105e2f=
7signature"><div id=3D"ydpb105e2f7yui_3_13_0_rc_1_1_1381789421038_7868" cla=
ss=3D"ydpb105e2f7yiv3811552299ms__id13889"><font color=3D"#0000ff"><b><span=
class=3D"ydpb105e2f7yiv3811552299sg"><font color=3D"#8000ff" style=3D"back=
ground-color: inherit;"></font></span></b></font><div id=3D"ydpb105e2f7yui_=
3_13_0_rc_1_1_1381789421038_7874" class=3D"ydpb105e2f7yiv3811552299ms__id13=
893"><font id=3D"ydpb105e2f7yui_3_13_0_rc_1_1_1381789421038_7873" color=3D"=
#0000ff"><font color=3D"#8000ff"></font><span id=3D"ydpb105e2f7yui_3_13_0_r=
c_1_1_1381789421038_7871" class=3D"ydpb105e2f7yiv3811552299sg"><font id=3D"=
ydpb105e2f7yui_3_13_0_rc_1_1_1381789421038_7870" color=3D"#8000ff" style=3D=
"background-color: inherit;"><b id=3D"ydpb105e2f7yui_3_13_0_rc_1_16_1381789=
421038_18">Bach-Nga<br clear=3D"none"><br clear=3D"none"></b>No one in this=
world is pure and perfect. If you avoid people for their mistakes yo=
u will be alone. So judge less, love and forgive more.</font></span></font>=
</div><div id=3D"ydpb105e2f7yui_3_13_0_rc_1_1_1381789421038_7874" class=3D"=
ydpb105e2f7yiv3811552299ms__id13893"><font color=3D"#0000ff"><span class=3D=
"ydpb105e2f7yiv3811552299sg"><font color=3D"#8000ff" style=3D"background-co=
lor: inherit;">To call him a dog hardly seems to do him justice though in a=
s much as he had four legs, a tail, and barked, I admit he was, to all outw=
ard appearances. But to those who knew him well, he was a perfect gentleman=
(Hermione Gingold)</font></span></font></div><br clear=3D"none"><span styl=
e=3D"color:rgb(128, 0, 255);" id=3D"ydpb105e2f7yui_3_13_0_rc_1_1_1381789421=
038_7867">**Live simply **Love generously **Care deeply **Speak kindly.</sp=
an></div><div id=3D"ydpb105e2f7yui_3_13_0_rc_1_1_1381789421038_7866" class=
=3D"ydpb105e2f7yiv3811552299ms__id13894"><span id=3D"ydpb105e2f7yui_3_13_0_=
rc_1_1_1381789421038_7865" class=3D"ydpb105e2f7yiv3811552299sg"><font id=3D=
"ydpb105e2f7yui_3_13_0_rc_1_1_1381789421038_7864" color=3D"#8000ff" style=
=3D"background-color: inherit;">*** Genuinely rich *** Faithful talent *** =
Sharing success</font></span></div></div></div>
<div><br></div><div><br></div>
=20
</div><div id=3D"yahoo_quoted_7672811167" class=3D"yahoo_quoted">
<div style=3D"font-family:'Helvetica Neue', Helvetica, Arial, s=
ans-serif;font-size:13px;color:#26282a;">
=20
<div>
On Monday, December 23, 2019, 02:30:35 PM EST, <sou=
[email protected]> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id=3D"yiv4373058981">
=20
=20
<style><!--
#yiv4373058981 =20
_filtered {}
_filtered {}
#yiv4373058981 =20
#yiv4373058981 p.yiv4373058981MsoNormal, #yiv4373058981 li.yiv4373058981Mso=
Normal, #yiv4373058981 div.yiv4373058981MsoNormal
=09{margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri"=
, sans-serif;}
#yiv4373058981 a:link, #yiv4373058981 span.yiv4373058981MsoHyperlink
=09{color:#0563C1;text-decoration:underline;}
#yiv4373058981 a:visited, #yiv4373058981 span.yiv4373058981MsoHyperlinkFoll=
owed
=09{color:#954F72;text-decoration:underline;}
#yiv4373058981 span.yiv4373058981EmailStyle17
=09{font-family:"Calibri", sans-serif;color:windowtext;}
#yiv4373058981 .yiv4373058981MsoChpDefault
=09{font-family:"Calibri", sans-serif;}
_filtered {}
#yiv4373058981 div.yiv4373058981WordSection1
=09{}
--></style>
<div>
<div class=3D"yiv4373058981WordSection1">
<p class=3D"yiv4373058981MsoNormal">Hi Experts,</p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
<p class=3D"yiv4373058981MsoNormal">Post installation of PostgreSQL i=
t is not listening on an IP, only on localhost.</p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
<p class=3D"yiv4373058981MsoNormal">Please suggest your inputs.</p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB" style=3D"font-size=
:11.5pt;font-family:sans-serif;color:#1D1C1D;background:#F8F8F8;"> </=
span></p>=20
<p class=3D"yiv4373058981MsoNormal"><b><u><span lang=3D"EN-GB">Used below c=
ommand for installations =E2=80=93</span></u></b></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"> </span></p>=
=20
<p class=3D"yiv4373058981MsoNormal"><b><span lang=3D"EN-GB"># apt-get insta=
ll postgresql-12</span></b></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">postgres=3D# selec=
t version();</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"> =
&nb=
sp; =
&nb=
sp; versi=
on</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">------------------=
---------------------------------------------------------------------------=
---------------------</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">PostgreSQL 12.1 (D=
ebian 12.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3=
.0-6) 8.3.0, 64-bit</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">(1 row)</span></p>=
=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"> </span></p>=
=20
<p class=3D"yiv4373058981MsoNormal"><b><u><span lang=3D"EN-GB">Entries in :=
:: /etc/postgresql/12/main/pg_hba.conf
</span></u></b></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"># Database adminis=
trative login by Unix domain socket</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">local =
all =
postgres =
&nb=
sp; peer</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"># TYPE DATAB=
ASE USER &=
nbsp; ADDRESS &n=
bsp; METH=
OD</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"># "local" is for U=
nix domain socket connections only</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">local =
all =
all  =
; &=
nbsp; peer=
</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"># IPv4 local conne=
ctions:</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">host &n=
bsp; all &=
nbsp; all =
127.0.0.1/32 &n=
bsp; md5</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"># IPv6 local conne=
ctions:</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">host &n=
bsp; all &=
nbsp; all =
::1/128 &=
nbsp; md5</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"># Allow replicatio=
n connections from localhost, by a user with the</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"># replication priv=
ilege.</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">local =
replication all =
&nb=
sp; =
peer</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">host &n=
bsp; replication all &=
nbsp; 127.0.0.1/32 &nb=
sp; md5</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">host &n=
bsp; replication all &=
nbsp; ::1/128 &n=
bsp; md5<=
/span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB"> </span></p>=
=20
<p class=3D"yiv4373058981MsoNormal"><b><u><span lang=3D"EN-GB">Not connecte=
d</span></u></b></p>=20
<p class=3D"yiv4373058981MsoNormal"><b><u><span lang=3D"EN-GB"><span style=
=3D"text-decoration:none;"> </span></span></u></b></p>=20
<p class=3D"yiv4373058981MsoNormal"><b>postgres@srv:/opt$ netstat -nlp | gr=
ep 5432</b></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">(Not all processes=
could be identified, non-owned process info</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">will not be shown,=
you would have to be root to see it all.)</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">tcp &nb=
sp; 0 0 127.0.0.1:543=
2 0.0.0.0:* &nbs=
p; =
LISTEN 25857/postgres</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">unix 2 =
[ ACC ] STREAM =
LISTENING 74234 2585=
7/postgres /var/run/postgresql/.s.PGSQL=
.5432</span></p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
<p class=3D"yiv4373058981MsoNormal"><b><span lang=3D"EN-GB">postgres@srv:~$=
telnet 10.133.214.32 5432</span></b></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">Trying 10.133.214.=
32...</span></p>=20
<p class=3D"yiv4373058981MsoNormal"><span lang=3D"EN-GB">telnet: Unable to =
connect to remote host: Connection refused</span></p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
<p class=3D"yiv4373058981MsoNormal"> </p>=20
</div>
</div>
</div></div>
</div>
</div></body></html>
------=_Part_1890678_2019893661.1577129999413--