Postgresql giving connection timed out because of iptables
Hi,
In our development box we are configured postgresql to work with Jboss. The thing is we have firewall iptables in our linux box. when the iptables is stopped we can connect the postgres db locally using -h option, also we can connect thru a weblink we have created using Jboss. But when the iptables is started we can't connect the db locally using the -h option and the web is giving the below error.
Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openC onnectionImpl(ConnectionFactoryImpl.java:136)
at org.postgresql.core.ConnectionFactory.openConnecti on(ConnectionFactory.java:66)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init >(AbstractJdbc2Connection.java:125)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init >(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3C onnection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:3 93)
at org.postgresql.Driver.connect(Driver.java:267)
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getLocalManagedConnection(LocalM anagedConnectionFactory.java:207).
We have defined the postgres,Jboss ports plus all the ports in the start up error logs in the iptables still same issue persists. I have also attached the iptables and Jboss startup error logs which is because of the postgres db.
Your replies are highly welcome.
|