Thread: Problem in Remote PostgreSQL connection.

Problem in Remote PostgreSQL connection.

From
"vasudeva"
Date:
Remote PostgreSQL connection.
   When I tried to connect to PostgreSQL DB from a remote system in another network , where a firewall is also installed, using JDBC driver
   I am getting an error 'NoRouteToHostException'.
  
   Scenario:
    Client for PostgreSQL(System-A):is also a webserver with apache,tomcat and postgresql installed on it. The Firewall (IPChains) is also installed on this system.
    My web application has to connect to a remote PostgreSQL in another network
   postgresql version on this system : 7.0.3
  
    Remote DB(System-B): is also a webserver where apache , tomcat , postgresql are installed . CLient has to get data from this DB.
   postgresql version on this system: 7.0.3  
  
   What I did :
   1.In firewall  entry on Sys-A, i have given permission for the Postgres port(5432) for Sys-B IP address ,both input and also output permissions.
   2.In pg_hba.conf on Sys-B , I have added the host entry for client IP address (Sys-A) and also the server IPaddress(Sys-B)
  
  I am using postgres JDBC driver in my web application to access DB. url " jdbc:postgresql://Sys-B IP/dbName"
 
  when i invoke my application I am getting the error as NoRouteToHostException.
 
  When I ran the same application from another system(Sys-C) which is in the same network as Sys-B (no firewall ), I am able to access DB, Without any entry in
  pg_hba.conf file on remote PostgreSQL (Sys-B) .

Re: Problem in Remote PostgreSQL connection.

From
"Thomas O'Dowd"
Date:
Before looking at it as a driver problem, try telneting to the port
on the machine from the machine you are trying to run it on. ie...

Sys-A$ telnet Sys-B 5432

If it can't connect, then it is a network problem, like the firewall
etc getting in your way.

No route to host though sounds like the System-A has no routing information
about how to get to System-B, never mind the getting to a port on it. You
may need to add a static route... It doesn't look like a pgsql problem
from here.

Tom.

On Fri, Jun 29, 2001 at 10:45:51AM +0900, vasudeva wrote:
> Remote PostgreSQL connection.
>    When I tried to connect to PostgreSQL DB from a remote system in another network , where a firewall is also
installed,using JDBC driver  
>    I am getting an error 'NoRouteToHostException'.
>
>    Scenario:
>     Client for PostgreSQL(System-A):is also a webserver with apache,tomcat and postgresql installed on it. The
Firewall(IPChains) is also installed on this system. 
>     My web application has to connect to a remote PostgreSQL in another network
>    postgresql version on this system : 7.0.3
>
>     Remote DB(System-B): is also a webserver where apache , tomcat , postgresql are installed . CLient has to get
datafrom this DB. 
>    postgresql version on this system: 7.0.3
>
>    What I did :
>    1.In firewall  entry on Sys-A, i have given permission for the Postgres port(5432) for Sys-B IP address ,both
inputand also output permissions. 
>    2.In pg_hba.conf on Sys-B , I have added the host entry for client IP address (Sys-A) and also the server
IPaddress(Sys-B)
>
>   I am using postgres JDBC driver in my web application to access DB. url " jdbc:postgresql://Sys-B IP/dbName"
>
>   when i invoke my application I am getting the error as NoRouteToHostException.
>
>   When I ran the same application from another system(Sys-C) which is in the same network as Sys-B (no firewall ), I
amable to access DB, Without any entry in 
>   pg_hba.conf file on remote PostgreSQL (Sys-B) .

--
Thomas O'Dowd. - Nooping - http://nooper.com
tom@nooper.com - Testing - http://nooper.co.jp/labs

Re: Problem in Remote PostgreSQL connection.

From
"vasudeva"
Date:
Hi Thomas

Thanx for the suggestion.

1. But I treid with telnet command as per your mail and getting same error
message (noroute to host).
2. Tried from two different networks (sys a 210.160.17.0 and sys c
211.123.135.0) without any firewall still i am getting same error message.

What could be the problem?

Thanx in advance
Vasudeva

c----- Original Message -----
From: "Thomas O'Dowd" <tom@nooper.com>
To: "vasudeva" <vasudeva.r@eximsoft.com>
Cc: <pgsql-jdbc@postgresql.org>
Sent: Friday, June 29, 2001 11:00 AM
Subject: Re: [JDBC] Problem in Remote PostgreSQL connection.


> Before looking at it as a driver problem, try telneting to the port
> on the machine from the machine you are trying to run it on. ie...
>
> Sys-A$ telnet Sys-B 5432
>
> If it can't connect, then it is a network problem, like the firewall
> etc getting in your way.
>
> No route to host though sounds like the System-A has no routing
information
> about how to get to System-B, never mind the getting to a port on it. You
> may need to add a static route... It doesn't look like a pgsql problem
> from here.
>
> Tom.
>
> On Fri, Jun 29, 2001 at 10:45:51AM +0900, vasudeva wrote:
> > Remote PostgreSQL connection.
> >    When I tried to connect to PostgreSQL DB from a remote system in
another network , where a firewall is also installed, using JDBC driver
> >    I am getting an error 'NoRouteToHostException'.
> >
> >    Scenario:
> >     Client for PostgreSQL(System-A):is also a webserver with
apache,tomcat and postgresql installed on it. The Firewall (IPChains) is
also installed on this system.
> >     My web application has to connect to a remote PostgreSQL in another
network
> >    postgresql version on this system : 7.0.3
> >
> >     Remote DB(System-B): is also a webserver where apache , tomcat ,
postgresql are installed . CLient has to get data from this DB.
> >    postgresql version on this system: 7.0.3
> >
> >    What I did :
> >    1.In firewall  entry on Sys-A, i have given permission for the
Postgres port(5432) for Sys-B IP address ,both input and also output
permissions.
> >    2.In pg_hba.conf on Sys-B , I have added the host entry for client IP
address (Sys-A) and also the server IPaddress(Sys-B)
> >
> >   I am using postgres JDBC driver in my web application to access DB.
url " jdbc:postgresql://Sys-B IP/dbName"
> >
> >   when i invoke my application I am getting the error as
NoRouteToHostException.
> >
> >   When I ran the same application from another system(Sys-C) which is in
the same network as Sys-B (no firewall ), I am able to access DB, Without
any entry in
> >   pg_hba.conf file on remote PostgreSQL (Sys-B) .
>
> --
> Thomas O'Dowd. - Nooping - http://nooper.com
> tom@nooper.com - Testing - http://nooper.co.jp/labs
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl


Re: Problem in Remote PostgreSQL connection.

From
"Thomas O'Dowd"
Date:
On Fri, Jun 29, 2001 at 03:13:42PM +0900, vasudeva wrote:
> Hi Thomas
>
> Thanx for the suggestion.
>
> 1. But I treid with telnet command as per your mail and getting same error
> message (noroute to host).
> 2. Tried from two different networks (sys a 210.160.17.0 and sys c
> 211.123.135.0) without any firewall still i am getting same error message.
>
> What could be the problem?

Ask your network guys... Basically for a host to be able to find another
host on a different network, it has to know how to get there. The usual
ways for this to happen are the gateway between the two networks advertises
the routes or you add a static route. I'm not going to get into the
details here as you're talking about firewalls and system security and
this stuff is best left to the professionals at your site who administer
it. You should also never describe your private network in a public
forum as you never know who's gathering the info. Ask your network guys,
I'm sure they'll have a quick answer for you.

Cheers,

Tom.
--
Thomas O'Dowd. - Nooping - http://nooper.com
tom@nooper.com - Testing - http://nooper.co.jp/labs