我曾多次尝试按照Official page上的说明在我的CentOS 6.5 VPS上安装Gitlab,但每次都在安装的“Gitlab ctl reconfigure”阶段失败。我试着在这里到处搜索和查找其他问题,但运气不太好。
错误如下:
* execute[create gitlab database user] action run
================================================================================
Error executing action `run` on resource 'execute[create gitlab database user]'
================================================================================
---- Begin output of /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" ----
STDOUT:
STDERR: 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"?
---- End output of /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" ----
最佳答案
这可能与GitLab没有直接关系,而是与PostgreSQL本身有关。
参见“Chapter 17. Server Setup and Operation”一节:
或者,在尝试与本地服务器进行Unix域套接字通信时,您将获得以下信息:
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"?
最后一行用于验证客户端是否尝试连接到正确的位置。
如果实际上没有服务器在运行,那么内核错误消息通常是
Connection refused
或No such file or directory
,如图所示。(必须认识到,在此上下文中被拒绝的连接并不意味着服务器收到了您的连接请求并拒绝了它这种情况将产生不同的消息,如Client Connection Problems所示
其他错误消息,如
Connection timed out
可能表示更基本的问题,如缺乏网络连接。所以确保数据库可以先启动。
Section 19.4确认了OP Luke Usher:
gitlab中包含的默认PostgreSQL配置被设置为为为
shared_buffer
分配比我可用的更多内存。这是通过将
postgresql['shared_buffers'] = "1024MB"
添加到/etc/gitlab/gitlab.rb
来纠正的。