Search Postgresql Archives

TCP only listening on localhost???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First weird problem...
The other day, out of the blue, our application reported an error saying it
could not connect to the postgres db.  The hostname that it reported is the
name of the machine but it hasn't been used in awhile.  However, it does
have a valid cname entry in dns pointing to the correct host.  I added the
name in the /etc/hosts file on the server and the problem was fixed.  

Next weird problem...
I recently upgraded a few nodes that connect to the server to Redhat 9.  I
installed all the necessary rpm's and when I tried to connect to the remote
server, I get the following error.

# psql -U postgres -d dbname -h server_name
psql: could not connect to server: Connection refused
        Is the server running on host server_name and accepting
        TCP/IP connections on port 5432?

Here is the output of netstat -ae | grep tcp | grep LIST

...
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN

tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN

...

As you can see, postgres is listening on localhost put not "0.0.0.0:5432" as
I see in many posts to this site.  This was working fine before but now I
cannot connect from any other server that I have given permission to in
pg_hba.conf.  
local   all         all                                             trust
host    all         all         127.0.0.1         255.255.255.255   trust
host    all         all         10.64.228.10      255.255.255.255   trust
host    all         all         10.64.228.112     255.255.255.255   trust
host    all         all         10.64.228.115     255.255.255.255   trust

And Yes I have the "-i" option specified in my postmaster command...
/usr/local/db/pgsql/bin/postmaster -i -c log_connections=on -h server_name
-D /usr/local/db/pgsql/data

and Yes I have tcpip_socket = true in postgresql.conf.

No, I do not have multiple installs of postgres on this system and I am sure
they are using the correct configuration files.

This was all working fine until I recently.  It has been a long time since I
have restarted the server (  5:05pm  up 377 days, 18:36,  7 users,  load
average: 0.00, 0.00, 0.00) and it has been a long time since I restarted the
postgres DB.  I wonder if some weirdness is happening which isn't allowing
postgres to bind to tcp port 5432.

>From the server...  This is connecting through the socket...
# psql -h server_name -U postgres -d dbname
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

dbname=# \q
>From the server...  This is trying to connect to the port...
# psql -h 10.64.228.10 -U postgres -d dbname      
psql: could not connect to server: Connection refused
        Is the server running on host 10.64.228.10 and accepting
        TCP/IP connections on port 5432?

Any ideas what could be happening?

Thanks

Richard
 

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux