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

我已经设法在Linux CentOS服务器上使用Apache,Git,PHP,PostGreSQL和MySQL部分设置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自述文件.我想知道人们是否看不到这种情况:/如果不是,我们应该更清楚.

相关文章

文章浏览阅读3.7k次,点赞2次,收藏5次。Nginx学习笔记一、N...
文章浏览阅读1.7w次,点赞14次,收藏61次。我们在使用容器的...
文章浏览阅读1.4k次。当用户在访问网站的过程中遇到404错误时...
文章浏览阅读2.7k次。docker 和 docker-compose 部署 nginx+...
文章浏览阅读1.3k次。5:再次启动nginx,可以正常启动,可以...
文章浏览阅读3.1w次,点赞105次,收藏182次。高性能:Nginx ...