Gitlab-ce安裝

GitLab介紹
GitLab:是一個(gè)基于Git實(shí)現(xiàn)的在線代碼倉(cāng)庫(kù)托管軟件,你可以用gitlab自己搭建一個(gè)類(lèi)似于Github一樣的系統(tǒng),一般用于在企業(yè)、學(xué)校等內(nèi)部網(wǎng)絡(luò)搭建git私服。
功能:Gitlab 是一個(gè)提供代碼托管、提交審核和問(wèn)題跟蹤的代碼管理平臺(tái)。對(duì)于軟件工程質(zhì)量管理非常重要。
版本:GitLab 分為社區(qū)版(CE) 和企業(yè)版(EE)。
配置:建議CPU2核,內(nèi)存2G以上。

Gitlab的服務(wù)構(gòu)成:
Nginx:靜態(tài)web服務(wù)器。
gitlab-shell:用于處理Git命令和修改authorized keys列表。(Ruby)
gitlab-workhorse: 輕量級(jí)的反向代理服務(wù)器。(go)

GitLab Workhorse是一個(gè)敏捷的反向代理。它會(huì)處理一些大的HTTP請(qǐng)求,比如文件上傳、文件下載、Git push/pull和Git包下載。其它請(qǐng)求會(huì)反向代理到GitLab Rails應(yīng)用,即反向代理給后端的unicorn。

logrotate:日志文件管理工具。
postgresql:數(shù)據(jù)庫(kù)。
redis:緩存數(shù)據(jù)庫(kù)。
sidekiq:用于在后臺(tái)執(zhí)行隊(duì)列任務(wù)(異步執(zhí)行)。(Ruby)
unicorn:An HTTP server for Rack applications,GitLab Rails應(yīng)用是托管在這個(gè)服務(wù)器上面的。(Ruby Web Server,主要使用Ruby編寫(xiě))

GitLab安裝

yum安裝

官方源地址:https://about.gitlab.com/downloads/#centos6
清華大學(xué)鏡像源:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce

添加yum源

cat> /etc/yum.repos.d/gitlab-ce.repo<< EOF
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/  
gpgcheck=0
enabled=1
EOF

安裝依賴(lài)包

yum install curl policycoreutils-python openssh-server

安裝

    yum makecache    #清楚緩存
    yum install gitlab-ce
   
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

  Verifying  : gitlab-ce-11.10.4-ce.0.el7.x86_64                                                                                                                                        1/1 

Installed:
  gitlab-ce.x86_64 0:11.10.4-ce.0.el7                                                                                                                                                       

Complete!

更改訪問(wèn)地址

vim /etc/gitlab/gitlab.rb
external_url 'http://10.10.10.7'

重新加載配置

[root@gitlab ~]#   gitlab-ctl reconfigure

啟動(dòng)gitlab-ce

[root@gitlab ~]# gitlab-ctl start 
ok: run: alertmanager: (pid 11797) 49s
ok: run: gitaly: (pid 11683) 53s
ok: run: gitlab-monitor: (pid 11743) 52s
ok: run: gitlab-workhorse: (pid 11713) 53s
ok: run: logrotate: (pid 11061) 117s
ok: run: nginx: (pid 10999) 123s
ok: run: node-exporter: (pid 11727) 52s
ok: run: postgres-exporter: (pid 11887) 48s
ok: run: postgresql: (pid 10422) 173s
ok: run: prometheus: (pid 11764) 51s
ok: run: redis: (pid 10081) 185s
ok: run: redis-exporter: (pid 11754) 51s
ok: run: sidekiq: (pid 10840) 135s
ok: run: unicorn: (pid 10753) 141s
image.png

第一次進(jìn)入要求設(shè)置密碼

gitlab常用命令

gitlab-ctl start    # 啟動(dòng)所有 gitlab 組件;
2     gitlab-ctl stop        # 停止所有 gitlab 組件;
3     gitlab-ctl restart        # 重啟所有 gitlab 組件;
4     gitlab-ctl status        # 查看服務(wù)狀態(tài);
5     vim /etc/gitlab/gitlab.rb        # 修改gitlab配置文件;
6     gitlab-ctl reconfigure        # 重新編譯gitlab的配置;
7     gitlab-rake gitlab:check SANITIZE=true --trace    # 檢查gitlab;
8     gitlab-ctl tail        # 查看日志;
9     gitlab-ctl tail nginx/gitlab_access.log
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • 我見(jiàn)過(guò)各式各樣的愛(ài)情,有的愛(ài)情,兩個(gè)人在不停的吵架。仿佛用吵架在維系這段感情。但不會(huì)吵的太激烈。有的愛(ài)情,就是...
    墨道煙雨閱讀 370評(píng)論 0 1
  • 大年三十 有沒(méi)有被催婚有 沒(méi)有被外面的炮聲襯出自己的孤獨(dú)感 有沒(méi)有因?yàn)橛珠L(zhǎng)了一歲感到無(wú)助 有沒(méi)有為生活被逼的無(wú)奈 ...
    lucky小石榴閱讀 286評(píng)論 1 7
  • 今天臨摹了心藍(lán)老師的彩鉛。 原圖: 我的臨摹: 總結(jié): 今天涂色比較沉得住氣了,細(xì)細(xì)致致地涂,感覺(jué)效果還好,有進(jìn)步...
    潭心閱讀 842評(píng)論 0 2