Re:

From: Santiago DIEZ <santiago(dot)diez(at)caoba(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL LIST <pgsql-admin(at)postgresql(dot)org>
Subject: Re:
Date: 2017-03-22 08:53:26
Message-ID: CAJh8RqX9XDVULNafXQVe9E-zd3OpE0jKr=O2FdccKzdF=-v_eA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

Actually, port 5421 is open for localhost but not on eth0. What puzzles me
is why psql is resolving localhost to 192.168.1.103 when nc is rightfully
resolving it to 127.0.0.1:

$ nc -vz localhost 5421
localhost [127.0.0.1] 5421 (?) open

$ nc -vnz 192.168.1.103 5421
(UNKNOWN) [192.168.1.103] 5421 (?) : Connection refused

$ psql --host localhost --port 5421
psql: could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5421?
FATAL: no pg_hba.conf entry for host "192.168.1.103", user "santiago",
database "santiago"

$ psql --host 127.0.0.1 --port 5421
psql: FATAL: no pg_hba.conf entry for host "192.168.1.103", user
"santiago", database "santiago"

-------------------------
*Santiago DIEZ*
*Quark Systems & CAOBA*

*23 rue du Buisson Saint-Louis, 75010 Paris*-------------------------

On Wed, Mar 22, 2017 at 9:28 AM, Santiago DIEZ <santiago(dot)diez(at)caoba(dot)fr>
wrote:

> Hi Tom,
>
> Thanks for your advice. I'm indeed only able to connect to the cluster
> from outside the chroot using unix sockets like:
> $ psql --host /jail/tmp --port 5421 mydb
>
> If I try and force a TCP/IP connexion, it fails with:
> $ psql --host localhost --port 5421 mydb
> psql: could not connect to server: Connection refused
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5421?
> FATAL: no pg_hba.conf entry for host "192.168.1.103", user "santiago",
> database "santiago"
>
> I have mounted /dev, /proc and /sys inside the chroot. What else could be
> necessary to allow TCP/IP connections to postgresql?
>
> Regards
> -------------------------
> *Santiago DIEZ*
> *+33 6 37 90 81 98*
> -------------------------
>
> <http://www.google.com/url?q=http%3A%2F%2Fsantiago.news.free.fr%2Flogo.png&sa=D&sntz=1&usg=AFrqEzfmW2Io3OI5IqEGiVeDRebZgD4TaQ>
> -------------------------
> *Quark Systems & CAOBA*
>
> *23 rue du Buisson Saint-Louis, 75010 Paris*-------------------------
>
> On Wed, Mar 22, 2017 at 4:23 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> Santiago DIEZ <santiago(dot)diez(at)caoba(dot)fr> writes:
>> > I'm trying to execute postgresql inside a chroot environment.
>> > initdb runs OK
>> > pg_ctl runs OK and server can be queried.
>>
>> > But, the logs show :
>> > 2017-03-21 22:34:03 CET LOG: could not receive test message on socket
>> for
>> > statistics collector: Connection refused
>> > 2017-03-21 22:34:03 CET LOG: disabling statistics collector for lack of
>> > working socket
>>
>> Apparently there's some aspect of your chroot setup that breaks TCP
>> connections to "localhost". You need to fix that ...
>>
>> regards, tom lane
>>
>
>

In response to

  • Re: at 2017-03-22 08:28:25 from Santiago DIEZ

Responses

  • Re: at 2017-03-22 13:15:49 from Tom Lane

Browse pgsql-admin by date

  From Date Subject
Next Message ramonpadilla1 2017-03-22 09:21:36 pg_dump ERROR: missing chunk number 0 for toast value
Previous Message Santiago DIEZ 2017-03-22 08:28:25 Re: