postgresql - Postgres 的 GitLab Omnibus 配置

标签 postgresql gitlab

我正在尝试在已安装 Postgres 9.1 的 Debian 7 (Wheezy) 开发机器上安装 gitlab_6.8.1-omnibus.4-1_amd64.deb

当我运行 sudo gitlab-ctl reconfigure 时,我发现了一个错误:

Error executing action `run` on resource 'execute[migrate database]'
    ======================================================================

    Mixlib::ShellOut::ShellCommandFailed  
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/bin/gitlab-rake db:migrate ----
STDOUT:
STDERR: WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
rake aborted!
FATAL:  password authentication failed for user "gitlab"
FATAL:  password authentication failed for user "gitlab"

我在 Postgres 中创建了用户 gitgitlab(密码为 gitgitlab)但是它没有'帮助。

/var/log/postgresql/postgresql-9.1-main.log 充满了身份验证错误:

2014-05-10 14:51:30 MSK FATAL:  password authentication failed for user "gitlab"

如何配置 PostgreSQL 选项以安装 GitLab Omnibus?

最佳答案

我用现有的 PostgreSQL 实例解决了这个问题。

  1. 添加到/etc/gitlab/gitlab.rb:

    # Disable the built-in Postgres
    postgresql['enable'] = false
    
    gitlab_rails['db_adapter'] = 'postgresql'
    gitlab_rails['db_encoding'] = 'unicode'
    # Create database manually and place its name here.
    gitlab_rails['db_database'] = 'gitlabhq_production'
    gitlab_rails['db_host'] = '127.0.0.1'
    gitlab_rails['db_port'] = '5432'
    gitlab_rails['db_username'] = 'git' # Database owner.
    gitlab_rails['db_password'] = 'git' # Database owner's password.
    
  2. 运行 sudo gitlab-ctl reconfigure

  3. 导入默认数据:

    sudo gitlab-rake gitlab:setup
    

另一种变体是为内置 PostgreSQL 设置自定义端口:

    postgresql['enable'] = true
    postgresql['port'] = 5433

这将在指定端口上运行单独的 PostgreSQL 实例。

关于postgresql - Postgres 的 GitLab Omnibus 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23580268/

相关文章:

docker - 是否可以集成SonarQube,Jenkins和GitLab(全部在docker中)?

git - 如何将现有的 repos 克隆到 gitlab 中的一个组

git - GitLab CE 中的 merge 请求批准

gitlab - .gitlab-ci.yml 中的 `cache:key` 有什么意义?

environment-variables - 在 GitLab CI 中将环境变量从一个阶段导出到下一个阶段

postgresql - 使用 PostgreSQL/PostGIS 函数设置值的 Sequelize 模型

performance - PostgreSQL 在包含数组和大量更新的大表上运行缓慢

sql - 以更高效的方式从 PostgreSQL 数据库中检索数据

postgresql - 当行级安全生效时,未获得唯一约束错误的 "Detail"部分

function - Postgresql 9.2 触发分隔存储字符串中的子字段