系统硬件配置最低要求为2核4G一 安装1.安装必备组件yum install curl openssh-server openssh-clients postfix cronieservice pos
系统硬件配置最低要求为2核4G一 安装
1.安装必备组件
yum install curl openssh-server openssh-clients postfix cronieservice postfix startchkconfig postfix onlokkit -s http -s ssh
2.添加GitLab源
使用清华大学源https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
vi /etc/yum.repos.d/gitlab-ce.repo[gitlab-ce]name=gitlab-cebaseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6repo_gpgcheck=0gpgcheck=0enabled=1gpgkey=https://packages.gitlab.com/gpg.key
然后执行命令安装和现有环境相同的版本
yum makecacheyum install gitlab-ce-8.6.5
- 配置和启动 GitLab修改对外开放域名或ip
vi /etc/gitlab/gitlab.rb修改 external_url 'http://192.168.4.47'gitlab-ctl reconfigure
- 设置密码登录检查浏览器打开 http://192.168.4.47
二 Gitlab 创建备份
使用Gitlab一键安装包安装Gitlab非常简单, 同样的备份恢复与迁移也非常简单. 使用一条命令即可创建完整的Gitlab备份:
gitlab-rake gitlab:backup:create
自动备份crontab -e加入以下, 实现每周6凌晨2点进行一次自动备份:
0 2 * * 6 /opt/gitlab/bin/gitlab-rake gitlab:backup:create
三 Gitlab 重新安装并恢复
1 重新安装相同版本的gitlab-ce安装完成并启动测试正常
2 将备份存储机上的备份文件拷贝到新安装目录的backups目录下默认是 /var/opt/gitlab/backups/
停止相关数据连接服务
gitlab-ctl stop unicorngitlab-ctl stop sidekiq
从1393513186编号备份中恢复
gitlab-rake gitlab:backup:restore BACKUP=1393513186
启动Gitlab 测试
gitlab-ctl start
ref:https://about.gitlab.com/downloads/#centos6https://segmentfault.com/a/1190000002439923https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/