微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ruby – Gitlab配置问题:: NGINX Unicorn端口冲突

我已经设法在 Linux CentOS服务器上使用Apache,Git,PHP,PostGresqlMysqL部分设置 Gitlab.我正在运行 Chef Cookbook version.我从 here获得了转速.我想用它来更好地管理我的Git仓库,更具视觉效果,这似乎是一个不错的选择.但是现在我遇到了让它发挥作用的问题.

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

Chef Client finished,4 resources updated
gitlab Reconfigured!

full log

主机已经把Nginx放在了8080而没有进入与在80端口运行的Apache的争论,我们在那里运行了一个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运行.当我们检查那个端口上运行的是什么时,我们看到了

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

当我们检查进程ID 21627时,我们看到了

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

这是一个Ruby流程,而不是Nginx流程.

所以Nginx似乎与Unicorn相冲突.

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

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()

我用Google搜索了Unicorn.rb并找到了这个link.我还读到了:

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.

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

我应该采取什么步骤来使Gitlab工作? Gitlab可以在没有Unicorn的情况下工作吗?我想不会.我应该为它选择另一个端口,还是为Nginx选择?

解决方法

您应该覆盖/etc/gitlab/gitlab.rb中的端口.不要乱用/ var / opt / gitlab / …因为重新配置后任何手动配置都会丢失.特别是在 Setting the NGINX listen port上阅读.在下载页面中有一句话:有关故障排除和配置选项,请参阅Omnibus GitLab自述文件.我想知道人们是否看不到这种情况:/如果不是,我们应该更清楚.

原文地址:https://www.jb51.cc/ruby/269375.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐