Gitlab搭建安装及使用中遇到的问题。
一、CentOS7安装gitlab-ce
1.下载及安装rpm软件包。
下载RPM包
curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.9.8-ce.0.el7.x86_64.rpm
安装RPM包
rpm -i gitlab-ce-8.9.8-ce.0.el7.x86_64.rpm
2.修改Gitlab配置文件。
vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.federico.xin:7389'
以上的配置文件是确定gitlab监听的域名以及ip地址,当我们设置完成后执行以下命令将配置写入所有配置文件当中。
重新加载配置文件
gitlab-ctl reconfigure
3.启动Gitlab服务并检查服务是否正常启动。
启动Gitlab
gitlab-ctl start
ok: run: gitlab-workhorse: (pid 5294) 0s
ok: run: logrotate: (pid 5296) 0s
ok: run: nginx: (pid 5300) 0s
ok: run: postgresql: (pid 5302) 0s
ok: run: redis: (pid 5306) 0s
ok: run: sidekiq: (pid 5309) 0s
ok: run: unicorn: (pid 5312) 0s
检查Gitlab进程是否成功启动
ps aux|grep git
git 5271 57.6 11.2 399596 212268 ? Rl 10:29 0:07 ruby /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
git 5294 0.0 0.2 37768 4036 ? Ssl 10:29 0:00 /opt/gitlab/embedded/bin/gitlab-workhorse -listenNetwork unix -listenUmask 0 -listenAddr /var/opt/gitlab/gitlab-workhorse/socket -authBackend http://localhost:8080 -authSocket /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket -documentRoot /opt/gitlab/embedded/service/gitlab-rails/public -pprofListenAddr
root 5296 0.0 0.0 11628 1408 ? Ss 10:29 0:00 /bin/sh /opt/gitlab/embedded/bin/gitlab-logrotate-wrapper
root 5300 0.0 0.1 37608 2920 ? Ss 10:29 0:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
gitlab-+ 5302 0.2 1.8 532352 34240 ? Ss 10:29 0:00 /opt/gitlab/embedded/bin/postgres -D /var/opt/gitlab/postgresql/data
gitlab-+ 5306 0.0 0.4 37400 7864 ? Ssl 10:29 0:00 /opt/gitlab/embedded/bin/redis-server 127.0.0.1:0
git 5309 43.8 3.0 159376 58368 ? Rsl 10:29 0:02 ruby /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/sidekiq -q post_receive -q mailers -q archive_repo -q system_hook -q project_web_hook -q gitlab_shell -q incoming_email -q common -q pages -q elasticsearch -q default -e production -r /opt/gitlab/embedded/service/gitlab-rails -t 4 -c 25
git 5312 0.0 0.0 11632 1516 ? Ss 10:29 0:00 /bin/bash /opt/gitlab/embedded/bin/gitlab-unicorn-wrapper
gitlab-+ 5313 0.0 0.2 41700 5172 ? S 10:29 0:00 nginx: worker process
gitlab-+ 5314 0.0 0.0 37760 1492 ? S 10:29 0:00 nginx: cache manager process
gitlab-+ 5315 0.0 0.0 37760 1492 ? S 10:29 0:00 nginx: cache loader process
gitlab-+ 5330 0.0 0.0 532584 1184 ? Ss 10:29 0:00 postgres: checkpointer process
gitlab-+ 5331 0.0 0.0 532584 1192 ? Ss 10:29 0:00 postgres: writer process
gitlab-+ 5332 0.0 0.0 532584 944 ? Ss 10:29 0:00 postgres: wal writer process
gitlab-+ 5333 0.0 0.1 533572 2384 ? Ss 10:29 0:00 postgres: autovacuum launcher process
gitlab-+ 5334 0.0 0.0 26556 1264 ? Ss 10:29 0:00 postgres: stats collector process
git 5339 0.0 0.0 4308 344 ? S 10:29 0:00 sleep 1
gitlab-+ 5340 0.0 0.4 638200 7964 ? Ss 10:29 0:00 postgres: gitlab gitlabhq_production [local] idle
root 5342 0.0 0.0 112656 960 pts/0 S+ 10:29 0:00 grep --color=auto git
root 32239 0.0 0.0 4328 488 ? Ss 09:41 0:00 runsvdir -P /opt/gitlab/service log: ...........................................................................................................................................................................................................................................................................................................................................................................................................
root 32260 0.0 0.0 4320 540 ? S 09:41 0:00 svlogd -tt /var/log/gitlab/redis
root 32343 0.0 0.0 4320 536 ? S 09:41 0:00 svlogd -tt /var/log/gitlab/postgresql
root 32426 0.0 0.0 4320 540 ? S 09:42 0:00 svlogd -tt /var/log/gitlab/unicorn
root 32458 0.0 0.0 4320 544 ? S 09:42 0:00 svlogd -tt /var/log/gitlab/sidekiq
root 32468 0.0 0.0 4176 344 ? Ss 09:42 0:00 runsv gitlab-workhorse
root 32469 0.0 0.0 4320 540 ? S 09:42 0:00 svlogd -tt /var/log/gitlab/gitlab-workhorse
root 32475 0.0 0.0 4320 340 ? S 09:42 0:00 svlogd -tt /var/log/gitlab/nginx
root 32487 0.0 0.0 4320 540 ? S 09:42 0:00 svlogd -tt /var/log/gitlab/logrotate
以上,我们已经将Gitlab服务启动完成,并监听在7389端口,下面我们开始配置前端nginx反向代理Gitlab。
二、配置Nginx反向搭理Gitlab
1.修改Nginx配置文件
vim /etc/nginx/conf.d/gitlab.conf
upstream git{
server ip:port;
}
server{
listen 80;
server_name gitlab.federico.xin;
location / {
client_max_body_size 500m;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://git;
index index.html index.htm;
}
}
2.检查并重启Nginx
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
nginx -s reload
三、使用Gitlab过程中遇到的各种问题以及解决措施
1.fatal: The remote end hung up unexpectedly
在push代码到库时,出现上述报错,原因是因为上传的git包过大,可以通过以下设置解决此问题。
git config http.postBuffer 524288000
2.error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
出现以上问题同样是因为上传软件包过大,需要我们在nginx参数中进行调整设置文件传输大小的限制。需要注意的是,如果是反向代理的Gitlab需要我们将两台服务器的nginx都进行设置。
grep -r "client_max_body_size" /var/opt/gitlab/
/var/opt/gitlab/nginx/conf/gitlab-http.conf: client_max_body_size 500M;
/var/opt/gitlab/nginx/conf/nginx.conf: client_max_body_size 50m;
vim /var/opt/gitlab/nginx/conf/nginx.conf
client_max_body_size 500m;
nginx -t
nginx -s reload
Gitlab搭建安装及使用中遇到的问题。的更多相关文章
- Ubuntu18.04安装GitLab搭建私有仓库服务器过程笔记
百度了很多资料结果折腾很久还没安装成功,索性就直接上官网找文档参考顺利搭建完成 因为有2台服务器做练习,总结了2种安装方式提供参考:第一种官网安装方式,第二种国内镜像安装方式(建议采用第二种) 第 ...
- gitlab一键安装 (转)
原文地址:http://www.2cto.com/os/201411/353292.html 0 简介bitnami和gitlab bitnami BitNami是一个开源项目,该项目产生的开源软件包 ...
- 用GitLab搭建自己的私有GitHub
相信很多技术人员都知道有个github造福开发人员的git(分布式版本管理工具)代码管理社区,可以说现在git是开发人员的必备技能之一 本周有个朋友公司需要一个类似github的代码仓库管理系统,本人 ...
- Jenkins+Gitlab搭建持续集成(CI)环境
利用Jenkins+Gitlab搭建持续集成(CI)环境 Permalink: 2013-09-08 22:04:00 by hyhx2008in intern tags: jenkins gitla ...
- GitLab搭建详细过程
一.前提 系统:Centos 6.5 软件版本:gitlab-7.8.4 Selinux:关闭 防火墙规则:先清空(搭建好了后续自己添加相关放行规则) 二.yum源配置和相关依赖包 1.添加epel源 ...
- CentOS 7.x上gitlab搭建教程(https可用,邮件可用)
目录 知识要求 搭建感想 搭建过程 参考 知识要求: nginx基础知识 搭建感想 注:以下是我搭建gitlab时的思考,需要nginx的基础知识,Docker的基础知识才容易理解,与下面的搭建过程是 ...
- Gitlab的安装与实践
tucao 先让我来吐槽一下下,使用GitHub以及Bitbucket比较不太稳定,尤其是后者,可以说是极其不稳定,甚至无法克隆仓库到本地.因此,决定安装一款开源且免费的Git服务到自己的服务器主机上 ...
- CentOS 7下GitLab搭建及配置
由于公司业务,需要上Git版本控制. * 目前市面上比较有名的Git服务提供商,国外有GitHub.BitBucket.GitLab,国内有码云,Coding. * 现有的服务商,对于免费的套餐都有一 ...
- CentOS 7 系统下 GitLab 搭建
参考地址:https://blog.csdn.net/t748588330/article/details/79915003 1. 安装:使用 GitLab 提供仓库在线安装 curl -sS htt ...
随机推荐
- 运行 命令框不记录打过的命令,重启后CMD里面是空的.上次打过的命令消失了.
问题: 常要用到PING命令.在cmd中输入ping 202.103.44.150 /t (这是当地的电信DNS) 用这个查看网络是不是正常.正常情况下次点开始运行的时候,运行命令框中应该 会有上次打 ...
- 【校招面试 之 C/C++】第30题 C++ 11新特性(一)之auto关键字
1.自动类型推断 auto自动类型推断,用于从初始化表达式中推断出变量的数据类型.通过auto的自动类型推断,可以大大简化我们的编程工作.下面是一些使用auto的例子. #include <ve ...
- Python学习记录day8
目录 Python学习记录day8 1. 静态方法 2. 类方法 3. 属性方法 4. 类的特殊成员方法 4.1 __doc__表示类的描述信息 4.2 __module__ 和 __class__ ...
- 42-python中的矩阵、多维数组----numpy
xzcfightingup python中的矩阵.多维数组----numpy 1. 引言 最近在将一个算法由matlab转成python,初学python,很多地方还不熟悉,总体感觉就是上手容易, ...
- ADF学习实用网站
ADF中所有组件工功能例子 http://jdevadf.oracle.com/adf-richclient-demo/faces/components/dialog.jspx;jsessionid= ...
- 超星网站cc++
a系统 苏龙杰 a系统 苏龙杰 目录 1 C/C ++程序设计 1.1 前 言 1.2 第一部分 基 础 篇 1.2.1 第1章 初识C 1.2.1.1 1.1 C语言的诞生与发展 1 ...
- PHP在win7安装Phalcon框架
我的环境是64位的 Win7. 安装 Phalcon 也极其简单,只需要下载一个文件(php_phalcon.dll), 要以 phpinfo() 里面“Architecture”属性为准! 下载地址 ...
- Luogu 3959 [NOIP2017] 宝藏
NOIP2017最后一道题 挺难想的状压dp. 受到深度的条件限制,所以一般的状态设计带有后效性,这时候考虑把深度作为一维,这样子可以保证所有状态不重复计算一遍. 神仙预处理:先处理出一个点连到一个集 ...
- 我所理解的 Laravel 请求 生命周期
转载自:https://laravel-china.org/topics/3343/my-understanding-of-the-laravel-request-life-cycle 当你使用一个工 ...
- Android 编译参数 LOCAL_MODULE_TAGS
此参数会影响到库生成后的存放位置,影响生成位置的应该是相关平台下的变量PRODUCT_PACKAGES http://blog.csdn.net/evilcode/article/details/64 ...