GitLab 502错误,unicorn始终重新启动

GitLab 502错误,unicorn始终重新启动,gitlab,gitlab-omnibus,Gitlab,Gitlab Omnibus,我成功地在Ubuntu系统中安装了gitlab。但是当我试图通过访问它时,它显示了我的502呜呜声,GitLab花了太多时间来响应。 我用谷歌搜索并尝试了谷歌搜索的方法,但没有成功。我还尝试将独角兽['port']更改为不同的端口,但错误相同 我运行gitlab ctl status,发现独角兽pid总是在变化 我运行了gitlab ctl tail unicorn,下面是日志: ==> /var/log/gitlab/unicorn/unicorn_stderr.log <

我成功地在Ubuntu系统中安装了gitlab。但是当我试图通过访问它时,它显示了我的502呜呜声,GitLab花了太多时间来响应。 我用谷歌搜索并尝试了谷歌搜索的方法,但没有成功。我还尝试将独角兽['port']更改为不同的端口,但错误相同

我运行
gitlab ctl status
,发现独角兽pid总是在变化

我运行了
gitlab ctl tail unicorn
,下面是日志:

    ==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
ArgumentError: Already running on PID:809 (or pid=/opt/gitlab/var/unicorn/unicorn.pid is stale)
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:195:in `pid='
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:127:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
  /opt/gitlab/embedded/bin/unicorn:23:in `load'
  /opt/gitlab/embedded/bin/unicorn:23:in `<top (required)>'

==> /var/log/gitlab/unicorn/unicorn_stdout.log <==
bundler: failed to load command: unicorn (/opt/gitlab/embedded/bin/unicorn)

==> /var/log/gitlab/unicorn/current <==
2018-05-30_06:38:28.57658 master failed to start, check stderr log for details

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
ArgumentError: Already running on PID:809 (or pid=/opt/gitlab/var/unicorn/unicorn.pid is stale)
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:195:in `pid='
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:127:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
  /opt/gitlab/embedded/bin/unicorn:23:in `load'
  /opt/gitlab/embedded/bin/unicorn:23:in `<top (required)>'

==> /var/log/gitlab/unicorn/unicorn_stdout.log <==
bundler: failed to load command: unicorn (/opt/gitlab/embedded/bin/unicorn)

==> /var/log/gitlab/unicorn/current <==
2018-05-30_06:38:29.62413 failed to start a new unicorn master
2018-05-30_06:38:29.67502 starting new unicorn master
2018-05-30_06:38:30.38160 master failed to start, check stderr log for details

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
ArgumentError: Already running on PID:809 (or pid=/opt/gitlab/var/unicorn/unicorn.pid is stale)
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:195:in `pid='
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:127:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
  /opt/gitlab/embedded/bin/unicorn:23:in `load'
  /opt/gitlab/embedded/bin/unicorn:23:in `<top (required)>'

==> /var/log/gitlab/unicorn/unicorn_stdout.log <==
bundler: failed to load command: unicorn (/opt/gitlab/embedded/bin/unicorn)

==> /var/log/gitlab/unicorn/current <==
2018-05-30_06:38:31.43073 failed to start a new unicorn master
2018-05-30_06:38:31.48246 starting new unicorn master
2018-05-30_06:38:32.19747 master failed to start, check stderr log for details
2018-05-30_06:38:33.24646 failed to start a new unicorn master
2018-05-30_06:38:33.29837 starting new unicorn master

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
ArgumentError: Already running on PID:809 (or pid=/opt/gitlab/var/unicorn/unicorn.pid is stale)
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:195:in `pid='
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:127:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
  /opt/gitlab/embedded/bin/unicorn:23:in `load'
  /opt/gitlab/embedded/bin/unicorn:23:in `<top (required)>'

==> /var/log/gitlab/unicorn/unicorn_stdout.log <==
bundler: failed to load command: unicorn (/opt/gitlab/embedded/bin/unicorn)

==> /var/log/gitlab/unicorn/current <==
2018-05-30_06:38:34.00485 master failed to start, check stderr log for details
2018-05-30_06:38:35.05395 failed to start a new unicorn master
2018-05-30_06:38:35.10656 starting new unicorn master

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
ArgumentError: Already running on PID:809 (or pid=/opt/gitlab/var/unicorn/unicorn.pid is stale)
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:195:in `pid='
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:127:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
  /opt/gitlab/embedded/bin/unicorn:23:in `load'
  /opt/gitlab/embedded/bin/unicorn:23:in `<top (required)>'

==> /var/log/gitlab/unicorn/unicorn_stdout.log <==
bundler: failed to load command: unicorn (/opt/gitlab/embedded/bin/unicorn)

==> /var/log/gitlab/unicorn/current <==
和gitlab.rb:

gitlab_workhorse['enable'] = true
# gitlab_workhorse['ha'] = false
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8181"

unicorn['worker_timeout'] = 600
###! Minimum worker_processes is 2 at this moment
###! See https://gitlab.com/gitlab-org/gitlab-ce/issues/18771
unicorn['worker_processes'] = 2

### Advanced settings
# unicorn['listen'] = '127.0.0.1'
unicorn['port'] = 12148

web_server['external_users'] = ['www-data']
web_server['username'] = 'www-data'
web_server['group'] = 'www-data'

nginx['enable'] = false

我遇到了与在CentOS 7.5 64位服务器上安装GitLab EE相同的问题

您必须注意的最重要的事情是确保您的服务器处于最低性能要求之下

,您的服务器必须至少有2个内核和8GB RAM

如果您的服务器少于2个内核和8GB RAM。您可以尝试进行交换以获得更多内存,然后重新配置并重新启动您的GitLab。如果仍然存在这种情况,请注意GitLab首次启动时的另一个大而可怕的问题:

GitLab安装后,加载第一页可能需要很长时间,可能需要几分钟

注意:如果您有一台性能较低的服务器,例如:1个核心和1GB RAM,那么在大多数情况下,它将是502,即使您尝试交换到8GB RAM,它也不起作用,唯一的方法是使服务器的性能至少超过2个核心和8GB RAM

您还可以使用其他一些方法来查找更详细的有用信息:

  • 我们可以使用
    gitlab ctl tail
    获取详细信息,然后复制日志,找到警告、失败等关键词

  • 您可以转到
    /var/log/gitlab
    的子目录来查找日志以获取一些信息

gitlab_workhorse['enable'] = true
# gitlab_workhorse['ha'] = false
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8181"

unicorn['worker_timeout'] = 600
###! Minimum worker_processes is 2 at this moment
###! See https://gitlab.com/gitlab-org/gitlab-ce/issues/18771
unicorn['worker_processes'] = 2

### Advanced settings
# unicorn['listen'] = '127.0.0.1'
unicorn['port'] = 12148

web_server['external_users'] = ['www-data']
web_server['username'] = 'www-data'
web_server['group'] = 'www-data'

nginx['enable'] = false