Re: could not connect to server: Connection refused (0x0000274D/10061) - Mailing list pgsql-admin

From Greg Smith
Subject Re: could not connect to server: Connection refused (0x0000274D/10061)
Date
Msg-id 4CA51F6D.7020609@2ndquadrant.com
Whole thread Raw
In response to could not connect to server: Connection refused (0x0000274D/10061)  (Anuj Pankaj <anujp@cybage.com>)
List pgsql-admin
Anuj Pankaj wrote:

I installed Postgres 8.1.4 on Linux and postgres server is running and I successfully created database on local machine.

I modified listen_addresses = '*' in Postgresql.conf and however If I try to access postgres through pgAdmin III. I am sticking with an exception.

 

Exception is:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "192.168.9.126" and accepting TCP/IP connections on port 5432?


My guess is that you have the iptables firewall running on this server, and it doesn't allow remote users to connect to port 5432 on this server.  This is usually the case in a default RedHat/CentOS Linux system for example.  On that distribution, if you run system-config-securitylevel as root you'll get to a text interface to change settings around.  Go into the "Customize" section, and add "postgres:tcp" to the "Other ports" section.  Running "service iptables restart" afterwards will make the change active.

On other distributions, you can usually confirm whether this is the problem by running (again as root) "iptables -L".  If you see any "(policy REJECT)" in there, and there isn't also a reference to the postgres port on the list of what is accepted, you'll need to find the firewall reconfiguration tool.

It is possible there's a firewall somewhere else between the server and your system causing the problem instead, but from the fact that you're using the 192.168.*.* block I'd assume your client and the server are on the same local LAN.

-- 
Greg Smith, 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services and Support  www.2ndQuadrant.us
Author, "PostgreSQL 9.0 High Performance"    Pre-ordering at:
https://www.packtpub.com/postgresql-9-0-high-performance/book

pgsql-admin by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: pg_dumpall blocking other sessions
Next
From: Tena Sakai
Date:
Subject: