Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7453C1337B52 for ; Thu, 30 Sep 2010 20:38:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 42627-01 for ; Thu, 30 Sep 2010 23:38:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mail.postgresql.org (Postfix) with ESMTP id 15EEA1337B5D for ; Thu, 30 Sep 2010 20:38:24 -0300 (ADT) Received: from [192.168.1.6] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M4klp-1OpGNP2HAz-00ythV; Fri, 01 Oct 2010 01:38:23 +0200 Message-ID: <4CA51F6D.7020609@2ndquadrant.com> Date: Thu, 30 Sep 2010 19:38:21 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Anuj Pankaj CC: pgsql-admin@postgresql.org Subject: Re: could not connect to server: Connection refused (0x0000274D/10061) References: <2856B55CBB911B488D04E177EEF57D3311A1504D@ct-beexch-1-1.cybage.com> In-Reply-To: <2856B55CBB911B488D04E177EEF57D3311A1504D@ct-beexch-1-1.cybage.com> Content-Type: multipart/alternative; boundary="------------050501050602050709000707" X-Provags-ID: V02:K0:z7yNcUfZNxn77I3z7EN1WtF0VL2CY9ZxqtqvRr4GIfJ 25u0cTdR2hI64oj6lx8/trS+DFn6vO0To1KFKESO22gr9nj+6W kQvXdmzUbH4s8cn2BhFs94oSAhWXNjiw8oDe9IPzrfvYhiDoLX ka5SvPa99cWOb5+taftvCEDCLbFU5qwzuS3KsxAHhIgjobRXp7 dZ9nuA0oTNtcjTGDsixbBUb1Z59xXo23E3ZFz8LSg8= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201009/197 X-Sequence-Number: 35741 This is a multi-part message in MIME format. --------------050501050602050709000707 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------050501050602050709000707 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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
--------------050501050602050709000707--