0
votes

sudo chef-server-ctl reconfigure run fails with the folloing Error

STDERR: createdb: could not connect to database template1: 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"?
    ---- End output of createdb --template template0 --encoding UTF-8 opscode-pgsql ----
    Ran createdb --template template0 --encoding UTF-8 opscode-pgsql returned 1
I have tried multiple options suggested in other posts like:
1) chmod 777 /tmp
2) $ sudo mkdir /var/pgsql_socket/
3) Ensure localhost entry is present under /etc/hosts

However, I do not see any socket definition in /tmp 
or
/usr/local/var/postgres/postgresql.conf
2
Couple questions, what version of chef are you running? What version of Redhat are you running as well. Is this a clean install or and upgrade of sorts? - Malcolm Jones
This is actually Oracle Linux 6.6 which is based out of RHEL images. Chef Server version is 12.1.0... I have had the installer working with a previous version of Chef Server before. I am not upgrading but doing a fresh clean install - sjn

2 Answers

0
votes

If I had to guess, I would say you might be on Redhat 7, which is not currently supported.

0
votes

Finally found out the issue:

Check the Log file at: /var/log/opscode/postgresql/9.2/current

It was due to the following error:

could not create shared memory segment: Invalid argument
2015-06-29_21:06:45.92874 DETAIL:  Failed system call was shmget(key=5432001, size=2012045312, 03600).

You need to edit /etc/sysctl.conf and add the following line appropriate to the size in the error:

kernel.shmmax = 3022045312

Then run:

sudo sysctl -p

Alternatively, you can edit /etc/postgresql//main/postgresql.conf and reduce the value of shared_buffers parameter