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所有的工程目录都在/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 rsab) 将 .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、自动备份