Thread: remote connection refused

remote connection refused

From
Yvon Thoraval
Date:
I'd like to have a checklist upon what to do, what to investigate, when an external connection is refused.

if i connect by :

psql -h localhost -p 5432 -U yt mydb

it works as usual

however even locally but using the LAN address :

psql -h 192.168.0.20 -p 5432 -U yt mydb

i got a :
psql: could not connect to server: Connexion refusée
    Is the server running on host "192.168.0.20" and accepting
    TCP/IP connections on port 5432?

obviously I've verified by ping the computer is reachable.

something i suspect :
$ lal /var/run/postgresql
total 12
drwxrwsr-x  2 postgres postgres 140 nov.  19 09:53 .
drwxr-xr-x 26 root     root     900 nov.  19 09:45 ..
-rw-------  1 postgres postgres   6 nov.  19 09:53 9.1-main.pid
-rw-r--r--  1 postgres postgres   4 nov.  19 07:10 pgbouncer.pid
srwxrwxrwx  1 postgres postgres   0 nov.  19 09:53 .s.PGSQL.5432
-rw-------  1 postgres postgres  71 nov.  19 09:53 .s.PGSQL.5432.lock
srwxrwxrwx  1 postgres postgres   0 nov.  19 07:10 .s.PGSQL.6432

this the locked file :
.s.PGSQL.5432.lock

is that normal or not ?

something to say, i had a brutal shutdown due to over heating of my laptop recently.

on the pg_hba.conf i do have a bunch of IPV6 addresses allowing connection then i don't think the prob comes from here, but nevermind...

in such  a situation what is your checklist in order to find what I've missed ?
--
Yvon


Re: remote connection refused

From
Martin French
Date:
Usually, after what you've already confirmed, it's likely to be one of the following:

- check "listen_address" is set correctly in postgresql.conf. (try "listen_address = *" and restart postgres)
- check port 5432 is open on iptables. (service iptables status, netstat -a | grep 5432)

Cheers




From:        Yvon Thoraval <yvon.thoraval@gmail.com>
To:        "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>,
Date:        19/11/2012 12:14
Subject:        [GENERAL] remote connection refused
Sent by:        pgsql-general-owner@postgresql.org




I'd like to have a checklist upon what to do, what to investigate, when an external connection is refused.

if i connect by :

psql -h localhost -p 5432 -U yt mydb

it works as usual

however even locally but using the LAN address :

psql -h 192.168.0.20 -p 5432 -U yt mydb

i got a :
psql: could not connect to server: Connexion refusée
    Is the server running on host "192.168.0.20" and accepting
    TCP/IP connections on port 5432?


obviously I've verified by ping the computer is reachable.

something i suspect :
$ lal /var/run/postgresql
total 12
drwxrwsr-x  2 postgres postgres 140 nov.  19 09:53 .
drwxr-xr-x 26 root     root     900 nov.  19 09:45 ..
-rw-------  1 postgres postgres   6 nov.  19 09:53 9.1-main.pid
-rw-r--r--  1 postgres postgres   4 nov.  19 07:10 pgbouncer.pid
srwxrwxrwx  1 postgres postgres   0 nov.  19 09:53 .s.PGSQL.5432
-rw-------  1 postgres postgres  71 nov.  19 09:53 .s.PGSQL.5432.lock
srwxrwxrwx  1 postgres postgres   0 nov.  19 07:10 .s.PGSQL.6432


this the locked file :
.s.PGSQL.5432.lock

is that normal or not ?

something to say, i had a brutal shutdown due to over heating of my laptop recently.

on the pg_hba.conf i do have a bunch of IPV6 addresses allowing connection then i don't think the prob comes from here, but nevermind...

in such  a situation what is your checklist in order to find what I've missed ?
--
Yvon



=============================================

Romax Technology Limited
Rutherford House
Nottingham Science & Technology Park
Nottingham,
NG7 2PZ
England

Telephone numbers:
+44 (0)115 951 88 00 (main)

For other office locations see:
http://www.romaxtech.com/Contact
=================================
===============
E-mail: info@romaxtech.com
Website:
www.romaxtech.com
=================================

================
Confidentiality Statement
This transmission is for the addressee only and contains information that is confidential and privileged.
Unless you are the named addressee, or authorised to receive it on behalf of the addressee
you may not copy or use it, or disclose it to anyone else.
If you have received this transmission in error please delete from your system and contact the sender. Thank you for your cooperation.
=================================================

Re: remote connection refused

From
Devrim GÜNDÜZ
Date:
Hi,

On Mon, 2012-11-19 at 13:08 +0100, Yvon Thoraval wrote:
> in such  a situation what is your checklist in order to find what I've
> missed ?

What is listen_addresses in postgresql.conf ? It should be * or so.
Also, I would make sure that there is not a firewall on the machine
itself.

Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Attachment

Re: remote connection refused

From
Yvon Thoraval
Date:
YES fine, thanks a lot !
it was left to default 'locahost'...


2012/11/19 Devrim GÜNDÜZ <devrim@gunduz.org>

Hi,

On Mon, 2012-11-19 at 13:08 +0100, Yvon Thoraval wrote:
> in such  a situation what is your checklist in order to find what I've
> missed ?

What is listen_addresses in postgresql.conf ? It should be * or so.
Also, I would make sure that there is not a firewall on the machine
itself.

Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz



--
Yvon