2

We have issues connecting to our PostgreSQL server. Sometimes nobody can connect, sometimes some can and some can't. We have no idea why.

The PostgreSQL server is on a virtual machine with 4GB of memory. We have 3 poeple who want to connect to that server. Could it be possible that number of connections are over the default max_connection?

Error message:

could not connect to server: Connection refused Is the server running on host "192.x.x.x" and accepting TCP/IP connections on port 5432?

  • 1
    Network problems, by the sounds. Show the exact text of the error message(s) you get please. – Craig Ringer Sep 18 '15 at 9:41
  • Network, firewall, ... Can you ping the DB host when the connection is unsuccessful (and can you when it succeeds)? – dezso Sep 18 '15 at 9:59
  • This error is not due to too many connections, it's network problems like others have mentioned. – Sami Kuhmonen Sep 18 '15 at 12:24
  • Thank you all.Today the db is normal.I think it's really network problem as you said – user2492364 Sep 21 '15 at 4:54
0

This sounds to me like a network problem, restart the virtual machine and try again. The whole vm might be needing just a restart.

0

It sounds like you might have network issues, although withojt further details specifying the "sometimes" when your connection does work, it's hard to tell. It could be something like your server is not configured to listen on that specific network interface (check pg_hba.conf and make sure, like the manual entry in this link explains) or you might have some other piece of software interfering, such as a firewall. Maybe the times when the connection does work somehow trigger a different rule, which allows them to connect.

As other answers state, a reboot might be a good starting point, but if you haven't done anything weird regarding network config I doubt that will fix it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.