Re: FW: Can not always connect to postmaster. Sometimes get "Connection refused". - Mailing list pgsql-bugs

From Tom Lane
Subject Re: FW: Can not always connect to postmaster. Sometimes get "Connection refused".
Date
Msg-id 25811.1075522089@sss.pgh.pa.us
Whole thread Raw
In response to FW: Can not always connect to postmaster. Sometimes get "Connection refused".  ("Hamedany, Allen" <Allen.Hamedany@revivio.com>)
List pgsql-bugs
"Hamedany, Allen" <Allen.Hamedany@revivio.com> writes:
> Sometimes, after Postgres starts up, when the database clients try to
> access the db from the localhost, we get the following error:

> com.solarmetric.kodo.Runtime -
> com.solarmetric.kodo.runtime.FatalDataStoreException: Connection
> refused. Check that the hostname and port are correct and that the
> postmaster is accepting TCP/IP connections.

> Any ideas what's causing postmaster NOT to accept connections some of
> the time?

Nope, can't tell much from that message.  You should look in the
postmaster's log to see if it shows any messages at the time that a
connection fails like this.  (If you are sending the postmaster's stderr
to /dev/null, now would be a good time to stop doing that...)

If the postmaster doesn't log anything at all when this happens, my
conclusion would be that the connection is being rejected at the kernel
level (but why would that happen only intermittently??) or that you have
a network-level problem.  "Connection refused" sounds a bit like a
kernel-level issue, FWIW.  Another thing to ask about is whether there
are any firewall machines between your clients and your database.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Orion Henry
Date:
Subject: segfault in psql on x86_64
Next
From: Tom Lane
Date:
Subject: Re: signal 11