Chef 服务器在 RHEL 上安装失败

Chef Server installation Fails on RHEL

sudo chef-server-ctl 重新配置 运行 失败并出现以下错误

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

如果非要我猜的话,我会说你可能使用的是目前不受支持的 Redhat 7。

终于找到问题所在:

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

这是由于以下错误造成的:

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).

您需要编辑 /etc/sysctl.conf 并根据错误大小添加以下行:

kernel.shmmax = 3022045312

然后运行:

sudo sysctl -p

或者,您可以编辑 /etc/postgresql//main/postgresql.conf 并减少 shared_buffers 参数的值