postgresql - 在 CentOS 6.5 上安装 Gitlab 时遇到问题

标签 postgresql centos gitlab

我曾多次尝试按照 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”,“Client Connection Problems”部分:

Alternatively, you'll get this when attempting Unix-domain socket communication to a local server:

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"?

The last line is useful in verifying that the client is trying to connect to the right place.
If there is in fact no server running there, the kernel error message will typically be either Connection refused or No such file or directory, as illustrated.
(It is important to realize that Connection refused in this context does not mean that the server got your connection request and rejected it. That case will produce a different message, as shown in Section 19.4.)
Other error messages such as Connection timed out might indicate more fundamental problems, like lack of network connectivity.

所以首先确保数据库可以启动。

OP Luke Usher确认 in the comments :

The default PostgreSQL config included in gitlab was set to allocate more memory for shared_buffer than I have available.

This was corrected by adding postgresql['shared_buffers'] = "1024MB" to /etc/gitlab/gitlab.rb.

关于postgresql - 在 CentOS 6.5 上安装 Gitlab 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24353370/

相关文章:

gitlab - 通过 GitLab API 查询命名空间项目

ruby-on-rails - 连接两台流浪机器

sql - postgresql:错误重复键值违反唯一约束

node.js - 从自己的 gitlab 服务器安装 Node 模块

c++ - 在centos上构建gcc?

linux - 我运行的是哪个 Red5 版本?

python - Gitlab CI 在 Python 脚本输出中换行

postgresql - Postgres TIMESTAMP 查询

sql - Postgres 基于 2 列聚合结果

bash - 我如何使用 TIME/Linux 检查用户命令历史记录?