说明
-
离线安装的原理参见:离线安装:导读
-
离线安装的示例参见:在 CentOS 上离线安装 Kubernetes(k8s)
-
本文以 CentOS 7.9 最小化安装,gitlab-ee 最新版为例(其他 CentOS、gitlab 版本类似)
-
yum 包准备:可通过查阅 在 CentOS 上离线安装 Kubernetes(k8s)
文中的
yum install ***命令在后面添加--downloadonly --downloaddir=./下载的文件夹下载到指定文件夹中获取。 -
有网和没网的系统版本需要是一样的,比如都是 CentOS 7.9 最小化安装
准备(在有网的电脑上执行)
-
准备 bash-completion 安装包(可选,可能已经安装了)
yum -y install bash-completion --downloadonly --downloaddir=./bash-completion -
准备安装 gitlab 所需依赖(可能已经安装了)
sudo yum install -y curl policycoreutils-python openssh-server perl --downloadonly --downloaddir=./gitlab-before -
准备 gitlab 发送邮件的依赖(可选,可能已经安装了)
sudo yum -y install postfix --downloadonly --downloaddir=./postfix -
安装 gitlab-ee 源
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash -
准备 gitlab-ee 安装包
yum install -y gitlab-ee --downloadonly --downloaddir=./gitlab
安装(在没有网络的电脑上执行)
-
将上面准备的安装包上传到没有网络的电脑
-
依次安装下列文件夹中的依赖:bash-completion、gitlab-before、postfix、gitlab。
安装命令
cd ./bash-completion yum -y localinstall *.rpm # yum -y install *.rpm source /etc/profile cd .. cd ./gitlab-before yum -y localinstall *.rpm # yum -y install *.rpm cd .. cd ./postfix yum -y localinstall *.rpm # yum -y install *.rpm cd .. cd ./gitlab yum -y localinstall *.rpm # yum -y install *.rpm cd .. -
配置 gitlab
gitlab-ctl reconfigure -
开放端口
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https # 重载防火墙 sudo systemctl reload firewalld # 查看防火墙已开放的端口与服务 sudo firewall-cmd --list-all -
查看管理员 root 用户的默认密码
# 用户名为 root sudo cat /etc/gitlab/initial_root_password -
其他操作与使用网络直接安装相同