安装说明:本文只是用来给微服务当配置中心,只是较浅的记录一下安装步骤,后面会详细讲解及在docker上面的安装。python
在CentOS 7(和RedHat / Oracle / Scientific Linux 7)上,如下命令还将在系统防火墙中打开HTTP,HTTPS和SSH访问。nginx
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 firewall-cmd --permanent --add-service=https sudo systemctl reload firewalld
接下来,安装Postfix以发送通知电子邮件。若是要使用其余解决方案发送电子邮件,请跳过此步骤, 并在安装GitLab以后配置外部SMTP服务器。git
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
在安装Postfix的过程当中,可能会出现一个配置屏幕。选择“ Internet网站”,而后按Enter。使用服务器的外部DNS做为“邮件名”,而后按Enter。若是出现其余屏幕,请继续按Enter接受默认设置。docker
添加GitLab软件包存储库。centos
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
接下来,安装GitLab软件包。更改https://gitlab.example.com
为您要访问GitLab实例的URL。安装将自动配置并在该URL上启动GitLab。bash
对于https://
URL,GitLab将使用Let's Encrypt自动请求证书,这须要入站HTTP访问和有效的主机名。您也能够使用本身的证书或仅使用http://。服务器
sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
须要从官网下载 gitlab-ce-12.4.0-ce.0.el7.x86_64.rpm(ce为社区版,和ee没有太大区别)ssh
而后按照上面的步骤进行安装curl
sudo rpm -ivh gitlab-ce-12.4.0-ce.0.el7.x86_64.rpm 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 firewall-cmd --permanent --add-service=https sudo systemctl reload firewalld sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
初始化配置 gitlab gitlab-ctl reconfigure 启动 gitlab 服务 gitlab-ctl start 中止 gitlab 服务 gitlab-ctl stop
测试