os7安装gitlab

发布于:2024-06-24 ⋅ 阅读:(152) ⋅ 点赞:(0)

gitlab安装要求:os7以上版本,4G内存,磁盘50GB

1.克隆

由于我这里不想影响原来的,所以这里克隆一个os系统。如果其他是第一次安装则不用。

2.修改ip地址

cd /etc/sysconfig/network-scripts

vi ifcfg-ens33

按:insert 输入修改

按:esc 退出,并输入 :wq 保存

3.修改主机名称

cd /etc

vi hostname

按:insert 输入修改

按:esc 退出,并输入 :wq 保存

4.重启

reboot

5.下载:

https://packages.gitlab.com/gitlab/gitlab-ce 

sudo rpm -ivh gitlab-ce-17.1.0-ce.0.el7.x86_64.rpm

在os7上,下面命令会在系统防火墙上打开http、https、和ssh访问、这是一个可选步骤。如果仅在本地访问极狐gitlab则可以跳过下面步骤

sudo yum install -y curl policycoreutils-python openssh-server perl
sudo systemctl enable sshd
sudo systemctl start sshd
#开启http
sudo firewall-cmd --permanent --add-service=http
#开启https
sudo firewall-cmd --permanent --add-service=https
#重启防火墙--测试环境不需要
sudo systemctl reload firewalld

6.初始化gitlab

#配置软件镜像
curl -fsSL https://packages.gitlab.cn/repository/raw/scripts/setup.sh | /bin/bash
#安装 -- 这里的是当前主机的ip
sudo EXTERNAL_URL="https://192.168.64.89" yum install -y gitlab-ce
#初始化
sudo gitlab-ctl reconfigure

7.启动gitlab

#启动
gitlab-ctl start
#停止
gitlab-ctl stop

8.访问

https://192.168.64.89/users/sign_in

http://192.168.64.89/users/sign_in

9.登录

默认用户名:root

密码在这个路径(/etc/gitlab/)的这个文件initial_root_password


网站公告

今日签到

点亮在社区的每一天
去签到