centos7 安裝gitlab,親測可用

使用centos安裝gitlab後,運行reconfigure出現問題:

Error executing action `run` on resource 'execute[semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp]

網上找了很多方案, sudo yum install libsemanage-static libsemanage-devel ,增加激活swap,親測統統不好用 = =。

最後,關掉SELinux,並重啓後,好用了。主要步驟如下:

一、官網安裝步驟(安裝好的略過直接看二)

  • 1. 安裝和配置必須的依賴項

    On CentOS 7, the commands below will also open HTTP, HTTPS and SSH access in the system firewall.

    sudo yum install -y curl policycoreutils-python openssh-server perl
    sudo systemctl enable sshd
    sudo systemctl start sshd
    sudo firewall-cmd --permanent --add-service=http
    sudo firewall-cmd --permanent --add-service=https
    sudo systemctl reload firewalld

    接下來安裝用於發送郵件通知的Postfix。

    sudo yum install postfix
    sudo systemctl enable postfix
    sudo systemctl start postfix

    在安裝Postfix的過程中可能會出現一個配置界面,在該界面中選擇‘Internet Site’並按下回車。把‘mail name’設置爲您服務器的外部DNS域名並按下回車。如果還有其它配置界面出現,繼續按下回車以接受默認配置。

    2. 下載極狐GitLab安裝包

    執行如下命令下載極狐GitLab安裝包:

    wget https://omnibus.gitlab.cn/el/7/gitlab-jh-14.1.1-jh.0.el7.x86_64.rpm

    3. 安裝極狐GitLab安裝包

    在極狐GitLab安裝包下載完成後,執行如下命令安裝它:

    sudo rpm -Uvh gitlab-jh-14.1.1-jh.0.el7.x86_64.rpm

     

    *注意: 如果您是初次安裝極狐GitLab,您需要在上述命令的前面指定 EXTERNAL_URL="" 來設置您所希望使用的域名(比如:http://mygitlab.example.com ),上述命令會自動把極狐GitLab配置和啓動該域名上。啓用HTTPS的步驟將在稍後提供。*

    4. 登錄

    安裝完畢後,在您通過瀏覽器初次訪問極狐GitLab時,您將會看到一個重置密碼的頁面,當您在該頁面設置好初始管理員賬號的密碼後,您將會被跳轉至登錄頁面。請使用默認賬號 root 及您設置的密碼登錄極狐GitLab。

二、 安裝後配置運行(重點)

1.首先說一下gitlab配置文件,/etc/gitlab/gitlab.rb

默認安裝其他不需要修改,先修改 external_url 'http://IP:10000',修改ip+端口後不需要其他任何修改,優化後期再說

2.查看自己的SELinux狀態

[root@server ~]# getenforce
Disabled
[root@server ~]# /usr/sbin/sestatus -v
SELinux status:                 disabled

3.永久關閉, 可以修改配置文件/etc/selinux/config,將其中SELINUX設置爲disabled

4.重啓服務器

[root@server ~]# reboot

5.重新配置

[root@server ~]# gitlab-ctl reconfigure

6.啓動gitlab

[root@server ~]# gitlab-ctl start
ok: run: alertmanager: (pid 19937) 58s
ok: run: gitaly: (pid 19766) 61s
ok: run: gitlab-exporter: (pid 19754) 61s
ok: run: gitlab-workhorse: (pid 19710) 63s
ok: run: grafana: (pid 20132) 51s
ok: run: logrotate: (pid 16854) 170s
ok: run: nginx: (pid 16708) 176s
ok: run: node-exporter: (pid 19724) 62s
ok: run: postgres-exporter: (pid 19952) 58s
ok: run: postgresql: (pid 13162) 331s
ok: run: prometheus: (pid 19792) 60s
ok: run: puma: (pid 16220) 194s
ok: run: redis: (pid 12634) 348s
ok: run: redis-exporter: (pid 19760) 61s
ok: run: sidekiq: (pid 16369) 188s

終於好用了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章