CentOS7 安裝部署GitLab伺服器

2021-08-21 03:09:03 字數 2614 閱讀 5003

一,安裝   安裝,2:連線出錯502 3:解決ok安裝,2:連線出錯502 3:解決ok
502 

gitlab is not responding.

please contact your gitlab administrator if this problem persists.

一、安裝中 安裝依賴軟體

yum -y install policycoreutils openssh-server openssh-clients postfix

2.設定postfix開機自啟,並啟動,postfix支援gitlab發信功能

systemctl enable postfix && systemctl start postfix

wget

rpm -i gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm

4.修改gitlab配置檔案指定伺服器ip和自定義埠:

退出並儲存

ps:注意這裡設定的埠不能被占用,預設是8080埠,如果8080已經使用,請自定義其它埠,並在防火牆設定開放相對應得埠

5.重置並啟動gitlab

執行:gitlab-ctl reconfigure

提示「ok: run:」表示啟動成功

6.緊接著訪問 gitlab頁面  502出錯

gitlab is not responding.
三,安裝中出現的問題

gitlab-ctl tail unicorn #檢視gitlab 服務啟動日誌
來跟蹤unicorn的狀態,這時候悲催的發現原來時8080埠被占用了

聽說 gitlab 安裝中會出現的問題還是比較多的,不過在我安裝的過程中好像沒有遇到多少問題!

1,在瀏覽器中訪問gitlab出現502錯誤

首先就是埠占用問題,gitlab 啟動會使用 80 埠,所以建議你在啟動 gitlab 前先將不需要的服務都關掉,或者修改預設埠:

sudo vim /etc/gitlab/gitlab.rb
修改external_url,直接增加埠號即可,比如我這裡用8800埠:

external_url 'http://localhost:8800'
然後執行:

sudo gitlab-ctl reconfigure   #依然會提示埠占用,,繼續第二步 修改listen與port
2,8080埠衝突

除了 80 這個埠外,還有乙個unicorn用的埠,預設是8080,如果8080埠被其他程式占用。那麼unicorn就會無法啟動,顯示為502錯誤,」gitlab is not responding」。

解決辦法:修改 /etc/gitlab/gitlab.rb

unicorn['listen'] = '127.0.0.1'

unicorn['port'] = 8801 #此處監聽ip和port與上面external_url 不能一致。。本人就是因為設定一致導致出現一直出現埠占用。。。

然後執行:

gitlab-ctl reconfigur

gitlab-ctl restart

四,gitlab 常用命令

gitlab-ctl start

gitlab-ctl stop

gitlab-ctl status

gitlab-ctl restart

gitlab 預設的日誌檔案存放在/var/log/gitlab 目錄下:

gitlab-rake gitlab:check sanitize=true --trace    # 檢查gitlab;

gitlab-ctl tail #檢視所有日誌

gitlab-ctl tail nginx/gitlab_access.log #檢視nginx訪問日誌

2: 指令:

ClikHouse安裝部署 Centos7

centos7安裝clickhouse wget content disposition wget content disposition wget content disposition wget content disposition wget content disposition wget ...

CentOS 7安裝部署GitLab

最近公司換了新的 伺服器,之前伺服器是在亞馬遜上,相對貴點,為了節約成本這次換到了國內的雲伺服器 公司把git私服也換了,之前用的gitblit,此次更新到了gitlab ce 社群版 特此記錄下安裝 部署的過程。相對來說gitlab的功能以及介面等,都要比gitblit好一些 但是就安裝來說,gi...

Centos7 安裝部署gitlab

1 安裝依賴軟體 yum y install policycoreutils openssh server openssh clients postfix 2 設定postfix開機啟動,啟動postfix。systemctl enable postfix systemctl start postf...