博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
我所遇到的GitLab 502问题的解决
阅读量:7102 次
发布时间:2019-06-28

本文共 3164 字,大约阅读时间需要 10 分钟。

hot3.png

今天在阿里云上配置GitLab,不过一直出现错误502错误。

502 GitLab is not responding. Please contact your GitLab administrator if this problem persists.

gitlab出现的502错误

经过一个下午的查找终于发现了错误,原来是在服务器上还开启了一个tomcat服务,占用了8080端口,使GitLab的unicorn服务不能开启。 

最后在/etc/gitlab/gitlab.rb 中做出如下修改

unicorn['port'] = 9090

gitlab-ctl reconfigure 重启配置,这样GitLab服务器就可以正常运行了。

这里记录一下解决问题的大概经过,也算给自己长经验。 

安装好GitLab,开启服务,发现有502错误。这是开始寻找解决办法,各种百度。 
1.找到/var/log/gitlab/nginx中的错误日志文件,发现有如下错误/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2: No such file or directory),然后用 nc命令创建了这个socket文件,最终权限设为srwxrwxrwx,用户和组设置为git:git,但发现这个方法行不通。

2.这时我跑到GitLab的官网去寻找解决办法, 

ctrl+f 502 找到官方教程中说502出现的问题

Note that on a single-core server it may take up to a minute to restart Unicorn and Sidekiq. Your GitLab instance will give a 502 error until Unicorn is up again.It is also possible to start, stop or restart individual components.sudo gitlab-ctl restart sidekiq Unicorn supports zero-downtime reloads. These can be triggered as follows:sudo gitlab-ctl hup unicorn Note that you cannot use a Unicorn reload to update the Ruby runtime.

尝试用上面两个命令解决,发现没有用。 

这时我怒了,不断的输入gitlab-ctl status,发现unicorn的pid一直在变大。而其他几个服务的pid没有变化。

3.这时差不多找到了问题的所在了,应该就是unicorn的问题。然后看官方教程,可以使用gitlab-ctl tail unicorn 来跟踪unicorn的状态,这时候悲催的发现原来时权限不够,chmod -R 777 /var/log/gitlab

2015-05-09_14:17:29.67447 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:732:in `initialize': Permission denied @ rb_sysopen - /var/log/gitlab/unicorn/unicorn_stderr.log (Errno::EACCES)2015-05-09_14:17:29.67466 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:732:in `open'2015-05-09_14:17:29.67469 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:732:in `redirect_io'2015-05-09_14:17:29.67473 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:177:in `stderr_path='2015-05-09_14:17:29.67478 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:111:in `block in commit!'2015-05-09_14:17:29.67482 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:108:in `each'2015-05-09_14:17:29.67486 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:108:in `commit!'2015-05-09_14:17:29.67491 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:121:in `initialize'2015-05-09_14:17:29.67496 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn:126:in `new'2015-05-09_14:17:29.67500 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn:126:in `
'2015-05-09_14:17:29.67504 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `load'2015-05-09_14:17:29.67509 from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `
'2015-05-09_14:17:29.68708 master failed to start, check stderr log for details

4.好了,终于发现了问题的所在。这时候的选择就变成了是把原来8080端口的服务给杀了还是将unicorn的端口换一个呢。这个就看自己的具体需求了。我这边是将unicorn端口换成了9090,方法就是开头讲的方法了

 

转载于:https://my.oschina.net/airship/blog/1573094

你可能感兴趣的文章
OSI模型有7层结构
查看>>
go语言碎片整理之标准库log
查看>>
导航菜单栏
查看>>
linux权限及权限管理
查看>>
vim补充及多条件判断
查看>>
VM虚拟机下载与安装
查看>>
深入理解Java内存模型(六)——final
查看>>
步步为营搭建spring+springmvc+mybatis(oracle)项目
查看>>
MDaemon退信分析:553 MI:SUM
查看>>
Windws Srv 2008内置账户
查看>>
PMP-5A小伙子的备考历程
查看>>
电脑开机按F1的解决方法
查看>>
gdbserver静态编译-调试失败的原因
查看>>
AD --- 活动目录的日常管理操作(2)
查看>>
linux安装VMware-tools步骤
查看>>
WPF 布局管理器之 StackPanel、WrapPanel、DockPanel (6)
查看>>
PostgreSQL配置参数详解和配置错误解决办法(二)
查看>>
搭建PHP环境后PHPINFO()中没有MYSQL的解决方法--笔记
查看>>
安装RPM包遇到:warning: : Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
查看>>
简单的Python登陆认证小程序
查看>>