Centos7搭建Gitlab

1、安装必要依赖、打开防火想配置、配置支持邮件

依赖

sudo yum install -y curl policycoreutils-python openssh-server

Centos7搭建Gitlab_第1张图片打开防火墙和SSH

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

Centos7搭建Gitlab_第2张图片

2、下载包并安装

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

Centos7搭建Gitlab_第3张图片

sudo EXTERNAL_URL="http://对外地址" yum install -y gitlab-ee

Centos7搭建Gitlab_第4张图片

直接访问即可:

Centos7搭建Gitlab_第5张图片 修改相关配置:

cd /etc/gitlab/
vim gitlab.rb 
sudo gitlab-ctl reconfigure
gitlab-ctl restart

2、gitlab的卸载,在准备迁移数据的过程发先,可能需要两个服务器版本相同才能迁移。

  • 停止:
    gitlab-ctl stop
  • 卸载包,注意安装的版本:
    rpm -e gitlab-ee
  • 查看进程,干掉第一个带...
    ps aux | grep gitlab
  • 删除全部文件:
    find / -name gitlab | xargs rm -rf

3、根据版本安装

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.4.8-ce.0.el7.x86_64.rpm

Centos7搭建Gitlab_第6张图片

rpm -Uvh gitlab-ce-11.4.8-ce.0.el7.x86_64.rpm

Centos7搭建Gitlab_第7张图片

4、同步数据

在原数据上导出数据:

gitlab-rake gitlab:backup:create RAILS_ENV=production

路径一般情况下都在:/var/opt/gitlab/backups

在新服务器上执行:

gitlab-rake gitlab:backup:restore RAILS_ENV=production   BACKUP=1644915573_2022_02_15_11.4.8

 

 

你可能感兴趣的:(linux,centos,运维)