From: Greg Smith <greg@2ndquadrant.com>
To: Anuj Pankaj <anujp@cybage.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: could not connect to server: Connection refused (0x0000274D/10061)
Date: Thu, 30 Sep 2010 19:38:21 -0400
Message-ID: <4CA51F6D.7020609@2ndquadrant.com> (raw)
In-Reply-To: <2856B55CBB911B488D04E177EEF57D3311A1504D@ct-beexch-1-1.cybage.com>
References: <2856B55CBB911B488D04E177EEF57D3311A1504D@ct-beexch-1-1.cybage.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: greg@2ndquadrant.com, anujp@cybage.com
Subject: Re: could not connect to server: Connection refused (0x0000274D/10061)
In-Reply-To: <4CA51F6D.7020609@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox