CentOS 7 安装 gitlab 笔记(在线安装方式)

一、安装和配置必要的依赖项

1、安装必要服务,打开防护墙的 ssh、http、https 的端口

[root@localhost ~]# yum install -y curl policycoreutils-python openssh-server

[root@localhost ~]# systemctl enable sshd
[root@localhost ~]# systemctl start sshd

[root@localhost ~]# firewall-cmd --permanent --add-service=http
[root@localhost ~]# firewall-cmd --permanent --add-service=https
[root@localhost ~]# systemctl reload firewalld

2、安装邮件服务,如果使用其它邮件服务器可跳过此步骤

[root@localhost ~]# yum install postfix
[root@localhost ~]# systemctl enable postfix
[root@localhost ~]# systemctl start postfix

二、添加 gitlab 存储库并安装

1、添加 gitlab 存储库

[root@localhost ~]# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

2、安装 gitlab

[root@localhost ~]# yum install -y gitlab-ee

三、访问 gitlab 并重置密码

直接在浏览器输入域名或IP地址,gitlab的web访问端口默认是80

重置密码后使用root账户登录

访问时如果报502错误

1、查看是否端口被占用,最常见的是8080端口被占用。

修改此文件:/etc/gitlab/gitlab.rb

添加一行:unicorn[‘port’]=8101

执行 gitlab-ctl reconfigure 重新配置 gitlab

[root@localhost ~]# gitlab-ctl reconfigure

执行 gitlab-ctl restart 重启 gitlab

[root@localhost ~]# gitlab-ctl restart

2、查看是否为系统配置不够,例如内存要求至少为4G

如果自己练手搭建可以通过修改交换分区的大小来解决此问题

# 修改swap大小

[root@localhost ~]# dd if=/dev/zero of=/usr/swap bs=512 count=8388616
[root@localhost ~]# mkswap /usr/swap
[root@localhost ~]# sysctl -w vm.swappiness=60
[root@localhost ~]# swapon /usr/swap
[root@localhost ~]# echo “/usr/swap swap swap defaults 0 0” >> /etc/fstab

然后重启 gitlab

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值