Postgresql Will Not Start
Postgresql Will Not Start
Hello,
I am having a problem getting postgresql to start and thus connecting to Nagios. Everything works fine and then when I get to the login screen and try to login I get this: DB Connect Error [nagiosxi]: Database connection failed. Everything started fine except postgresql, I found a post in the FAQ about the PATH and I do not know if I am not doing it right but the PATH seems to be fine. I was wondering if there was something else I have to change?
Thanks,
Kent
I am having a problem getting postgresql to start and thus connecting to Nagios. Everything works fine and then when I get to the login screen and try to login I get this: DB Connect Error [nagiosxi]: Database connection failed. Everything started fine except postgresql, I found a post in the FAQ about the PATH and I do not know if I am not doing it right but the PATH seems to be fine. I was wondering if there was something else I have to change?
Thanks,
Kent
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Postgresql Will Not Start
Try running the following command
Code: Select all
psql nagiosxi nagiosxi -c 'vacuum;'
Re: Postgresql Will Not Start
I ran that command and here is the output:
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"?
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"?
Re: Postgresql Will Not Start
Try
Code: Select all
service postgresql restart
Re: Postgresql Will Not Start
Stopping postgresql service: [FAILED]
Initializing database: mkdir: cannot create directory `/var/lib/pgsql/data/pg_log': File exists
[FAILED]
Starting postgresql service: [FAILED]
Think I might just have to scrap it and call it a day, but any suggestions would be appreciated.
Thanks,
Kent
Initializing database: mkdir: cannot create directory `/var/lib/pgsql/data/pg_log': File exists
[FAILED]
Starting postgresql service: [FAILED]
Think I might just have to scrap it and call it a day, but any suggestions would be appreciated.
Thanks,
Kent
Re: Postgresql Will Not Start
Hmm, can you post the output from:
Is this a new install, or did this just start acting up recently on an existing system?
Code: Select all
umask
Re: Postgresql Will Not Start
0022
It is an existing install but there was some problems with snapshots and the Virtual Machine and I lost some data so I tried to rebuild the Virtual Machine and everything works fine but this issue arose.
Thanks
It is an existing install but there was some problems with snapshots and the Virtual Machine and I lost some data so I tried to rebuild the Virtual Machine and everything works fine but this issue arose.
Thanks
Re: Postgresql Will Not Start
It looks like the postgresql init script creates that directory and sets it up, lets try removing it and seeing if that takes care of the issue, if not we'll probably look at re-installing postgres (the data would remain preserved).
Code: Select all
rm -rf /var/lib/pgsql/data/pg_log
Re: Postgresql Will Not Start
I got postgresql to start but now am getting this error
psql: FATAL: could not open relation 1663/16385/1259: Permission denied
when I run the command: psql nagiosxi nagiosxi -c 'vacuum;'
So some progress but I cannot get the permissions straightened out.
Thanks again
psql: FATAL: could not open relation 1663/16385/1259: Permission denied
when I run the command: psql nagiosxi nagiosxi -c 'vacuum;'
So some progress but I cannot get the permissions straightened out.
Thanks again
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Postgresql Will Not Start
Can you connect to psql without a command?
If so, run
If no errors (warnings are ok) run
Code: Select all
psql nagiosxi nagiosxi
Code: Select all
VACUUM ANALYZE;
Code: Select all
VACUUM FULL;