天天看點

centos gitlab mysql_CentOS-7下yum安裝GitLab-CE

GitLab介紹

gitlab 不用說,大家都知道是做什麼的,gitlab 分為 Gitlab Community Edition(gitlab社群版又稱gitlab-ce)、Gitlab Enterprise Edition(gitlab企業版又稱gitlab-ee);ce和ee的差別在于ce的功能在ee裡面都有,而EE裡有的功能CE不一定支援。如果要用進階功能,就花錢向gitlab團隊采購吧!!

GitLab架構

centos gitlab mysql_CentOS-7下yum安裝GitLab-CE

GitLab Application Architecture

gitlab使用ruby on rails架構編寫的一個web界面的代碼倉庫管理系統,在運作中使用了資料庫(postgresql[可以使用其他資料庫代替如mysql])、redis、nginx、gitlab-shell等元件來保證gitlab的正常運作。

安裝GitLab

centos中可以直接通過配置yum源然後使用yum進行一鍵安裝

配置yum源

國内可以使用的清華大學的鏡像源安裝GitLab,相關配置及安裝參照:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

以下内容寫入yum源配置檔案:/etc/yum.repos.d/gitlab-ce.repo

[gitlab-ce]

name=Gitlab CE Repository

baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/

gpgcheck=0

enabled=1

安裝

gitlab-ce一鍵安裝後可以利用rpm -ql gitlab-ce查詢其檔案安裝路徑及相關檔案路徑,其預設安裝路徑為/opt/gitlab/、程式資料及配置檔案儲存路徑為/var/opt/gitlab下。

相關預設位置

代碼倉庫儲存位置:/var/opt/gitlab/git-data/repositories/

代碼倉庫備份位置:/var/opt/gitlab/backups/

postgresql資料及配置目錄:/var/opt/gitlab/postgresql/data/

redis預設配置目錄:/var/opt/gitlab/redis

gitlab主要配置檔案:/etc/gitlab/gitlab.rb

yum makecache

yum install -y gitlab-ce

gitlab常見配置

編輯/etc/gitlab/gitlab.rb

修改gitlab運作外部URL預設的通路位址

# 未修gitlab.rb配置檔案中nginx配置時這個配置預設配置gitlab自帶的nginx端口

external_url 'http://172.17.17.10:81'

安裝過程中遇到的問題

502