Gitlab-多实例搭建

Gitlab-多实例搭建


操作系统:CentOS
所有服务如下:

节点A:OpenResty、grafana-server
节点B:PGSQL、Redis
节点C:Gitlab_1
节点D:Gitlab_2
节点E:Gitlab_3
..............
节点N:Gitlab_n
节点A

OpenResty

安装参考https://openresty.org/cn/inst...

# 安装相关依赖
yum install pcre-devel openssl-devel gcc curl

# 下载源码包
wget https://openresty.org/download/openresty-1.19.9.1.tar.gz

# 安装源码包,VERSION=1.19.9.1
tar -xzvf openresty-VERSION.tar.gz
cd openresty-VERSION/
./configure --prefix=/opt/openresty \
            --with-luajit \
            --without-http_redis2_module \
            --with-http_iconv_module \
            --with-http_postgres_module
make
sudo make install

# 启动openresty
# 重启服务 sudo /opt/openresty/bin/openresty -s reload
# 停止服务 sudo /opt/openresty/bin/openresty -s stop
sudo /opt/openresty/bin/openresty

grafana-server

安装参考https://grafana.com/docs/graf...

# 安装,这里的
# 替换成所需版本的包
sudo yum install initscripts urw-fonts wget
wget 
sudo rpm -Uvh 

# 启动
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
sudo systemctl enable grafana-server

节点B

搭建redis

参考https://hub.docker.com/_/redis

# 拉取最新的redis镜像
docker pull redis

# 启动redis服务
docker run \
    -v :/usr/local/etc/redis \
    --name  redis \
    redis-server \
    /usr/local/etc/redis/redis.conf

搭建PGSQL

参考https://hub.docker.com/_/post...

# 拉取最新的PGSQL镜像
docker pull postgres

# 启动redis服务
docker run \
    --name postgresql -p 15432:5432 \
    -e POSTGRES_USER= \
    -e POSTGRES_DB= \
    -e POSTGRES_PASSWORD= \
    -d postgres

节点C~N

搭建gitlab

参考https://docs.gitlab.com/ee/up...

# 安装依赖
yum -y install policycoreutils openssh-server openssh-clients postfix

# 开启postfix支持gitlab发信功能
# postfix启动过程会报错:fatal: parameter inet_interfaces: no local interface found for ::1 
# 需要修改/etc/postfix/main.cf里的inet_interfaces = localhost改为inet_interfaces = all 保存配置后重启postfix即可
systemctl enable postfix && systemctl start postfix 

# 安装gitlab
# 手动下载安装包
# 国内镜像源网址 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
rpm -ivh 

你可能感兴趣的:(Gitlab-多实例搭建)