centos 安装giblab
本文章转载自:http://www.cnblogs.com/fanjingfeng/p/6665597.html
一, 服务器快速搭建gitlab方法
可以参考gitlab中文社区 的教程
centos7安装gitlab:https://www.gitlab.cc/downloads/#centos7
centos6安装gitlab:https://www.gitlab.cc/downloads/#centos6
如下方法按照官网来操作,手工安装过于麻烦。当前测试平台为小鸟云的三个月centos 7测试机.
1. 安装配置依赖项
如想使用Postfix来发送邮件,在安装期间请选择’Internet Site’. 您也可以用sendmai或者 配置SMTP服务 并 使用SMTP发送邮件.在 Centos 6 和 7 系统上, 下面的命令将在系统防火墙里面开放HTTP和SSH端口.

sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

这里可以自己yum 一个iptables做处理,一样的效果。 2. 添加GitLab仓库,并安装到服务器上
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
如果你不习惯使用命令管道的安装方式, 你可以在这里下载 安装脚本 或者 手动下载您使用的系统相应的安装包(RPM/Deb) 然后安装
curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-XXX.rpm
rpm -i gitlab-ce-XXX.rpm
3. 启动GitLab
- sudo gitlab-ctl reconfigure
下边就可以访问了:
重置下密码。登录效果如下: 
注意事项以及异常故障排查:
1,按照该方式,我安装了一个确实没问题,只不过是英文版。没有经过汉化。
2,默认安装登录需要重置root密码。可以自己单独设置一个复杂密码后登录。
3,gitlab本身采用80端口,如安装前服务器有启用80,安装完访问会报错。需更改gitlab的默认端口。 修改vim /etc/gitlab/gitlab.rb: external_url ‘http://localhost:90’
4,unicorn本身采用8080端口,如安装前服务器有启用8080,安装完访问会报错。需更改unicorn的默认端口。 修改 /etc/gitlab/gitlab.rb: unicorn[‘listen’] = ‘127.0.0.1’ unicorn[‘port’] = 3000
5,每次重新配置,都需要执行sudo gitlab-ctl reconfigure 使之生效。
6,日志位置:/var/log/gitlab 可以进去查看访问日志以及报错日志等,供访问查看以及异常排查。 gitlab-ctl tail #查看所有日志 gitlab-ctl tail nginx/gitlab_access.log #查看nginx访问日志
二,gitlab中文汉化 1,需要下载汉化包,我们这里直接到去git一个。如果没安装git的请自行yum或apt-get 一个git。 比如我们现在到/usr/local/src,执行如下命令去git clone包:
- git clone https://github.com/larryli/gitlabhq.git
2,停止当前gitlab
- gitlab-ctl stop
- \cp /usr/local/src/gitlabhq/* /opt/gitlab/embedded/service/gitlab-rails/ -rf
其中有两个提示我们可以忽略: cp: cannot overwrite non-directory `/opt/gitlab/embedded/service/gitlab-rails/log’ with directory `./log’ cp: cannot overwrite non-directory `/opt/gitlab/embedded/service/gitlab-rails/tmp’ with directory `./tmp’ 好了,汉化完成,重新启动gitlab,汉化完成。
三,日常管理
gitlab-ctl start|stop|status|restart 比如查看状态:
- [root@21yunwei gitlab]# gitlab-ctl status
- run: gitlab-workhorse: (pid 19922) 665s; run: log: (pid 19159) 725s
- run: logrotate: (pid 19179) 723s; run: log: (pid 19178) 723s
- run: nginx: (pid 19166) 724s; run: log: (pid 19165) 724s
- run: postgresql: (pid 19026) 760s; run: log: (pid 19025) 760s
- run: redis: (pid 18943) 766s; run: log: (pid 18942) 766s
- run: sidekiq: (pid 19149) 732s; run: log: (pid 19148) 732s
- run: unicorn: (pid 20257) 642s; run: log: (pid 19116) 734s
四,启动日志
Recipe: gitlab::redis-exporter
* ruby_block[reload redis-exporter svlogd configuration] action create
- execute the ruby block reload redis-exporter svlogd configuration
Recipe: gitlab::prometheus
* service[prometheus] action restart
- restart service service[prometheus]
* ruby_block[reload prometheus svlogd configuration] action create
- execute the ruby block reload prometheus svlogd configuration
Recipe: gitlab::postgres-exporter
* service[postgres-exporter] action restart
- restart service service[postgres-exporter]
* ruby_block[reload postgres-exporter svlogd configuration] action create
- execute the ruby block reload postgres-exporter svlogd configuration
Running handlers:
Running handlers complete
Chef Client finished, 256/510 resources updated in 02 minutes 05 seconds
gitlab Reconfigured!
看到gitlab Reconfigured! 说明启动成功!
要是一直卡到ruby_block[supervise_redis_sleep] action run 运行一下命令
解决方案:
1、按住CTRL+C强制结束;
2、运行:sudo systemctl restart gitlab-runsvdir;
3、再次执行:sudo gitlab-ctl reconfigure
解决方案来源:https://gitlab.com/gitlab-org/omnibus-gitlab/issues/160
centos 安装giblab的更多相关文章
- CentOS安装gitlab,gerrit,jenkins并配置ci流程
CentOS安装gitlab,gerrit,jenkins并配置ci流程 By Wenbin juandx@163.com 2016/4/9 这是我参考了网上很多的文档,配置了这三个软件在一个机器上, ...
- 【推荐】CentOS安装Subversion-1.8.11+HTTP协议支持配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. 我们需要搭建一个自己的SVN服务器. 此外,搭建好的SVN服务器除了需要支持svn协议外,最好还需要支持HTTP协议和HTTPS协 ...
- 【推荐】CentOS安装PHP-5.6.4+扩展安装+安全配置+性能配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 前段时间PHP官方发布了一个重要的安全升级公告,修复了两个unserialize函数的严重漏洞,目前受影响的版本有: ...
- CentOS安装Apache-2.4.10+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Nginx之前,请确保已经使用yum安装了各基础组件,并且配置了www用户和用户组,具体见<CentOS ...
- CentOS安装Nginx-1.6.2+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Nginx之前,请确保已经使用yum安装了pcre等基础组件,具体见<CentOS安装LNMP环境的基础 ...
- CentOS安装MySQL-5.6.10+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装MySQL之前,请确保已经使用yum安装了各类基础组件,具体见<CentOS安装LNMP环境的基础组件& ...
- 转: CentOS 安装 SVN1.8 客户端
from: http://blog.csdn.net/clementad/article/details/46898091 CentOS 安装SVN客户端 标签: subversionrpmcent ...
- CentOS安装gitLab服务器
首先利用gitlab-install-el6.sh安装,比较简单: (出处:http://www.linuxidc.com/Linux/2013-06/85754.htm) 1:如果有条件,提供一台全 ...
- 【推荐】CentOS安装Tomcat-7.0.57+启动配置+安全配置+性能配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Tomcat之前,请确保已经安装了JDK-1.7环境,具体见<CentOS安装JDK-1.7>. ...
随机推荐
- Project Euler 92:Square digit chains C++
A number chain is created by continuously adding the square of the digits in a number to form a new ...
- Spring Boot Maven Plugin(二):run目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- 用户登陆注册【JDBC版】
前言 在讲解Web开发模式的时候,曾经写过XML版的用户登陆注册案例!现在在原有的项目上,使用数据库版来完成用户的登陆注册!如果不了解的朋友,可以看看我Web开发模式的博文! 本来使用的是XML文件作 ...
- Java通过链表实现队列
class LinkedQueue<T> { /** * 队列大小,由构造函数初始化 */ private int maxSize; /** * 队头 */ private Node fr ...
- JSP页面格式化数字或时间 基于jstl的
jsp页面格式化数字或时间 转载自: http://blog.csdn.net/hakunamatata2008/archive/2011/01/21/6156203.aspx Tags fmt:re ...
- IDEA 2 的注册码
43B4A73YYJ-eyJsaWNlbnNlSWQiOiI0M0I0QTczWVlKIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiI ...
- 策略模式Strategy
定义一系列的算法,把他们封装起来,使得算法独立于适用对象. 比如,一个系统有很多的排序算法,但是使用哪个排序算法是客户对象的自有.因此把每一个排序当做一个策略对象,客户调用哪个对象,就使用对应的策略方 ...
- ThinkPHP中:检查Session是否过期
1.创建Session public function index(){ $sess_time=time(); session('name','andy'); session('time_stamp' ...
- ADALINE模型
ADALINE模型即自适应线性单元(Adaptive Linear Neuron),主要用于信号处理中的自适应滤波.预测和模式识别.其结构图如下 输入向量X=(x0,x1,x2,...,xn)T每个输 ...
- HIT 1917 Peaceful Commission
这道题题意就是给你n对人,一对中编号为x,x+1,给你m对矛盾,表示这两个人不能同时选. 然后就是Two-Sat的模板题了,就是根据对称性,连边,加缩点,最后拓扑排序,求出一组可行解就可以了. #in ...