<xmp id="63nn9"><video id="63nn9"></video></xmp>

<xmp id="63nn9"></xmp>

<wbr id="63nn9"><ins id="63nn9"></ins></wbr>

<wbr id="63nn9"></wbr><video id="63nn9"><ins id="63nn9"><table id="63nn9"></table></ins></video>

記錄一次線上gitlab11.x升級gitlab14.x版本操作

前言:gitlab11升級到14還是有挺多需要注意的坑,也算是做一次積累吧,升級前后,gitalb的WEB界面也變化了很多,升級過程需要注意的地方我放到最后說明,挺關鍵的

一、首先需要下載好要升級的包,這里需要注意,gitlab的官網有說明如何升級,大概就是如下面所示,跨版本升級先要升級到版本最后一個版本才行,比如線上使用11.0.7,要升級到11.11.8才能升級到12.0.12

包下載地址
https://packages.gitlab.com/gitlab/gitlab-ce

官網建議按以下版本來升級

GitLab 8: 8.11.Z > 8.12.0 > 8.17.7
GitLab 9: 9.0.13 > 9.5.10
GitLab 10: 10.0.7 > 10.8.7
GitLab 11: 11.0.6 > 11.11.8
GitLab 12: 12.0.12 > 12.1.17 > 12.10.14
GitLab 13: 13.0.14 > 13.1.11 > 13.8.8 > 13.12.15
GitLab 14: 14.0.12 > 14.3.6 > 14.9.5 > 14.10.5
GitLab 15: 15.0.5 > 15.1.6 (for GitLab instances with multiple web nodes) > 15.4.6 > latest 15.Y.Z

官網文檔鏈接在這里

https://docs.gitlab.com/ee/update/index.html#upgrade-paths

二、升級步驟

2.1 先把nginx停止,外部無法訪問了

/usr/local/nginx/sbin/nginx -s stop

2.2 做一次備份,整個過程我只做一次備份,我也在阿里云做鏡像以防萬一,同時我在操作線上升級前已經反復嘗試,還是有信心的

gitlab-rake gitlab:backup:create

備份敏感數據
cp  /etc/gitlab/gitlab.rb  /data/gitlab/backups
cp  /etc/gitlab/gitlab-secrets.json  /data/gitlab/backups

2.3 關閉gitlab的部分服務

13.x以前版本關閉unicorn,14.x版本就不支持unicorn,從13版本開始,我使用puma方式,停止方式gitlab-ctl stop puma

官網對照

 

 鏈接地址

https://docs.gitlab.com/ee/administration/operations/puma.html#converting-unicorn-settings-to-puma

13.x以前版本關閉unicorn,操作命令停止下面服務

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

2.4 升級新版本

rpm -Uvh 要升級版本.rpm

這里要升級到11.11.8版本為例子

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

2.5升級完成后,沒有報錯情況下,需要重新運行配置,否則啟動會失敗  

gitlab-ctl reconfigure

2.6 啟動

gitlab-ctl restart

2.7 查看gitlab版本信息  

第一種
gitlab-rake gitlab:env:info

第二種
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 

2.8 檢查服務

gitlab-rake gitlab:check SANITIZE=true

systemctl status gitlab-runsvdir.service

2.9 啟動nginx  

/usr/local/nginx/sbin/nginx

三、檢查測試git提交是否正常

我這里會修改代碼,然后提交是否正常,如果沒有問題就當升級成功了

 

 

 

 

四、需要注意的問題,我都說明下

4.1 gitlab13.x版本要安裝并且開啟Puma,因為14版本就不支持unicorn

4.2 升級13版本前一個版本需要升級postgresql,就是升級到了12.10.14版本,再執行更新postgresql

更新
gitlab-ctl pg-upgrade 

需要重新運行配置,否則啟動會失敗
gitlab-ctl reconfigure

啟動
gitlab-ctl restart

4.3 在gitlab13.x的最后一個版本 將傳統存儲轉換為哈希存儲,也就是13.12.15版本,文檔說明

https://docs.gitlab.com/ee/administration/raketasks/storage.html#migrate-to-hashed-storage%20for%20details

步驟如下

gitlab-rake gitlab:storage:migrate_to_hashed
 
# 執行成功后,再次執行,會提示如下內容:
#There are no projects requiring storage migration. Nothing to do!

# 全部遷移成功,以下命令查看所列出的項目總數與頁面的理應一致
gitlab-rake gitlab:storage:hashed_projects
 
# 查看,全部遷移成功以下兩條命令應該為 0 
gitlab-rake gitlab:storage:legacy_projects
gitlab-rake gitlab:storage:legacy_attachments
 
# 列出傳統存儲的項目以及附件
gitlab-rake gitlab:storage:list_legacy_projects
gitlab-rake gitlab:storage:list_legacy_attachments

4.5 升級14.x版本前一個版本升級postgresql,也就是13.12.15版本

更新
gitlab-ctl pg-upgrade 

需要重新運行配置,否則啟動會失敗
gitlab-ctl reconfigure

啟動
gitlab-ctl restart

  

最后沒問題了,正常使用~

  

posted @ 2023-03-12 21:00  lucky_tomato  閱讀(243)  評論(0編輯  收藏  舉報
人碰人摸人爱免费视频播放

<xmp id="63nn9"><video id="63nn9"></video></xmp>

<xmp id="63nn9"></xmp>

<wbr id="63nn9"><ins id="63nn9"></ins></wbr>

<wbr id="63nn9"></wbr><video id="63nn9"><ins id="63nn9"><table id="63nn9"></table></ins></video>