Thread: remote tcp connection problem PG 8.0.1
Hi Guys, I can't get working remote tcp connections on default port 5432. Environment is as follows OS: Fedora Core 3 DB: Postgresql 8.0.1 1) The listen_addresses is set to '*' in postgresql.conf 2) pg_hba.conf is edited with client host ip, (the one which tries to eastablish connection) Worked with 7.4.6 version, but there was tcpip_sockets directive and in the version 8.0.1 it replaced with 'listen_addresses' but it does not look like it works now. Any ideas are very much appreciated. Thank you all in advance. P.S. I have put this message into 'pgsql-odbc' first but not sure if I can get any luck there. =========== Best Regards, Michael Korotun
Michael Korotun wrote: > Hi Guys, > > I can't get working remote tcp connections on default port 5432. > Environment is as follows > > OS: Fedora Core 3 > DB: Postgresql 8.0.1 > > 1) The listen_addresses is set to '*' in postgresql.conf > 2) pg_hba.conf is edited with client host ip, (the one which tries to > eastablish connection) 1. Turn connection logging on in your postgresql.conf and restart postgresql. 2. From the database server, try "telnet localhost 5432" - it should connect (and display nothing). Type "A" and hit return twice - you should be disconnected. Check your logs and there should be a message about an invalid startup packet. 3. Do the same from your client, "telnet DB-SERVER-IP-ADDRESS 5432" and repeat the test. If step 3 works, then there's no problem with the server. If you can't connect at step 3 and PG doesn't log anything then you probably have a firewall in the way. -- Richard Huxton Archonet Ltd
i'm having the same problem running pg8.0.1 on redhat enterprise linux AS 3 (2.4.21-27.0.4.ELsmp). shutting off my firewall via 'service iptables stop' solves the problem... what needs to be modified in the iptables to allow remote pg connections? Richard Huxton wrote: > Michael Korotun wrote: > >> Hi Guys, >> >> I can't get working remote tcp connections on default port 5432. >> Environment is as follows >> >> OS: Fedora Core 3 >> DB: Postgresql 8.0.1 >> >> 1) The listen_addresses is set to '*' in postgresql.conf >> 2) pg_hba.conf is edited with client host ip, (the one which tries to >> eastablish connection) > > > 1. Turn connection logging on in your postgresql.conf and restart > postgresql. > 2. From the database server, try "telnet localhost 5432" - it should > connect (and display nothing). Type "A" and hit return twice - you > should be disconnected. Check your logs and there should be a message > about an invalid startup packet. > 3. Do the same from your client, "telnet DB-SERVER-IP-ADDRESS 5432" > and repeat the test. > > If step 3 works, then there's no problem with the server. If you can't > connect at step 3 and PG doesn't log anything then you probably have a > firewall in the way. > > -- > Richard Huxton > Archonet Ltd > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >
Aaron Steele wrote: > i'm having the same problem running pg8.0.1 on redhat enterprise linux > AS 3 (2.4.21-27.0.4.ELsmp). > > shutting off my firewall via 'service iptables stop' solves the > problem... what needs to be modified in the iptables to allow remote pg > connections? You will need to open port 5432 to TCP traffic (assuming you haven't changed the defaults). There's almost certainly a graphical firewall configuration tool for RH Enterprise. There are also a number of firewall projects that sit on top of the raw iptables system and make it easier to configure your firewall settings. HTH -- Richard Huxton Archonet Ltd