CentOS7下GitLab怎么跨大版本升级
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,这篇文章主要介绍"CentOS7下GitLab怎么跨大版本升级"的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇"CentOS7下GitLab怎么跨大版本升级"文章
千家信息网最后更新 2025年12月02日CentOS7下GitLab怎么跨大版本升级
这篇文章主要介绍"CentOS7下GitLab怎么跨大版本升级"的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇"CentOS7下GitLab怎么跨大版本升级"文章能帮助大家解决问题。
备份&升级
在升级前一定要做好备份,记录自己当前gitlab-ca的版本号。
查看当前gitlab版本号
[root@localhost ~]# yum list | grep gitlab-cegitlab-ce.x86_64 9.3.6-ce.0.el7 installed
备份文件
[root@localhost ~]# gitlab-rake gitlab:backup:createdumping database ... dumping postgresql database gitlabhq_production ... [done]donedumping repositories ... * dev/dubbo ... [done] * dev/dubbo.wiki ... [skipped] * dev/dubbox-master ... [done] * dev/dubbox-master.wiki ... [skipped] * mobileterminal/mobiledoc ... [skipped] * mobileterminal/mobiledoc.wiki ... [skipped] * trakcare/doc ... [skipped] * trakcare/doc.wiki ... [skipped] * perationmaintenance/pmdoc ... [done] * perationmaintenance/pmdoc.wiki ... [done] * doc/his ... [done] * doc/his.wiki ... [skipped] * perationmaintenance/image ... [skipped] * perationmaintenance/image.wiki ... [skipped]donedumping uploads ... donedumping builds ... donedumping artifacts ... donedumping pages ... donedumping lfs objects ... donedumping container registry images ... [disabled]creating backup archive: 1552552057_2019_03_14_9.3.6_gitlab_backup.tar ... doneuploading backup archive to remote storage ... skippeddeleting tmp directories ... donedonedonedonedonedonedonedonedeleting old backups ... skipping
在目录/var/opt/gitlab/backups/下会生成一个备份文件如:1552552057_gitlab_backup.tar,其中1552552057即为此次备份都版本号。
还原备份(失败)
gitlab-rake gitlab:backup:restore backup=备份版本号
配置gitlab-yum源
[root@localhost ~]# cat << eof > /etc/yum.repos.d/gitlab-ce.repo> [gitlab-ce]> name=gitlab-ce> baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/> repo_gpgcheck=0> gpgcheck=0> enable=1> gpgkey=https://packages.gitlab.com/gpg.key> eof
yum install安装
[root@localhost ~]# yum install gitlab-ce-9.5.9已加载插件:fastestmirror, langpacksgitlab-ce | 2.9 kb 00:00:00 gitlab-ce/primary_db | 2.7 mb 00:00:01 loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com正在解决依赖关系--> 正在检查事务---> 软件包 gitlab-ce.x86_64.0.9.3.6-ce.0.el7 将被 升级---> 软件包 gitlab-ce.x86_64.0.9.5.9-ce.0.el7 将被 更新--> 解决依赖关系完成依赖关系解决=============================================================================================================================================================================================================================================================== package 架构 版本 源 大小===============================================================================================================================================================================================================================================================正在更新: gitlab-ce x86_64 9.5.9-ce.0.el7 gitlab-ce 381 m事务概要===============================================================================================================================================================================================================================================================升级 1 软件包总下载量:381 mis this ok [y/d/n]: ydownloading packages:no presto metadata available for gitlab-cegitlab-ce-9.5.9-ce.0.el7.x86_6 failed 18% [==================- ] 659 b/s | 70 mb 137:35:05 eta https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm: [errno 12] timeout on https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm: (28, 'operation too slow. less than 1000 bytes/sec transferred the last 30 seconds')正在尝试其它镜像。gitlab-ce-9.5.9-ce.0.el7.x86_6 failed 21% [====================== ] 646 b/s | 83 mb 134:19:56 eta https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm: [errno 12] timeout on https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm: (28, 'operation too slow. less than 1000 bytes/sec transferred the last 30 seconds')正在尝试其它镜像。gitlab-ce-9.5.9-ce.0.el7.x86_6 failed 81% [===================================================================================- ] 411 b/s | 311 mb 50:00:08 eta https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm: [errno 12] timeout on https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm: (28, 'operation too slow. less than 1000 bytes/sec transferred the last 30 seconds')正在尝试其它镜像。gitlab-ce-9.5.9-ce.0.el7.x86_64.rpm | 381 mb 00:01:52 running transaction checkrunning transaction testtransaction test succeededrunning transactiongitlab preinstall: automatically backing up only the gitlab sql database (excluding everything else!)dumping database ... dumping postgresql database gitlabhq_production ... [done]donedumping repositories ...[skipped]dumping uploads ... [skipped]dumping builds ... [skipped]dumping artifacts ... [skipped]dumping pages ... [skipped]dumping lfs objects ... [skipped]dumping container registry images ... [disabled]creating backup archive: 1552553362_2019_03_14_9.3.6_gitlab_backup.tar ... doneuploading backup archive to remote storage ... skippeddeleting tmp directories ... donedonedeleting old backups ... skipping 正在更新 : gitlab-ce-9.5.9-ce.0.el7.x86_64 [############################################################################################################################ ] 1/2 正在更新 : gitlab-ce-9.5.9-ce.0.el7.x86_64 [############################################################################################################################## 正在更新 : gitlab-ce-9.5.9-ce.0.el7.x86_64 1/2 *. *. *** *** ***** ***** .****** ******* ******** ******** ,,,,,,,,,***********,,,,,,,,, ,,,,,,,,,,,*********,,,,,,,,,,, .,,,,,,,,,,,*******,,,,,,,,,,,, ,,,,,,,,,*****,,,,,,,,,. ,,,,,,,****,,,,,, .,,,***,,,, ,*,. _______ __ __ __ / ____(_) /_/ / ____ _/ /_ / / __/ / __/ / / __ `/ __ \ / /_/ / / /_/ /___/ /_/ / /_/ / \____/_/\__/_____/\__,_/_.___/gitlab: thank you for installing gitlab!gitlab: to configure and start gitlab, run the following command:sudo gitlab-ctl reconfiguregitlab: gitlab should be reachable at http://192.168.x.x:8090/gitlabgitlab: otherwise configure gitlab for your system by editing /etc/gitlab/gitlab.rb filegitlab: and running reconfigure again.gitlab: gitlab: for a comprehensive list of configuration options please see the omnibus gitlab readmegitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/readme.mdgitlab: 清理 : gitlab-ce-9.3.6-ce.0.el7.x86_64 2/2 checking postgresql executables: okshutting down all gitlab services except those needed for migrationsok: down: gitaly: 1s, normally upok: down: gitlab-monitor: 0s, normally upok: down: gitlab-workhorse: 1s, normally upok: down: logrotate: 0s, normally upok: down: nginx: 1s, normally upok: down: node-exporter: 0s, normally upok: down: postgres-exporter: 0s, normally upok: down: postgresql: 0s, normally upok: down: prometheus: 0s, normally upok: down: redis: 1s, normally upok: down: redis-exporter: 0s, normally upok: down: sidekiq: 0s, normally upok: down: unicorn: 0s, normally upok: run: postgresql: (pid 3362) 1sok: run: redis: (pid 3370) 0srun: postgresql: (pid 3362) 1s; run: log: (pid 866) 3488369srun: redis: (pid 3370) 0s; run: log: (pid 897) 3488369sreconfiguring gitlab to apply migrations * moving existing certificates found in /opt/gitlab/embedded/ssl/certs * symlinking existing certificates found in /etc/gitlab/trusted-certsgitlab reconfigured!checking for an omnibus managed postgresql: okchecking if we already upgraded: okthe latest version 9.6.3 is already running, nothing to doensuring postgresql is updated: okrestarting previously running gitlab servicesok: run: gitaly: (pid 4046) 2sok: run: gitlab-monitor: (pid 4086) 1sok: run: gitlab-workhorse: (pid 4068) 2sok: run: logrotate: (pid 4120) 1sok: run: nginx: (pid 4126) 0sok: run: node-exporter: (pid 4177) 0sok: run: postgres-exporter: (pid 4184) 1sok: run: postgresql: (pid 3362) 72sok: run: prometheus: (pid 4094) 3sok: run: redis: (pid 3370) 71sok: run: redis-exporter: (pid 4194) 0sok: run: sidekiq: (pid 4203) 1sok: run: unicorn: (pid 4216) 0supgrade complete! if your gitlab server is misbehaving try running sudo gitlab-ctl restartbefore anything else. if you need to roll back to the previous version you canuse the database backup made during the upgrade (scroll up for the filename). 验证中 : gitlab-ce-9.5.9-ce.0.el7.x86_64 1/2 验证中 : gitlab-ce-9.3.6-ce.0.el7.x86_64 2/2 更新完毕: gitlab-ce.x86_64 0:9.5.9-ce.0.el7 完毕!
升级gitlab(注意:由于升级不能跨越大版本号,因此只能升级到当前大版本号到最高版本,方可升级到下一个大版本号)
[root@localhost ~]# cd /var/opt/gitlab/backups/[root@localhost backups]# ll总用量 6532-rw-------. 1 git git 6625280 3月 14 16:27 1552552057_2019_03_14_9.3.6_gitlab_backup.tar-rw-------. 1 git git 61440 3月 14 16:49 1552553362_2019_03_14_9.3.6_gitlab_backup.tar16:27 生成的tar包是我手动执行备份命令生成16:49 生成的tar包是yum更新版本自动备份
依次执行下面指令逐步升级,在每一步安装成功后如果发现界面500,不可访问,那么执行gitlab-ctl reconfigure指令刷新配置文件。(一定保证数据可以正常访问方可执行下一步升级指令)
yum install gitlab-ce-8.17.8-ce.0.el7yum install gitlab-ce-9.5.9-ce.0.el7yum install gitlab-ce-10.0.0-ce.0.el7yum install gitlab-ce-10.8.0-ce.0.el7yum install gitlab-ce-11.3.0-ce.0.el7
查看当前版本号
[root@localhost backups]# cat /opt/gitlab/embedded/service/gitlab-rails/version9.5.9
faq
[error] openssl::cipher::ciphererror (bad decrypt):gitlab-rails runner "project.where.not(import_url: nil).each { |p| p.import_data.destroy if p.import_data }"[error] error executing action `run` on resource 'ruby_block[directory resource: /var/opt/gitlab/git-data/repositories]'chmod -r 2770 /var/opt/gitlab/git-data关于"CentOS7下GitLab怎么跨大版本升级"的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注行业资讯频道,小编每天都会为大家更新不同的知识点。
版本
升级
备份
正在
更新
生成
指令
文件
知识
软件
软件包
镜像
尝试
事务
行业
配置
验证
不同
实用
最高
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
js 服务器文件
计算机软件开发的认证范围
一台电脑怎么开2个云服务器
软件开发自考资料
软件开发者大会英语演讲
婚庆数据库营销是什么意思
南京小西网络技术有限公司
2021年中国网络安全宣传
云端终端网络加速服务器
tplink服务器不响应
服务器怎么确认安全性
迭代式软件开发方法
无线网覆盖服务器维修站
高档服务器搬运价格
无线传感器网络技术应用实验报告
怎么判断服务器的磁盘
深职软件开发专业费钱吗
网络安全征文五年级400字作文
网络安全运维中级
单位网络安全管理机构设置
深圳佑臣网络技术有限公司
数据网网络安全产品
融势互联网科技怎么样
广东智慧党建软件开发软件
数据库分页top
2008附加数据库
高级软件开发现状
创业做数据库
莱阳平台软件开发企业
spl数据库如何做单向同步