Gitlab配置问题:: NGINX独角兽端口冲突 [英] Gitlab Configuration Issues:: NGINX Unicorn Port Conflict

查看:993
本文介绍了Gitlab配置问题:: NGINX独角兽端口冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Apache CentOS服务器上使用Apache,Git,PHP等部分设置了 gitlab 。 PostGreSQL和MySQL。我正在运行厨师食谱版。我从此处获得了rpm。我想用它来更好更直观地管理我的Git回购,这似乎是一个不错的选择。但现在我遇到了让它起作用的问题。



为了使它真正起作用并更新所有文件,我决定使用 gitlab重新运行配置-ctl reconfigure 。第二次运行确实奏效:

 厨师客户端完成,4个资源更新
gitlab重新配置!

请参阅完整日志



主机已经把80IN上的NGINX与Apache运行在80端口上的争论放在一起,我们有一个LAMP项目正在运行。但是现在Ruby的Unicorn Web Server似乎与NGINX相冲突。我曾与NGINX合作过一点,这不是什么,这是我第一次刺穿Gitlab。无论如何,这是我在我的主机的帮助下计算出来的。



当我登录到testserver.domain.net并通过以下命令时:



netstat -ln | grep 8080 我知道

  tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 

在8080
上运行根据我的宿主,它应该在0.0.0.0:8080上运行。当我们检查那个端口上运行的是什么时,我们看到

pre $ netstat -tupln | grep 8080
tcp 0 0 127.0 .0.1:8080 0.0.0.0:* LISTEN 21627 / unicorn maste

当我们检查进程ID 21627 ,我们可以看到

$ p codeat $ proc / 21627 / cmdline
独角兽大师-E production -c / var / opt / gitlab / gitlab-rails / etc / unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru

这是一个Ruby过程,而不是NGINX过程。



所以NGINX似乎与Unicorn冲突。

当我们检查nginx的日志时,我们发现nginx无法正常运行,因为这个原因:

  tail -f /var/log/gitlab/nginx/error.log 
2014/07/28 09:43:10 [emerg] 23122#0:绑定()到0.0.0.0:8080失败(98:地址已经在使用)
2014/07/28 09:43:10 [emerg] 23122#0:仍然无法绑定()
2014/07/28 09:43:12 [eme rg] 23123#0:绑定()到0.0.0.0:8080失败(98:地址已经在使用)
2014/07/28 09:43:12 [emerg] 23123#0:bind()为0.0 .0.0:8080失败(98:地址已在使用)
2014/07/28 09:43:12 [emerg] 23123#0:bind()到0.0.0.0:8080失败(98:地址已经在使用)
2014/07/28 09:43:12 [emerg] 23123#0:绑定()到0.0.0.0:8080失败(98:地址已被使用)
2014/07/28 09:23:12 [emerg] 23123#0:绑定()到0.0.0.0:8080失败(98:地址已被使用)
2014/07/28 09:43:12 [emerg] 23123#0 :仍然无法绑定()

我搜索了Unicorn.rb,发现这个链接。我还读到:
$ b


Unicorn是Rack应用程序的HTTP服务器,专门设计用于低延迟服务的
快速客户端,高带宽连接,并且在类Unix / Unix内核中具有
优势。慢速客户端应该只能通过放置一个反向代理服务器来完成
服务,这个代理服务器可以完全缓冲
请求和响应在Unicorn和慢速客户端之间的请求和响应。

当我检查文件 /var/opt/gitlab/gitlab-rails/etc/unicorn.rb 时,我确实看到它使用8080。问题是,似乎独角兽应该与NGINX一起工作,所以也许我不应该改变这个端口。



我应该采取什么措施让Gitlab发挥作用? Gitlab可以在没有Unicorn的情况下工作吗?我想不会。我应该为它选择另一个端口还是为NGINX选择另一个端口?

你应该覆盖 /etc/gitlab/gitlab.rb 。不要混淆 / var / opt / gitlab /...,因为任何手动配置在重新配置后都会丢失。特别阅读设置NGINX监听端口。在下载页面中有一句话:有关故障排除和配置选项,请参阅Omnibus GitLab自述文件。我想知道这是不是人们看到的:/如果不是我们应该更清楚。

I have managed to partly setup Gitlab on a Linux CentOS server with Apache, Git, PHP, PostGreSQL and MySQL. I am running the Chef Cookbook version. I got the rpm from here. I wanted to use it to manage my Git repo better and more visually and this seemed to be a good choice. But now I run into issues getting it to work.

Just to make it really work and update all files I decided to rerun the configuration using gitlab-ctl reconfigure. Second run did work:

Chef Client finished, 4 resources updated
gitlab Reconfigured!

See full log

The hoster had already put NGINX on 8080 not get into an argument with Apache running on port 80 where we have a LAMP project running. But now Ruby's Unicorn Web Server seems to be conflicting with NGINX. I have worked with NGINX a little bit, not much and this is my first stab at Gitlab. Anyways this is what I figured out with the help of my hoster.

When I log into testserver.domain.net and pass the following command:

netstat -ln |grep 8080 I see

tcp        0      0 127.0.0.1:8080              0.0.0.0:*                   LISTEN      

So something is running on 8080 According to my hoster it should run on 0.0.0.0:8080. And when we check what is running on that port we see

netstat -tupln |grep 8080
tcp        0      0 127.0.0.1:8080              0.0.0.0:*                   LISTEN      21627/unicorn maste 

When we check the process id 21627, we see

cat /proc/21627/cmdline 
unicorn master -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru

That is a Ruby process, and not a NGINX process.

So NGINX seems to be conflicting with Unicorn.

And when we check the logs of nginx we see that nginx cannot get going because of this:

tail -f /var/log/gitlab/nginx/error.log 
2014/07/28 09:43:10 [emerg] 23122#0: bind() to 0.0.0.0:8080 failed (98: Address already in use)
2014/07/28 09:43:10 [emerg] 23122#0: still could not bind()
2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 failed (98: Address already in use)
2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 failed (98: Address already in use)
2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 failed (98: Address already in use)
2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 failed (98: Address already in use)
2014/07/28 09:43:12 [emerg] 23123#0: bind() to 0.0.0.0:8080 failed (98: Address already in use)
2014/07/28 09:43:12 [emerg] 23123#0: still could not bind()

I googled Unicorn.rb and found this link. I also read that:

Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between Unicorn and slow clients.

When I check the file /var/opt/gitlab/gitlab-rails/etc/unicorn.rb I do see it uses 8080. Issue is that it seems Unicorn should work together with NGINX so perhaps I should not change the port.

What step should I take to make Gitlab work? Can Gitlab work without Unicorn? I would think not. Should I then pick another port for it or perhaps for NGINX?

解决方案

You should override the ports in /etc/gitlab/gitlab.rb. Don't mess with /var/opt/gitlab/... because any manual configuration will be lost after a reconfigure. In particular read on Setting the NGINX listen port. In the downloads page there is a sentence: For troubleshooting and configuration options please see the Omnibus GitLab readme. I wonder if this is not seen by people :/ If not we should make it more clear.

这篇关于Gitlab配置问题:: NGINX独角兽端口冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆