Gitlab configuration issues :: Unicorn NGINX port conflict

I was able to partially configure Gitlab on a Linux CentOS server with Apache, Git, PHP, PostGreSQL and MySQL. I am launching the chef version of the chef . I got rpm from here . I wanted to use it to manage the Git repository better and visually, and it seemed like a good choice. But now I am facing problems that make it work.

Just so that it really works and updates all the files, I decided to restart the configuration using gitlab-ctl reconfigure . The second run worked:

 Chef Client finished, 4 resources updated gitlab Reconfigured! 

See full magazine

The host has already set NGINX to 8080 so as not to enter into an argument with Apache running on port 80, where we run the LAMP project. But now the Ruby Unicorn web server seems to be contrary to NGINX. I worked with NGINX a bit, not so much, and this is my first hit in Gitlab. In any case, this is what I found out with the help of my hoster.

When I enter testerver.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 works on 8080 According to my hoster, it should work on 0.0.0.0:8080. And when we check what works on this 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 that

 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 

This is a Ruby process, not an NGINX process.

So NGINX seems to conflict with Unicorn.

And when we check the nginx logs, we see that nginx cannot exit 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 the link. I also read that:

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

When I check the file /var/opt/gitlab/gitlab-rails/etc/unicorn.rb , I see that it uses 8080. The problem is that it seems that Unicorn should work with NGINX, so maybe I don’t should change the port.

What step should I take to get Gitlab to work? Can Gitlab work without Unicorn? I would not have thought. Should I then choose a different port for it, or perhaps for NGINX?

+7
git gitlab ruby nginx centos
source share
4 answers

You must override the ports in /etc/gitlab/gitlab.rb . Do not contact /var/opt/gitlab/... because any manual configuration will be lost after the migration. In particular, read Configuring the NGINX Listen Port . The download page has a suggestion:. For troubleshooting and configuration options, see Omnibus GitLab Overview . I wonder if this is not visible to people: / If not, we should make it more understandable.

+9
source share

To add Axil to the comments. I had to change it in the file / var / opt / gitlab / gitlab -rails / etc / unicorn.rb. After rebooting after that, I did not lose my configs. The unicorn master did not select my changes from the /etc/gitlab/gitlab.rb file, even after several restarts.

+8
source share

You should update the file /etc/gitlab/gitlab.rb.

Make sure that when you change the file that you uncomment, you change. It uses a chef, therefore, if the gitlab.rb file is configured correctly when running sudo gitlab-ctl reconfigure; , it will correctly update the corresponding file. Then sudo gitlab-ctl restart to restart the services.

sudo lsof -Pni |grep <port number> is your friend in identifying port conflicts

+2
source share

The documentation suggests setting 'nginx [' listen_port '] = 8080', but when I made this unicorn, I could not bind port 8080. I set nginx port to 8888 instead, and it worked. This suggests that in order to set the nginx port to 8080, you need to change the unicorn from the default port 8080 to something else, but I have not explored this possibility. It would be nice if the example of installing the nginx port was a setting that would work in the default configuration, which is mine, and also I know - I installed it only this morning.

0
source share

All Articles