gitlab升级(8.8.2到12.10.14)

此次升级由gitlab8.8.2最终升级到12.10.14

涉及到跨大版本,跨操作系统(centos6到centos7),centos6最高支持版本为9.5.9

(gitlab官方给出的解释gitlab13版本及之前的版本都支持centos6,但是10版本及之后版本所

依赖的policycoreutils-python不再支持centos6),再高版本需升级系统到centos7后继续升级

gitlab不支持跨大版本升级,需先升级到本版本的最后一个版本,然后再升级到下一个大版本的最后一个版本,依次升级。

升级过程中如果有需要修改配置文件的地方(如:修改gitlab地址),修改完成后需要执行gitlab-ctl reconfigure 使之生效。

此次升级由于目前版本较低,跨度较大,采用停机升级的方式,零停机升级版本顺序参照:https://docs.gitlab.com/ce/update/,如下图

升级顺序:centos6:8.8.2 -->8.17.8 -->9.5.9

centos7:9.5.9 --> 10.8.7 -->11.11.8

各版本下载地址:https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=&filter=all&filter=all&dist=

升级过程中务必保证数据及用户可正常访问后继续升级

centos6

本次升级先由8.8.2升级到8.17.8

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/6/gitlab-ce-8.17.8-ce.0.el6.x86_64.rpm/download.rpm

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

gitlab-ctl stop nginx

rpm -Uvh gitlab-ce-8.17.8-ce.0.el6.x86_64.rpm

gitlab-ctl restart

服务器启动后访问测试是否能够正常登录访问,无误后进行下一步升级到9.5.9

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/6/gitlab-ce-9.5.9-ce.0.el6.x86_64.rpm/download.rpm

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

gitlab-ctl stop nginx

rpm -Uvh gitlab-ce-9.5.9-ce.0.el6.x86_64.rpm

gitlab-ctl restart

在centos6的gitlab9.5.9创建备份

gitlab-rake gitlab:backup:create

在centos7安装gitlab9.5.9

1.安装依赖库:

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

2.下载rpm安装包:

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm/download.rpm

3.安装依赖服务:

yum install -y curl policycoreutils-python openssh-server

4.安装gitlab

rpm -ivh gitlab-ce-9.5.9-ce.0.el6.x86_64.rpm

5.重置是配置生效

gitlab-ctl reconfigure

6.启动

gitlab-ctl start

7.访问并设置密码

8.恢复数据

将在centos6备份的数据拷贝备份到/var/opt/gitlab/backups下

恢复过程会对备份文件进行读取等下相关操作需要进行授权

chmod 777 /var/opt/gitlab/backups/1625624459_2021_07_07_9.5.9_gitlab_backup.tar

停止数据同步服务:

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

执行恢复命令: ####恢复过程中会有几个确定动作,需要输入yes,如是新gitlab服务器继续执行即可,如之前有数据需要进行备份,恢复数据会覆盖原有数据。

gitlab-rake gitlab:backup:restore BACKUP=备份版本号

例如:

gitlab-rake gitlab:backup:restore BACKUP=1625624459_2021_07_07_9.5.9

显示如下则恢复成功:

9.重启gitlab

gitlab-ctl restart

重启后访问测试,查看代码库是否完整,之前账户能否正常登录

查验数据账户无误后继续升级。

升级过程中务必保证数据及用户可正常访问后继续升级

升级到10.8.7

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-10.8.7-ce.0.el7.x86_64.rpm/download.rpm

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

gitlab-ctl stop nginx

rpm -Uvh gitlab-ce-10.8.7-ce.0.el7.x86_64.rpm

gitlab-ctl restart

升级到11.11.8

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.11.8-ce.0.el7.x86_64.rpm/download.rpm

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

gitlab-ctl stop nginx

rpm -Uvh gitlab-ce-11.11.8-ce.0.el7.x86_64.rpm

gitlab-ctl restart

升级到12.10.14

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-12.10.14-ce.0.el7.x86_64.rpm/download.rpm

此时遇到升级报错:

根据报错提示,需要先从11大版本升级到12.0.X版本后才能继续升级,根据官方资料显示11以后的版本改动基本较大,需要先升级到下一个大版本的初始小版本才能

继续升级到下一个大版本的最后一个小版本,此处我们选择12.0.12

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-12.0.12-ce.0.el7.x86_64.rpm/download.rpm

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

gitlab-ctl stop nginx

rpm -Uvh gitlab-ce-12.0.12-ce.0.el7.x86_64.rpm

gitlab-ctl restart

启动后访问检验是否正常,检验正常后继续升级

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

gitlab-ctl stop nginx

rpm -Uvh gitlab-ce-12.10.14-ce.0.el7.x86_64.rpm

gitlab-ctl restart

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值