软件版本

  1. centos7
  2. gitlab-ce-13.1.4-ce.0.el7.x86_64

下载软件

Gitlab官网
清华大学镜像

  • 我这里使用的是清华大学镜像地址,官网由于网络问题下载很慢

安装

  1. 将下载的gitlab-ce-13.1.4-ce.0.el7.x86_64.rpm文件上传
  2. 运行: $ rpm -ivh gitlab-ce-13.0.5-ce.0.el7.x86_64.rpm 安装
  • 这里遇到一个问题提示依赖没有安装:policycoreutils-python

warning: soft/gitlab-ce-10.7.3-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
error: Failed dependencies:
policycoreutils-python is needed by gitlab-ce-10.7.3-ce.0.el7.x86_64

  • 安装依赖

yum install policycoreutils-python

  1. 不出意外就安装成功了,成功后展示gitlab的logo
  2. 编辑配置文件 $ vi /etc/gitlab/gitlab.rb

external_url ‘http://localhost:8090’ #修改成你自己的IP或域名:端口

  1. 重新编译配置: $ gitlab-ctl reconfigure 过程比较耗时
  2. 启动 $ gitlab-ctl start

异常处理

  1. 访问时报502错误

Whoops, GitLab is taking too much time to respond

  • 可能是端口被占用,将这几行注释打开
unicorn['port'] = 8088
postgresql['shared_buffers'] = "256MB"
postgresql['max_connections'] = 200

gitlab 常用指令

查看版本号: cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

gitlab-ctl reconfigure                            # 重新编译配置
gitlab-ctl start                                  # 启动
gitlab-ctl stop                                   # 停止
gitlab-ctl restart                                # 重启
gitlab-ctl status                                 # 查看状态
vim /etc/gitlab/gitlab.rb                         # 修改配置
gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab
gitlab-ctl tail                                   # 查看日志
gitlab-ctl tail nginx/gitlab_access.log
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐