centos安装gitlab

官方文档:

  • 修改端口
    https://docs.gitlab.com/omnibus/settings/nginx.html#change-the-default-port-and-the-ssl-certificate-locations
  • 配置
    https://docs.gitlab.com/omnibus/settings/configuration.html#change-the-default-port-and-the-ssl-certificate-locations
  • 官方安装地址:
    https://about.gitlab.com/install/?version=ce#centos-8
sudo dnf install -y curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd

# Check if opening the firewall is needed with: sudo systemctl status firewalld perl
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" dnf install -y gitlab-ce

修改存储位置

修改前

vim /etc/gitlab/gitlab.rb
# git_data_dirs({
#   "default" => {
#     "path" => "/mnt/nfs-01/git-data"
#    }
# })

修改后(取消注释,修改path)

vim /etc/gitlab/gitlab.rb
 git_data_dirs({
   "default" => {
     "path" => "/snt/data/gitlab"
    }
 })

修改端口

vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.139.130:9999'

修改为本机IP+端口

  • 加载配置,重启
    gitlab-ctl reconfigure
    gitlab-ctl restart
    访问gitlab出现502,是正常的,因为加载配置需要几分钟。
    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-4wHqPdgz-1634692359505)(http://192.168.10.61:9001/server/…/Public/Uploads/2021-05-27/60af0ac8ab707.png)]
  • 过一会就会正常,提示你修改root密码
    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-J1IywOCq-1634692359510)(http://192.168.10.61:9001/server/…/Public/Uploads/2021-05-27/60af0b8f18c2c.png)]
    如果一直显示502
chmod -R 755 /var/log/gitlab
gitlab-ctl restart

参考命令:
检查

gitlab-rake gitlab:check SANITIZE=true --trace

参考文档:
注意应该是13.6(可能是13.3)之后unicorn就停用了,改用puma
如不确定可在/var/opt/gitlab/gitlab-rails/etc/查看如果是puma.rb就是停用了unicorn,如果是unicorn.rb就是unicorn。
https://about.gitlab.com/install/?version=ce
https://blog.csdn.net/haveqing/article/details/114256542
https://ld246.com/article/1592710224510
https://blog.csdn.net/qq_46291185/article/details/106037160

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值