Herein objectives: a configuration gitlab from two master (master 192.168.117.129, slave 192.168.117.130,192.168.117.131), wherein a plug gitlab-master from the master database postgresql two, gitlab-slave130 mount postgresql-130, gitlab-slave131 mount postgresql-131.
Deployed on three machines gitlab
Download and install the package link: https://pan.baidu.com/s/1geCvvWl54kp_5AJ6O8bJ3w extraction code: tser
wherein gitlab-ce-zh110104.tar as gitlab-11.1.4, gitlab-ce- zh100604.tar as gitlab-10.6.4
(1) the installation package upload / home directory, load the image and
1 |
docker load -i gitlab-ce-zh110104.tar |
1 |
version: '2' |
Note: The above postgresql postgresql mounted respectively on each of the three machines
1 |
docker-compose up -d |
Installation services keepalived
Master-gitlab
(1) for the open forward keepalived
1 |
[root@localhost ~] |
(2) modify the configuration documentation keepalived
1 |
vim /etc/keepalived/keepalived.conf |
(3) Creating detection script
1 |
|
(4)重启keepalived
1 |
systemctl restart keepalived |
Gitlab-slave按照上述步骤配置keepalived,只需要把其中的ip换成slave机器的ip,priority值要比master小。
安装Rsyncd服务
安装包下载链接: https://pan.baidu.com/s/1s1nPjzM9w9M8e0V4EqcZog 提取码: gv5w
master-129
(1)安装
1 |
yum localinstall *.rpm |
(2))创建用户名和密码
1 |
useradd forgitlab 创建用户forgitlab |
(3)修改配置文档
1 |
vim /etc/rsyncd.conf |
(4)创建认证文档
如果在rsyncd服务中定义了可选配置,则需创建认证文档。
1 |
[root@localhost ~]# vim /etc/rsync.pass |
(5)启动Rsyncd服务
1 |
[root@localhost ~]# systemctl start rsyncd |
(6)开启rsyncd服务端口
1 |
[root@localhost ~]# firewall-cmd --permanent --add-port=873/tcp |
slave-130 master备节点
(1)安装
1 |
yum localinstall *.rpm |
(2)创建认证文档
1 |
[root@localhost ~]# vim /etc/rsync.pass |
(4)自动执行
1 |
[root@localhost ~]# crontab -e |
[1] Description synchronization once every 5 minutes.
[Note 2] If the directory can be synchronized, text documents types of documents can not be synchronized, check to see if SELinux closed
1, the temporary closure: Enter the command setenforce 0, restart the system will be turned on.
2, is permanently closed: enter the command vi / etc / selinux / config, to the SELINUX = enforcing SELINUX = disabled, then save and exit.
Original: Big Box Gitlab highly available deployment documentation