Guest_imported
New member
- Jan 1, 1970
- 0
Hello,
Any help would be appreciated. I’ve identified the problem marked issue, and I’ve tried the solution, as well as other possible solutions I found by others with the similar issue, and nothing seams to work. I’m trying to connect to port 5432 on the datbase server. Is there anything else I should check or try? Looking for a life saver!!
####
ISSUE
psql: could not connect to server: Connection refused
Is the server running on host server.joe.com and accepting
TCP/IP connections on port 5432?
This is the generic "I couldn't find a server to talk to" failure. It looks like the above when TCP/IP communication is attempted. A common mistake is to forget the -i option to allow the postmaster to accept TCP/IP connections.
Alternatively, you'll get this when attempting Unix-socket communication to a local postmaster:
psql: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The last line is useful in verifying that the client is trying to connect where it is supposed to. If there is in fact no postmaster running there, the kernel error message will typically be either Connection refused or No such file or directory, as illustrated. (It is particularly important to realize that Connection refused in this context does not mean that the postmaster got your connection request and rejected it -- that case will produce a different message
Actual Error Message:
"Connection refused Is the postmaster running (with -i) at 'localhost' and accepting connections on TCP/IP port '5432'?"
####
POSSIBLE SOLUTION
The rpm distributed with RedHat 7.2 (postgresql-7.1.3-2) does not accept connections by default. Being entirely new to the postgresql world, I'm not sure if this is a bug or feature.
To fix edit /etc/rc.d/init.d/postgresql
Find the line which reads:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $Psu -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
You must add the -o [options] -i [accept connections] like so:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $Psu -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -o -i -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
Then issue a
/sbin/service postgresql restart
####
Thanks for your help, and taking the time to read the message..cheers.!
Any help would be appreciated. I’ve identified the problem marked issue, and I’ve tried the solution, as well as other possible solutions I found by others with the similar issue, and nothing seams to work. I’m trying to connect to port 5432 on the datbase server. Is there anything else I should check or try? Looking for a life saver!!
####
ISSUE
psql: could not connect to server: Connection refused
Is the server running on host server.joe.com and accepting
TCP/IP connections on port 5432?
This is the generic "I couldn't find a server to talk to" failure. It looks like the above when TCP/IP communication is attempted. A common mistake is to forget the -i option to allow the postmaster to accept TCP/IP connections.
Alternatively, you'll get this when attempting Unix-socket communication to a local postmaster:
psql: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The last line is useful in verifying that the client is trying to connect where it is supposed to. If there is in fact no postmaster running there, the kernel error message will typically be either Connection refused or No such file or directory, as illustrated. (It is particularly important to realize that Connection refused in this context does not mean that the postmaster got your connection request and rejected it -- that case will produce a different message
Actual Error Message:
"Connection refused Is the postmaster running (with -i) at 'localhost' and accepting connections on TCP/IP port '5432'?"
####
POSSIBLE SOLUTION
The rpm distributed with RedHat 7.2 (postgresql-7.1.3-2) does not accept connections by default. Being entirely new to the postgresql world, I'm not sure if this is a bug or feature.
To fix edit /etc/rc.d/init.d/postgresql
Find the line which reads:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $Psu -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
You must add the -o [options] -i [accept connections] like so:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $Psu -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -o -i -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
Then issue a
/sbin/service postgresql restart
####
Thanks for your help, and taking the time to read the message..cheers.!