官方操作手册Documentation
下载URL

编译安装
/home/zhaowzh/pg/pg966/  为 pg源码安装文件目录

yum.postgresql.org为系统安装适当的存储库RPM
[[email protected] repmgr]# rpm -i pgdg-redhat96-9.6-3.noarch.rpm

安装用于构建PostgreSQL的先决条件:
 [[email protected] repmgr]# yum check-update
 [[email protected] repmgr]# yum groupinstall "Development Tools"
 [[email protected] repmgr]# yum install yum-utils openjade docbook-dtds docbook-style-dsssl docbook-style-xsl
 [[email protected] repmgr]# yum-builddep postgresql96

开始安装 repmgr
[[email protected] ~]# mkdir -p /home/zhaowzh/pg/pg966/contrib/repmgr

[[email protected] ~]#  cp -R /home/zhaowzh/repmgr/repmgr405/* /home/zhaowzh/pg/pg966/contrib/repmgr/

注意 确保目标PostgreSQL版本的pg_config位于 $ PATH中   即 pg_config所在的目录要与 ./configure --prefix=/usr/local/postgresql  下的bin 目录中。
[[email protected] repmgr]# yum install gcc-c++
[[email protected] repmgr]# ./configure --prefix=/usr/local/postgresql
[[email protected] repmgr]#  make
[[email protected] repmgr]# make install

repmgr安装部署

验证:
[[email protected] ~]$ repmgr --version
[[email protected] ~]$ repmgrd --version

repmgr安装部署

[[email protected] 9.6]# vim /etc/sudoers
Defaults:postgres !requiretty
      postgres ALL = NOPASSWD: /usr/bin/systemctl stop postgresql-9.6, \
        /usr/bin/systemctl start postgresql-9.6, \
        /usr/bin/systemctl restart postgresql-9.6 \
        /usr/bin/systemctl reload postgresql-9.6
repmgr安装部署
配置本部分是为了 repmgr后续维护(节点提升 promote 等操作),如果不设置将会在做类似 
repmgr -f /etc/repmgr/9.6/repmgr.conf  standby follow 命令时失败或报错



相关文章:

  • 2021-04-03
  • 2021-12-04
  • 2021-12-04
  • 2021-12-02
  • 2021-12-05
  • 2021-12-12
  • 2021-12-18
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2021-10-09
  • 2021-04-27
  • 2021-12-21
相关资源
相似解决方案