GitLab维护和升级

升级

到清华大学镜像下载apt包

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/xenial/main/g/gitlab-ce/

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ee/ubuntu/pool/xenial/main/g/gitlab-ee/

这个xenial是对应Ubuntu 16.04的

直接sudo apt install ./xxxx.deb,不能暂停服务,否则无法备份然后失败

升级前需要备份

备份

https://docs.gitlab.com/ce/raketasks/backup_restore.html#restore-for-omnibus-installations

sudo gitlab-backup create STRATEGY=copy

同时备份 /etc/gitlab/gitlab-secrets.json,不然所有的tokens都会丢失

备份gitlab配置信息 /etc/gitlab/gitlab.rb

汉化

代码地址:https://gitlab.com/xhang/gitlab

下载对应的中文包,解压,删掉log,tmp文件夹

修改文件夹权限为root:root

sudo gitlab-ctl stop

sudo cp -rf 文件夹/* /opt/gitlab/embbled/services/gitlab-rails

相当于覆盖冲突的文件,注意不能直接删掉后面那个文件后移动

sudo gitlab-ctl reconfigure

sudo gitlab-ctl restart

没问题的话汉化成功

恢复

https://docs.gitlab.com/ce/raketasks/backup_restore.html#restore-for-omnibus-gitlab-installations

写得很详细了

万一玩崩了

  1. 数据库没坏

sudo apt --reinstall ./xxxxx.deb 重装解决问题

  1. 数据库坏了

重装并恢复

Runner升级

https://docs.gitlab.com/runner/install/linux-manually.html

下载到/usr/local/bin并增加可执行权限

然后在gitlab后台删掉老的runner并

sudo gitlab-runner register

重新创建一个runner,保证两个runner的标签名称一致,注册为shared或者私有看原来是什么,注册完要重启gitlab服务器

sudo gitlab-ctl restart

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.

源地址

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值