centos安装gitlab

1.打开系统防火墙 HTTP 和 SSH 的访问,安装postfix

sudo yum install curl policycoreutils policycoreutils-python 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

2.下载gitlab rpm安装文件

crul下载:

> curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
> sudo yum install gitlab-ce-10.1.0-ce.0.el7.x86_64

rpm下载

curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.1.0-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-10.1.0-ce.0.el7.x86_64.rpm

如果下载失败,可以到https://packages.gitlab.com/gitlab/gitlab-ce手动下载,再用 rpm的方式自己安装

出现 It looks like… 表示安装成功!

3.配置 gitlab 

vi /etc/gitlab/gitlab.rb

把external_url改成部署机器的域名或者IP地址。

4.对GitLab进行重配置 (这一步也是启动 GitLab)

gitlab-ctl reconfigure

 

遇到的坑:

ruby_block[supervise_redis_sleep] action run,会一直卡无法往下进行

解决方案:

1、按住CTRL+C强制结束;

2、运行:sudo systemctl restart gitlab-runsvdir;

3、再次执行:sudo gitlab-ctl reconfigure

 

PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure
(See full trace by running task with --trace)
STDERR:
---- End output of "bash" "/tmp/chef-script20171027-3190-3qzkrj" ----
Ran "bash" "/tmp/chef-script20171027-3190-3qzkrj" returned 1

找不到文件 /var/opt/gitlab/postgresql/.s.PGSQL.5432

怀疑可能是执行的时候没有权限创建

sudo chmod 755 postgresql/

 

 

参考:

1.http://blog.csdn.net/u011241606/article/details/51471367

2.https://www.gitlab.cc/installation/#centos-7

3.http://www.cnblogs.com/springwind2006/p/6872773.html

4.https://isempty.me/archives/605

 

posted @ 2017-10-25 15:29  Gyoung  阅读(8867)  评论(0编辑  收藏  举报