centos7 gitlab安装及502采坑

安装可以参考这位小哥教程:https://blog.csdn.net/qingguiyu/article/details/81022509
注意:如果项目跑在项目的测试环境中,不需要安装防火墙

但是问题出现,安装完成后从外网访问,出现502错误:
centos7 gitlab安装及502采坑_第1张图片
搞了半天发现gitlab的unicorn服务端口被占用,unicorn[‘port’] = 8080默认使用8080端口,使用:vim /etc/gitlab/gitlab.rb # 修改默认的配置文件; 将其修改为90901即可。centos7 gitlab安装及502采坑_第2张图片
以下是排查过程:

  1. gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
    先按照结果提示的方法排查,然鹅无效
    centos7 gitlab安装及502采坑_第3张图片
  2. 向官网https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md 查找,发现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.!`
然鹅依然没用

3.不断运行gitlab-ctl status,发现unicorn的pid不断增长,但是其他服务pid没有变化,这应该就是unicorn的问题了。继续深入,使用gitlab-ctl tail unicorn来跟踪unicorn的状态,发现8080端口被占用(下图端口显示的是9090,是因为我先修改为9090,发现仍然被占用,又改成了90901),
centos7 gitlab安装及502采坑_第4张图片
以此执行:

gitlab-ctl reconfigure
gitlab-ctl restart

重启gitlab

至此问题解决。

你可能感兴趣的:(linux)