Gitlab can't start normally after installation

Problem Description

An environment needs to build a gitlab service. It is very simple to build and install gitlab on Baidu. There are two ways to install it: 1. rpm package installation 2. yum source installation; due to the installation of nginx, tomcat, redis application services on the server, gitlab related services Port is occupied, so the gitlab web management page cannot be opened normally.

Troubleshooting ideas

1. Check the firewall status, firewall service name: iptables and firewalld
2. Check the gitlab service status and listening port status, command: gitlab-ctl status gitlab all service status ss -lntup View the tcp and udp port status being monitored
3. Check gitlab Related logs, command: gitlab-ctl tail View log output in real time

Resolution steps

1. Confirm that the gitlab service involves the relevant ports 80, 8080, and 6379 that need to be adjusted, which are front-end nginx, back-end Unicorn, and cache redis
2. The system itself has been installed with nginx and tomcat occupying ports 80 and 8080. One port corresponds to multiple application services,
so you need to modify the gitlab configuration file /etc/gitlab/gitlab.rb about nginx and Unicorn listening ports. The default ports are 80 and 8080. The modifications are as follows:

## GitLab URL 
external_url ' http://xxx.xxx.xxx.xxx ' 
## nginx port 
# nginx [ ' listen_port ' ] = nil modified to nginx [ ' listen_port ' ] = 9091 

### Advanced settings 
# unicorn [ ' listen ' ] = ' 127.0.0.1 ' Modify to unicorn [ ' port ' ] = 9092 

vim / var / opt / gitlab / gitlab-rails / etc / unicorn.rb 
listen " 127.0.0.1:9092 " ,: tcp_nopush =>true
listen "/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket " ,: backlog => 1024 After 

modification, execute the following command to refresh the configuration 
gitlab -ctl reconfigure

3. Redis port 6379 can be changed or not, which is a misunderstanding. By default, gitlab calls internal redis to use unix socket for local connection, and there is no port occupied;
if you want to use tcp connection to connect, you need to change the redis default port.

4. Start and check related services

Start gitlab 
gitlab - ctl start to 
view gitlab status 
gitlab - ctl status to 
view gitlab process 
ps -ef | grep gitlab

5. Open the browser and visit http://xxx.xxx.xxx.xxx:9091 to enter the gitlab login page

Supplementary explanation

1 ) gitlab directory configuration instructions
 / etc / gitlab / gitlab.rb # configuration file
 / var / opt / gitlab # gitlab related service configuration storage directory and gitlab warehouse data storage directory
 / var / log / gitlab #gitlab log storage directory
 2 ) gitlab Command 
gitlab tail #View real-time logs 
gitlab tail [gitlab service- name] #View specific service logs 
gitlab restart #Restart all services 
gitlab restart [gitlab service -name] #Restart specific services

Guess you like

Origin www.cnblogs.com/Wolf-Dreams/p/12758735.html