sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
##### 开始安装
vim /etc/hosts
10.24.40.134 git.afcat.com.cn
##### 使用yum安装
bash sudo EXTERNAL_URL="https://git.afcat.com.cn" yum install -y gitlab-ce
gitlab-rake gitlab:env:info
sudo EXTERNAL_URL="https://git.afcat.com.cn" yum install -y gitlab-ce-8.8.5 --nogpgcheck
gitlab-rake gitlab:backup:create STRATEGY=copy
1531878574_gitlab_backup.tar
/var/opt/gitlab/backups
目录/etc/gitlab/gitlab.rb
配置文件vim /etc/gitlab/gitlab.rb
# 设置备份路径
gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
# 设置备份过期时间
gitlab_rails['backup_keep_time'] = 604800
gitlab-ctl reconfigure
/etc/gitlab/gitlab.rb # 配置文件须备份
/etc/gitlab/gitlab-secrets.json # 该文件用于代码解密用,可以不备份,但会出现500错误,下面会有对应500错误的解决方案
/var/opt/gitlab/nginx/conf # nginx配置文件
/etc/postfix/main.cfpostfix # 邮件配置备份
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore BACKUP=1531878574
gitlab-ctl start
gitlab-ctl reconfigure
sudo EXTERNAL_URL="https://git.afcat.com.cn" yum install -y gitlab-ce-8.13.4 --nogpgcheck
sudo EXTERNAL_URL="https://git.afcat.com.cn" yum install -y gitlab-ce-8.17.7 --nogpgcheck
sudo EXTERNAL_URL="https://git.afcat.com.cn" yum install -y gitlab-ce-9.5.10 --nogpgcheck
sudo EXTERNAL_URL="https://git.afcat.com.cn" yum install -y gitlab-ce-10.8.7 --nogpgcheck
sudo EXTERNAL_URL="https://git.afcat.com.cn" yum install -y gitlab-ce-11.3.4 --nogpgcheck
gitlab-rails runner "Project.where.not(import_url:nil).each{|p|p.import_data.destroy if p.import_data}"
run
on resource ‘ruby_block[directory resource: /var/opt/gitlab/git-data/repositories]chmod -R 2770 /var/opt/gitlab/git-data
原文:https://www.cnblogs.com/zengchunyun/p/10958090.html