If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > Postgres won't talk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-27-11, 15:03
blackfrancis blackfrancis is offline
Registered User
 
Join Date: Nov 2011
Posts: 3
Postgres won't talk

Hi All,

Hoping for help on this one. I have a new 9.1 Postgresql installation up and running on RHEL 6 (call it 'mypghost.net').

I've edited the pg_hba.conf to add:
host all all 0.0.0.0/0 trust

I've edited the postgresql.conf to add:
listen_addresses = '*'

The service was the restarted.

When I check the ports, I get:

root$ netstat -nlp | grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 13761/postmaster
tcp 0 0 :::5432 :::* LISTEN 13761/postmaster
unix 2 [ ACC ] STREAM LISTENING 58223 13761/postmaster /tmp/.s.PGSQL.5432

However, when I try to connect from it's sister server, like so:

$ psql -h mypghost.net -U postgres -d test
psql: could not connect to server: No route to host
Is the server running on host "mypghost.net " and accepting
TCP/IP connections on port 5432?

There are no firewalls in the picture. iptables is not running on either machine. mypghost.net resolves to the correct IP. In fact, I can ssh from one to the other just fine.

I've run out of ideas at this point, so very much hoping someone can enlighten me!

Thanks,
Ben

Last edited by blackfrancis; 11-27-11 at 15:07. Reason: To clarify
Reply With Quote
  #2 (permalink)  
Old 11-28-11, 20:02
blackfrancis blackfrancis is offline
Registered User
 
Join Date: Nov 2011
Posts: 3
Buggery

Sorry, it was iptables after all. I thought I had tested shutting it down entirely and connecting, but for some reason, when I repeated the experiment, it now works!
Reply With Quote
  #3 (permalink)  
Old 11-28-11, 20:19
blackfrancis blackfrancis is offline
Registered User
 
Join Date: Nov 2011
Posts: 3
A further note for anyone finding this - if you're using RHEL (as I am), use the 'setup' command to configure iptables. Following normal instructions for configuring it did not work to allow 5432 traffic.
Reply With Quote
  #4 (permalink)  
Old 12-07-11, 12:10
CarlosinFL CarlosinFL is offline
Registered User
 
Join Date: Oct 2010
Location: Orlando, FL
Posts: 184
Yes. RHEL always restricts with IPTables and SELinux. I use:

Code:
system-config-security-level-tui
This allows me to disable both SElinux & IPtables on new systems and make sure I don't spend hours searching configuration files for the problem. Once I have everything the way I like it, I enable it and test.
Reply With Quote
Reply

Tags
connection, postgresql9.1, remote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On