vim /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key yum clean all yum makecache yum install curl openssh-server openssh-clients postfix cronie –y service postfix start 启动服务 chkconfig postfix on 设置开机启动 yum install gitlab-ce –y 社区版 yum install gitlab-ce [可指定版本] yum install gitlab-ce-9.3.0 (指定安装9.3.0版本的gitlab 因为151是9.3.0版本 如果想做数据恢复 就必须安装9.3.0) gitlab-ctl reconfigure //重新编译 gitlab-ctl start //启动 |
#备份 gitlab-rake gitlab:backup:create #修改备份路径 vim /etc/gitlab/gitlab.rb gitlab_rails['backup_path'] = '/mnt/backups' #自动备份 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create #如要修改备份周期和目录,在/etc/gitlab/gitlab.rb中修改以下两个选项(修改配置后记得运行gitlab-ctl reconfigure) # 设置备份周期为7天 - 604800秒,计算器自己计算7天默认的 gitlab_rails['backup_keep_time']= 604800 # 备份目录的修改 gitlab_rails['backup_path']= '/backups' #Gitlab 恢复 # 停止相关数据连接服务 gitlab-ctl stop unicorn gitlab-ctl stop sidekiq # 从1393513186编号备份中恢复 gitlab-rake gitlab:backup:restore BACKUP=1393513186 gitlab-ctl stop ps aux | grep gitlab | grep -v 'grep' | awk '{print $2}' | xargs kill -9 //关闭所有gitlab进程 gitlab-ctl reconfigure //重新编译 # 启动Gitlab sudo gitlab-ctl start |
#完全卸载 (不完全的卸载会导致重装之后无法生效) gitlab-ctl stop gitlab-ctl stop ps aux | grep gitlab ps aux | grep gitlab | grep -v 'grep' | awk '{print $2}' | xargs kill -9 find / -name gitlab | xargs rm -rf |