gitlab安装 备份 恢复

1、gitlab官网下载

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

2、依据官网下载说明执行

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce	#下载非常慢,找到一个国内镜像源

找到

/gitlab-ce/yum/el6/

执行wget url即可

安装 Confure and start GitLab
3. C
sudo gitlab-ctl reconfigure
onfigure and start GitLab
输入gitlab安装服务器地址:192.168.1.xx即可访问



注册账号:




3、Gitlab配置更改

gitlab所有的工程目录都在/var/opt/gitlab/

# ls /var/opt/gitlab/

所有的配置在/etc/gitlab/gitlab.rb中修改,修改完配置后执行gitlab-ctl reconfigure生效

4、备份

gitlab-rake gitlab:backup:create

默认备份文件路径:/var/opt/gitlab/backups

小技巧:查看默认备份路径 grep -n "gitlab_rails" gitlab.rb

gitlab修改备份路径

修改/etc/gitlab/gitlab.rb文件

gitlab_rails['backup_path'] = '/mnt/backups'

linux服务器间远程copy: scp 1473824454_gitlab_backup.tar root@192.168.1.21:/opt

5、设置linux下用scp传输无需输入密码文件

a)  在主机A上执行如下命令来生成配对密钥:

ssh-keygen -t rsa

b)  将 .ssh 目录中的 id_rsa.pub 文件复制到 主机B 的 ~/.ssh/ 目录中,并改名为  authorized_keys。

scp .ssh/id_rsa.pub 10.0.6.132:/root/.ssh/authorized_keys

 

以后从A主机scp到B主机就不需要密码了。

6、自动备份





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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值