升级列表
1.在容器里面执行
检查gitlab
gitlab-rake gitlab:check SANITIZE=true --trace
创建备份文件
gitlab-rake gitlab:backup:create
查看备份文件
cd /var/opt/gitlab/backups
2.通过宿主机copy文件至指定服务器
恢复gitlab仓库
gitlab-rake gitlab:backup:restore BACKUP=1522918586_2018_04_05_10.6.2
启动gitlab服务
sudo gitlab-ctl start
常用命令
查看版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
检查gitlab
gitlab-rake gitlab:check SANITIZE=true --trace
查看日志
gitlab-ctl tail
数据库升级
gitlab-rake db:migrate
清理redis缓存
gitlab-rake cache:clear
恢复repo
gitlab-rake gitlab:backup:repo:restore
恢复db
gitlab-rake gitlab:backup:db:restore
进入数据库
su - gitlab-psql
psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
升级PostgreSQL最新版本
gitlab-ctl pg-upgrade
gitlab问题:
队列超过1G关闭,更改配置文件为10G ,然后reconfig,重启
gitlab_rails['env'] = {
'SIDEKIQ_MEMORY_KILLER_MAX_RSS' => "10000000"
}
https://docs.gitlab.com/ee/administration/troubleshooting/sidekiq.html
如要修改备份周期和目录,在/etc/gitlab/gitlab.rb中修改以下两个选项
设置备份周期为7天 - 604800秒
gitlab_rails['backup_keep_time'] = 604800
备份目录
gitlab_rails['backup_path'] = '/mnt/backups'