gitlab安裝到優化

1240

第一節環境準備

1、gitlab軟件

gitlab-ce-11.9.9-ce.0.el7.x86_64.rpm

[root@gitlab-119 iso]# cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

服務端:gitlab-119

客戶端:jenkins100

2、實驗前提

[root@gitlab-119~]# systemctl stop firewalld

[root@gitlab-119~]# systemctl disable firewalld

[root@gitlab-119~]# setenforce 0

[root@gitlab-119~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

第二節安裝配置

1、安裝

[root@gitlab-119 iso]# wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.9.9-ce.0.el7.x86_64.rpm

[root@gitlab-119 iso]# yum -y install gitlab-ce-11.9.9-ce.0.el7.x86_64.rpm

2、配置優化

[root@gitlab-119 ~]# vim /etc/gitlab/gitlab.rb

external_url 'http://192.168.68.119'          #我沒有搭建dns,直接填ip

unicorn['worker_timeout'] = 60

unicorn['worker_processes'] = 2               #官方建議cpu核數加1

unicorn['worker_memory_limit_min'] = "200 * 1 << 20"

unicorn['worker_memory_limit_max'] = "300 * 1 << 20"

postgresql['shared_buffers'] = "256MB"

postgresql['max_worker_processes'] = 8

[root@gitlab-119 ~]# gitlab-ctl reconfigure

[root@gitlab-119 ~]# gitlab-ctl start

ok: run: alertmanager: (pid 3602) 834s

ok: run: gitaly: (pid 3510) 835s

ok: run: gitlab-monitor: (pid 3601) 834s

ok: run: gitlab-workhorse: (pid 3553) 834s

ok: run: logrotate: (pid 3609) 834s

ok: run: nginx: (pid 3591) 834s

ok: run: node-exporter: (pid 3603) 834s

ok: run: postgres-exporter: (pid 3599) 834s

ok: run: postgresql: (pid 3538) 834s

ok: run: prometheus: (pid 3607) 834s

ok: run: redis: (pid 3437) 835s

ok: run: redis-exporter: (pid 3593) 834s

ok: run: sidekiq: (pid 3544) 834s

ok: run: unicorn: (pid 3548) 834s

第三節新建代碼庫


1240

1240

1240

1240

1240


第四節測試

[root@jenkins100 ~]# git clone http://192.168.68.119/root/test.git

[root@jenkins100 ~]# cd test/

[root@jenkins100 test]# ls

README.md

[root@jenkins100 test]# echo 'test jenkins!!!!' > index.html

[root@jenkins100 test]# git add .

[root@jenkins100 test]# git commit -m 'test commit'

[master dd54522] test commit

1 file changed, 1 insertion(+)

create mode 100644 index.html

[root@jenkins100 test]# git push

查看gitlab

1240


結束語:

更多精彩內容持續更新中,關注我微信公衆號,有你更精彩。

1240



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