我的dou音 aa10246666, 看配套视频
一、部署场景
主库(node1) | PG 14.2 | 10.211.55.9 |
从库1(node2) | PG 14.2 | 10.211.55.4 |
从库2(node3) | PG 14.2 | 10.211.55.6 |
repmgr | 5.3.1 |
二、安装repmgr
1、主从库都做如下操作
apt-get install -y postgresql-14-repmgr --因PG版本是14,所以下载与PG匹配的版本
apt-get install -y rsync
/etc/hosts 在结尾新增
10.211.55.9 node1
10.211.55.4 node2
10.211.55.6 node3
visudo 在结尾新增
postgres ALL = NOPASSWD: systemctl stop postgresql, systemctl start postgresql, systemctl restart postgresql, systemctl status postgresql, systemctl reload postgresql
在root用户下设置postgres用户的密码为 postgres
在postgres用户下配置ssh免密,三台之前都需要免密,包括自已,即如下操作