gitlab官网有提供一键安装包,进入 ,然后点击“Chose an OS", 根据自己的服务器版本选择,我选择了CentOS 6。选择之后会给出一系列命令,按顺序执行即可。
首先安装依赖包:
sudo yum install openssh-server
sudo yum install postfix
sudo yum install cronie
sudo service postfix start
sudo chkconfig postfix on
然后下载安装包并安装
curl -O
sudo rpm -i gitlab-7.7.2_omnibus.5.4.2.ci-1.el6.x86_64.rpm
执行的时候可能会报连接错误的问题,可以直接通过浏览器将将安装包下载下来,然后通过ftp等方式将安装包上传到服务器上即可。
最后执行配置命令:
sudo gitlab-ctl reconfigure
sudo lokkit -s http -s ssh
如果没有问题gitlab就安装好了,但一般是会有问题的,进入里面会列举一些常见的问题及解决方式。
如,安装完后运行sudo gitlab-ctl status命令来查看一些关键进行的运行情况,正常的话应该如下所示:
run: nginx: (pid 972) 7s; run: log: (pid 971) 7s
run: postgresql: (pid 962) 7s; run: log: (pid 959) 7s
run: redis: (pid 964) 7s; run: log: (pid 963) 7s
run: sidekiq: (pid 967) 7s; run: log: (pid 966) 7s
run: unicorn: (pid 961) 7s; run: log: (pid 960) 7s
有问题的会显示down:这是就可以通过
sudo gitlab-ctl tail postgresql命令来查看出问题进程的情况。如我这边显示的错误:
-
==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
-
E, [2015-02-02T11:01:15.980762 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
-
E, [2015-02-02T11:01:15.981000 #3938] ERROR -- : retrying in 0.5 seconds (4 tries left)
-
E, [2015-02-02T11:01:16.481516 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
-
E, [2015-02-02T11:01:16.481712 #3938] ERROR -- : retrying in 0.5 seconds (3 tries left)
-
E, [2015-02-02T11:01:16.982144 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
-
E, [2015-02-02T11:01:16.982390 #3938] ERROR -- : retrying in 0.5 seconds (2 tries left)
-
E, [2015-02-02T11:01:17.482823 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
-
E, [2015-02-02T11:01:17.483013 #3938] ERROR -- : retrying in 0.5 seconds (1 tries left)
-
E, [2015-02-02T11:01:17.983562 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
-
E, [2015-02-02T11:01:17.983757 #3938] ERROR -- : retrying in 0.5 seconds (0 tries left)
-
E, [2015-02-02T11:01:18.484215 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
-
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in `initialize': Address already in use - bind(2) for "127.0.0.1" port 8080 (Errno::EADDRINUSE)
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in `new'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in `bind_listen'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:229:in `listen'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in `block in bind_new_listeners!'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in `each'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in `bind_new_listeners!'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:141:in `start'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn:126:in `'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `load'
-
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `'
显示是8080端口被占用了,通过netstat -ntlp命令查看使用8080端口的进程情况,杀死该进程后问题解决了。
阅读(14766) | 评论(0) | 转发(0) |