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...
# 安装,这里的<rpm package url>和<local rpm package># 替换成所需版本的包
sudo yum install initscripts urw-fonts wget
wget <rpm package url>
sudo rpm -Uvh <local rpm package>
# 启动
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 <your_conf>:/usr/local/etc/redis \
--name <your_redis> 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=<your_pg_user> \
-e POSTGRES_DB=<your_pg_db> \
-e POSTGRES_PASSWORD=<your_pg_passwd> \
-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 <package_name>
以上是 Gitlab-多实例搭建 的全部内容, 来源链接: utcz.com/z/267437.html