gitlab 升方法和注意事项
source link: https://zhiqiang.org/it/upgrade-gitlab.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
gitlab 升方法和注意事项
查看当前的 gitlab 的版本:
more /opt/gitlab/version-manifest.txt | grep gitlab-ce
gitlab 升级最大的问题是不能一次到位,甚至同一个大版本里也需要升级多次。它提供工具upgrade path,根据目前版本和目标版本,来确定升级路径。比如我目前的版本是 13.7.3 ,想升级到 13 大版本的最后一个 13.12.15 ,分别在Current
和Target
里面填入即可。不过 Current 里选不了 13.7.3 ,可以填前面的一个版本,即 13.6.7 ,最后得到结果:
根据提示,分别执行下面两条命令即可:
sudo apt-get install -y gitlab-ce=13.8.8-ce.0
sudo apt-get install -y gitlab-ce=13.12.15-ce.0
最好是在每次执行后先执行一次sudo gitlab-ctl reconfigure
。
在升级过程中出现过下面的错误:
Ensuring Prometheus is updated:Specified home directory, /var/opt/gitlab/prometheus either does not exist or does not contain any data directory inside.
Use --home-dir flag to specify Prometheus home directory.
Ensuring Prometheus is updated: NOT OK
Error ensuring Prometheus is updated. Please check the logs
dpkg: error processing package gitlab-ce (--configure):
installed gitlab-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
gitlab-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
并且访问gitlab
网页出现 502 error。不过在执行sudo gitlab-ctl reconfigure
之后恢复正常。
Q. E. D.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK