CentOS7下怎么升级GitLab
发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,这篇文章给大家分享的是有关CentOS7下怎么升级GitLab的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。备份&升级在升级前一定要做好备份,记录自己当前gitlab-ca
千家信息网最后更新 2025年12月03日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安全错误
数据库的锁怎样保障安全
服务器创业
传奇私服服务器账号管理
服务器部署虚拟机
数据库速度测试
提升网络安全运行系数
软件开发都需要哪些人员
下沙APP软件开发
我的世界买服务器会不会卡
信息安全 网络安全公益讲座
数据库cursor的作用
服务器怎样管理视频文件
服务器红石
天盈九州网络技术有限公司
网络安全任务书
软件开发安全注意事项有哪些
关于网络安全主题讲座心得
cf手游转区服务器繁忙什么意思
数据库获取流程
沈丘软件开发设计
缓存服务器 硬件
服务器传输速度提升
北京pdu服务器电源生产线
我的世界服务器该怎么设置称号
中原数据库安全联合实验室成立
南方电网查询电费服务器繁忙
下沙APP软件开发
常见数据库管理系统有哪些
fbi网络安全局助理局长
网络技术侦察工作的重要性
数据库前端开发工具是什么