Postgresql Will Not Start

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
easy2kent
Posts: 45
Joined: Wed Aug 24, 2011 11:11 am

Postgresql Will Not Start

Post by easy2kent »

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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Postgresql Will Not Start

Post by scottwilkerson »

Try running the following command

Code: Select all

psql nagiosxi nagiosxi -c 'vacuum;'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
easy2kent
Posts: 45
Joined: Wed Aug 24, 2011 11:11 am

Re: Postgresql Will Not Start

Post by easy2kent »

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"?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Postgresql Will Not Start

Post by mguthrie »

Try

Code: Select all

service postgresql restart
easy2kent
Posts: 45
Joined: Wed Aug 24, 2011 11:11 am

Re: Postgresql Will Not Start

Post by easy2kent »

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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Postgresql Will Not Start

Post by mguthrie »

Hmm, can you post the output from:

Code: Select all

umask
Is this a new install, or did this just start acting up recently on an existing system?
easy2kent
Posts: 45
Joined: Wed Aug 24, 2011 11:11 am

Re: Postgresql Will Not Start

Post by easy2kent »

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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Postgresql Will Not Start

Post by mguthrie »

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
easy2kent
Posts: 45
Joined: Wed Aug 24, 2011 11:11 am

Re: Postgresql Will Not Start

Post by easy2kent »

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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Postgresql Will Not Start

Post by scottwilkerson »

Can you connect to psql without a command?

Code: Select all

psql nagiosxi nagiosxi
If so, run

Code: Select all

VACUUM ANALYZE;
If no errors (warnings are ok) run

Code: Select all

VACUUM FULL;
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked