RHEL上的Chef Server安装失败

时间:2015-06-26 22:07:53

标签: chef

sudo chef-server-ctl reconfigure 运行失败并显示以下错误



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 个答案:

答案 0 :(得分:0)

如果我不得不猜测,我会说你可能在Redhat 7上,目前不支持。

答案 1 :(得分:0)

终于找到了问题:

  

检查日志文件:/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参数的值