在其他路径中配置其他postgres后,gitlab 502错误

时间:2019-09-03 12:06:03

标签: postgresql gitlab

我已经在gitlab上安装了默认的postgres db,并且运行良好,直到必须安装另一个与postgres捆绑在一起的ALM工具,但该工具以不同的路径安装了。因此,现在我有2个postgres设置,但是我将它们都配置到了另一个端口,但是由于"Whoops, GitLab is taking too much time to respond"出现502错误,我仍然无法打开gitlab。

请找到命令$sudo gitlab-ctl tail unicorn

的输出
==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
E, [2019-09-03T17:33:28.047856 #20275] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2019-09-03T17:33:28.047963 #20275] ERROR -- : retrying in 0.5 seconds (4 tries left)
E, [2019-09-03T17:33:28.549091 #20275] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2019-09-03T17:33:28.549304 #20275] ERROR -- : retrying in 0.5 seconds (3 tries left)
E, [2019-09-03T17:33:29.050605 #20275] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2019-09-03T17:33:29.050778 #20275] ERROR -- : retrying in 0.5 seconds (2 tries left)
E, [2019-09-03T17:33:29.551638 #20275] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2019-09-03T17:33:29.551781 #20275] ERROR -- : retrying in 0.5 seconds (1 tries left)
E, [2019-09-03T17:33:30.052684 #20275] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2019-09-03T17:33:30.052855 #20275] ERROR -- : retrying in 0.5 seconds (0 tries left)
E, [2019-09-03T17:33:30.553731 #20275] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)

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

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
Errno::EADDRINUSE: Address already in use - bind(2) for 127.0.0.1:8080
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/socket_helper.rb:164:in `bind'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/socket_helper.rb:164:in `new_tcp_server'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/socket_helper.rb:144:in `bind_listen'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:241:in `listen'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:851:in `block in bind_new_listeners!'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:851:in `each'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:851:in `bind_new_listeners!'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:140:in `start'
  /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/unicorn-5.4.1/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/current <==
2019-09-03_12:03:30.59723 master failed to start, check stderr log for details
2019-09-03_12:03:31.60724 failed to start a new unicorn master
2019-09-03_12:03:31.64104 starting new unicorn master


changing the default port for unicorn and gitlab

2 个答案:

答案 0 :(得分:0)

根据错误消息,它不是导致问题的其他PostgreSQL。您安装的其他应用程序在哪个端口上监听?我认为它也像GitLab Unicorn一样也在8080端口上监听。

Errno::EADDRINUSE: Address already in use - bind(2) for 127.0.0.1:8080

Unicorn无法启动,因为其他端口在监听8080。您应该重新配置您的其他应用程序,使其监听的端口与GitLab不同。

如果您想更改Unicorn端口,可以通过在/etc/gitlab/gitlab.rb中添加/更改以下配置来实现。

unicorn['port'] = 8080 # Change this to something else. 

此更改之后,您将需要运行sudo gitlab-ctl reconfigure

考虑将这个新应用程序安装在新服务器/ VM上可能对您有所帮助。

答案 1 :(得分:0)

在将另一个应用程序移至其他端口号并重新启动服务器后,问题得到解决