Gitlab管理之十五–Gitlab服务器维护

1. Gitlab服务器更新
(1). 使用SSH登陆Gitlab服务器
(2). 停止后端的unicorn服务器
[root@c720141 ~]# gitlab-ctl stop unicorn
ok: down: unicorn: 0s, normally up
(3). 停止后端的job 服务器。
[root@c720141 ~]# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up
(4). 升级前先做好备份,防止升级失败好回滚。
[root@c720141 ~]# gitlab-rake gitlab:backup:create
Dumping database ... 
Dumping PostgreSQL database gitlabhq_production ... [DONE]
done
Dumping repositories ...
  * root/super-git ... [DONE]
  * root/super-git.wiki ...  [DONE]
done
Dumping uploads ... 
done
Dumping builds ... 
done
Dumping artifacts ... 
done
Dumping pages ... 
done
Dumping lfs objects ... 
done
Dumping container registry images ... 
[DISABLED]
Creating backup archive: 1529996730_2018_06_26_11.0.1_gitlab_backup.tar ... done
Uploading backup archive to remote storage  ... skipped
Deleting tmp directories ... done
done
done
done
done
done
done
done
Deleting old backups ... skipping
(5)从该地址下载最新包。

https://about.gitlab.com/downloads/

(6)按介绍过的安装步骤正常安装就可以了。
2. Gitlab服务器备份与恢复
(1). 备份

在/etc/gitlab/gitlab.rb中描述了备份位置。详细信息见如下 :
这里写图片描述
把上面的备份相关配置注释给去掉,去根据情况更改适合自己的位置。

– 修改完成后,执行以下命令让服务器生效。
gitlab-ctl reconfigure

– 执行备份命令:
gitlab-rake gitlab:backup:create

– 自动备份(通过linux自带的crontab进行自动备份)
crontabe -e
这里写图片描述

(2). 还原
##### - 停止相关的服务
[root@c720141 ~]# gitlab-ctl stop unicorn
ok: down: unicorn: 0s, normally up
[root@c720141 ~]# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up
##### - 执行还原
[root@c720141 backups]# gitlab-rake gitlab:backup:restore BACKUP=/var/opt/gitlab/backups/1530000374_2018_06_26_11.0.1
##### - 启动gitlab服务器
[root@c720141 backups]#gitlab-ctl start
3. 导入现有的库
(1)登陆GitLab服务器
(2)点击【New Project】

这里写图片描述

(3)根据需要,在下面红色框中填入适当信息。

这里写图片描述

(4)导入情况如下所示

这里写图片描述
这里写图片描述

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱尚维

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值