Gitlab-multi-instance construction


Gitlab-multi-instance construction

Operating system: CentOS
All services are as follows:

Node A: OpenResty, grafana-server
Node B: PGSQL, Redis
Node C: Gitlab_1
Node D: Gitlab_2
Node E: Gitlab_3
Node N: Gitlab_n
Node A


Installation reference…

# Install related dependencies
yum install pcre-devel openssl-devel gcc curl

# Download source package

# Install the source package, VERSION=
tar -xzvf openresty-VERSION.tar.gz
cd openresty-VERSION/
./configure --prefix=/opt/openresty \
            --with-luajit \
            --without-http_redis2_module \
            --with-http_iconv_module \
sudo make install

# start openresty
# Restart the service sudo /opt/openresty/bin/openresty -s reload
# Stop the service sudo /opt/openresty/bin/openresty -s stop
sudo /opt/openresty/bin/openresty


Installation reference…

# install, here<rpm package url> and<local rpm package>
# Replace with the required version of the package
sudo yum install initscripts urw-fonts wget
wget <rpm package url>
sudo rpm -Uvh <local rpm package>

# start up
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
sudo systemctl enable grafana-server


build redis


# Pull the latest redis image
docker pull redis

# Start the redis service
docker run \
    -v <your_conf>:/usr/local/etc/redis \
    --name <your_redis> redis \
    redis-server \



# Pull the latest PGSQL image
docker pull postgres

# Start the redis service
docker run \
    --name postgresql -p 15432:5432 \
    -e POSTGRES_USER=<your_pg_user> \
    -e POSTGRES_DB=<your_pg_db> \
    -e POSTGRES_PASSWORD=<your_pg_passwd> \
    -d postgres

Node C~N

build gitlab


# install dependencies
yum -y install policycoreutils openssh-server openssh-clients postfix

# Enable postfix to support gitlab sending function
# The postfix startup process will report an error: fatal: parameter inet_interfaces: no local interface found for ::1 
# Need to modify inet_interfaces = localhost in /etc/postfix/ to inet_interfaces = all Save the configuration and restart postfix
systemctl enable postfix && systemctl start postfix 

# install gitlab
# Manually download the installation package
# Domestic mirror source URL
rpm -ivh <package_name>