运维的那点事javaWeb学习

gitlab安装到优化

2019-08-13  本文已影响87人  无字天书


第一节环境准备

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

第三节新建代码库

第四节测试

[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

结束语:

更多精彩内容持续更新中,关注我微信公众号,有你更精彩。

上一篇 下一篇

猜你喜欢

热点阅读