CentOS / No Longer able to access PostgreSQL

July 7, 2014 1.5k views

This morning, all the sites were down and I tried to ssh into the server. After failing to log in, I accessed the server through the DO Console and saw a memory overflow error which apparently led to a segfault. I felt I had no choice but to roll back to a prior snapshot. I rebooted PostgreSQL, but I kept getting something like the following:

shutdown [FAIL]
start {OK}

After each Postgres reboot, I get the same as above. When I check to see if Postgres is running, it shows that it is running.

I switched to the postgres user, and $psql and threw this error:

psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I added the localhost path to the /.bash_config and now I have error about not being able to access with the following errors:

psql: could not connect to server: Connection refused
        Is the server running on host [local IP adress] and accepting
        TCP/IP connections on port 5432?
3 Answers

On the server, can you run:

sudo netstat -plunt

If Postgres is running and listening on port 5432, you should see a line like:

tcp        0      0*               LISTEN      1295/postgres   

netstat doesn't pull up anything.

Eh, uninstall and reinstall seems to work as planned.

Have another answer? Share your knowledge.