Postgres的GitLab Omnibus配置

kal*_*bro 9 postgresql gitlab

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

当我跑的时候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"
Run Code Online (Sandbox Code Playgroud)

我在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"
Run Code Online (Sandbox Code Playgroud)

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

kal*_*bro 18

我用现有的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.
    
    Run Code Online (Sandbox Code Playgroud)
  2. sudo gitlab-ctl reconfigure.

  3. 导入默认数据:

    sudo gitlab-rake gitlab:setup
    
    Run Code Online (Sandbox Code Playgroud)

替代变体是为内置PostgreSQL设置自定义端口:

    postgresql['enable'] = true
    postgresql['port'] = 5433
Run Code Online (Sandbox Code Playgroud)

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