gitlab-ce-omnibus社区版的备份、还原及升级
gitlab-ce-omnibus社区版的备份和还原,可以使用gitlab自带工具,gitlab-rake来完成,详见下面例子
将旧gitlab服务器备份,并还原至新gitlab服务器 ,这两台gitlab服务器必须要同版本,才能还原成功
旧gitlab服务器
更改gitlab备份文件存放位置
vim /etc/gitlab/gitlab.rb
gitlab_rails['backup_path'] = "/mnt"
#该地址是配置存放备份的地方,根据实际情况配置,可以指定为已经挂载好的nfs目录,便于边备份边传输至新gitlab服务器。
gitlab-ctl reconfigure
备份旧gitlab服务器的数据,密钥文件及ssh文件,停止旧gitlab服务
gitlab-rake gitlab:backup:create
#在备份数据巨大,备份路径是网络路径情况下,比较耗时。
cp /etc/gitlab/gitlab-secrets.json /mnt/
cp /etc/ssh/*key* /mnt/
#gitlab密钥及服务器密钥,在进行gitlab完整迁移和完整还原,是必须要备份的。
gitlab-ctl stop
新gitlab服务器
停止与数据库的连接
gitlab-ctl reconfigure
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# Verify
gitlab-ctl status
恢复数据及配置至新gitlab主服务器
chown git:git 1564156142_2019_07_26_10.4.3_gitlab_backup.tar
gitlab-rake gitlab:backup:restore backup=timestamp
#timesstamp是指gitlab备份包的文件名前面的一串数字,如1564156142
# 如报下面的错误就是文件权限问题导致的
Unpacking backup ... tar: 1564156142_2019_07_26_10.4.3_gitlab_backup.tar: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
cp -f /mnt/gitlab-secrets.json /etc/gitlab/
cp -f /mnt/*key* /etc/ssh/
# key认证问题
可能报错:
报错情况1:(key没有从master复制过来)
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:9DdK4jo9LPLg7snd/vueT3wI2dy0hb7CVYRRGOTU8TY.
Please contact your system administrator.
Add correct host key in /c/Users/cd/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/cd/.ssh/known_hosts:4
ECDSA host key for git.tuandai888.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
报错情况2:(从master复制过来的key权限没设置好)
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方法:
把master的 /etc/ssh/*key* 文件全部复制到从节点来,并注意权限与master的设置一样,
scp root@[master_IP]:/etc/ssh/*key* /etc/ssh
chown root:ssh_keys ssh_host_ecdsa_key ssh_host_ed25519_key ssh_host_rsa_key
重启gitlab服务,并验证
gitlab-ctl restart
gitlab-rake gitlab:check SANITIZE=true
#检查新gitlab服务器刚刚导入的数据
gitlab-ctl reconfigure
验证新gitlab主服务器的用户,代码库,提交记录等等是否完整,测试各项操作
递进升级到目前最新的稳定版本
列出当前gitlab所有版本
yum list gitlab-ce.x86_64 --showduplicates | sort -r
#先升级到当前安装主版本的最后一个子版本,再升级到下一个主版本的合适的子版本。
#升级完一个版本后,确认无报错,数据正常,再升级到下一个版本。
#下面就是从7.x.x升级到10.x.x的升级方法
yum install -y gitlab-ce-7.14.3-ce.1.el7
yum install -y gitlab-ce-8.17.8-ce.0.el7
yum install -y gitlab-ce-9.5.9-ce.0.el7
yum install -y gitlab-ce-10.3.5-ce.0.el7
gitlab-ctl restart
gitlab-ce-omnibus社区版的备份、还原及升级的更多相关文章
- Gitlab - 安装的社区版 Gitlab-ce,解决访问网页报502-Whoops, GitLab is taking too much time to respond的问题
问题背景 在自己虚拟机(centos7)上装了 Gitlab-ce,就是社区版的 Gitlab,版本是 13.0+ 问题描述 浏览器访问 Gitlab 网站,报 502 问题翻译 502-Whoops ...
- centos 6.5 6.6 6.7安装gitlab教程(社区版)
简单的说安装gitlab就两种办法主要介绍第一种:官网推荐的方法: 1.新建yum源 新建 /etc/yum.repos.d/gitlab-ce.repo,内容为 [gitlab-ce] name=g ...
- 【Git】 GitLab服务器社区版安装与配置
GitLab简介 GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务 GitLab系统架构 当~git在图片中引用时,它表示git用户的主目录 ...
- Gitlab(2)- centos7.x 下安装社区版 Gitlab 以及它的配置管理
前置准备:虚拟机安装以及配置相关 包含安装 centos7.8 虚拟机.设置静态 ip 等 https://www.cnblogs.com/poloyy/category/1703784.html 注 ...
- Ubuntu 安装 Docker CE(社区版)
参考自 https://yeasy.gitbooks.io/docker_practice/install/ubuntu.html#ubuntu-1604- docker-io 是以前早期的版本,版本 ...
- 在自己的服务器上部署 GitLab 社区版
GitLab 简介 因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gi ...
- Gitlab 社区版安装部署和维护指南
因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gitlab 升级到了 ...
- Gitlab 备份还原/迁移
Gitlab 备份还原 备份数据:通过命令进行备份操作 gitlab-rake gitlab:backup:create ... [DISABLED] Creating backup archive: ...
- 【实用Windows双系统一键备份还原工具】Winclone Pro for Mac
[简介] 今天和大家分享最新的 Winclone Pro 7.3.3 Mac 版本,这是一款Mac上强大易用的Windows分区备份还原工具,类似于Windows上的一键Ghost,能够将 PC 上的 ...
随机推荐
- failed to load response data
当需要根据后台传回地址跳转页面时 即使使用preserve log 可以查看上一个页面获取地址请求,但是此时请求返回值为failed to load response data 当关闭页面跳转可以查看 ...
- 用STL对一组数组进行排序和去重
#include <iostream> #include<cmath> #include "algorithm" #include "cstdio ...
- java标号
标号用于控制循环执行流程: public static void main(String[] args) { mark: for(int i = 0; i < 3; i++) { System. ...
- js实现个链表吧
存储多个元素,最常用的数据结构是数组.但是数组有个一缺点,从数组中添加或移除项的成本很高,因为需要移动元素.链表也可以存储有序的元素集合,但是和数组不同,链表中的元素在内存中不是连续放置的.每个元素存 ...
- UVALive 4490 压缩DP
转载自http://blog.csdn.net/zstu_zlj/article/details/9903589 没有接触过压缩DP.位运算也不太熟.所以理解了思路还是不懂代码.
- Android消息通信 第三方开源项目EventBus 的用法
EventBus是github上的一个第三方开发库,其在github上的项目主页地址:https://github.com/greenrobot/EventBus EventBus的消息模型是消息发布 ...
- Struts2内置校验器——完整实例代码
一.校验器的配置风格 1.字段校验器: <field name="被校验的字段"> <field-validator type="校验器名"& ...
- 玩转X-CTR100 l STM32F4 l WS2812全彩LED灯
更多塔克创新资讯欢迎登陆[塔克社区 www.xtark.cn ][塔克博客 www.cnblogs.com/xtark/ ] WS2812B RGB全彩LED灯珠,只需通过一根信号线控制多个 ...
- 玩转X-CTR100 | STM32F4 l GPIO位带操作
更多塔克创新资讯欢迎登陆[塔克社区 www.xtark.cn ][塔克博客 www.cnblogs.com/xtark/ ] STM32F4位带概念,及位带的GPIO操作实践应用. 原理介 ...
- <NET CLR via c# 第4版>笔记 第12章 泛型
泛型优势: 源代码保护 使用泛型算法的开发人员不需要访问算法的源代码.(使用c++模板的泛型技术,算法的源代码必须提供给使用算法的用户) 类型安全 向List<DateTime>实例添加一 ...