Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1337399
  • 博文数量: 113
  • 博客积分: 3526
  • 博客等级: 中校
  • 技术积分: 1815
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-08 09:46
个人简介

记录总结自己的工作

文章分类

全部博文(113)

文章存档

2015年(19)

2014年(10)

2013年(6)

2012年(16)

2011年(24)

2010年(21)

2009年(17)

分类: 服务器与存储

2015-02-02 11:51:54

    gitlab官网有提供一键安装包,进入https://about.gitlab.com/downloads/ ,然后点击“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 https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.7.2_omnibus.5.4.2.ci-1.el6.x86_64.rpm
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就安装好了,但一般是会有问题的,进入https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md里面会列举一些常见的问题及解决方式。

  如,安装完后运行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命令来查看出问题进程的情况。如我这边显示的错误:

点击(此处)折叠或打开

  1. ==> /var/log/gitlab/unicorn/unicorn_stderr.log <==
  2. E, [2015-02-02T11:01:15.980762 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
  3. E, [2015-02-02T11:01:15.981000 #3938] ERROR -- : retrying in 0.5 seconds (4 tries left)
  4. E, [2015-02-02T11:01:16.481516 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
  5. E, [2015-02-02T11:01:16.481712 #3938] ERROR -- : retrying in 0.5 seconds (3 tries left)
  6. E, [2015-02-02T11:01:16.982144 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
  7. E, [2015-02-02T11:01:16.982390 #3938] ERROR -- : retrying in 0.5 seconds (2 tries left)
  8. E, [2015-02-02T11:01:17.482823 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
  9. E, [2015-02-02T11:01:17.483013 #3938] ERROR -- : retrying in 0.5 seconds (1 tries left)
  10. E, [2015-02-02T11:01:17.983562 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
  11. E, [2015-02-02T11:01:17.983757 #3938] ERROR -- : retrying in 0.5 seconds (0 tries left)
  12. E, [2015-02-02T11:01:18.484215 #3938] ERROR -- : adding listener failed addr=127.0.0.1:8080 (in use)
  13. /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)
  14. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in `new'
  15. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in `bind_listen'
  16. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:229:in `listen'
  17. 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!'
  18. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in `each'
  19. 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!'
  20. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:141:in `start'
  21. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn:126:in `'
  22. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `load'
  23. from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `
    '

    显示是8080端口被占用了,通过netstat -ntlp命令查看使用8080端口的进程情况,杀死该进程后问题解决了。






阅读(13082) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~