暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片
基于repmgr的pg库主备切换.docx
260
10页
5次
2023-07-04
10墨值下载
基于
repmgr
pg
库主备切换
目录
基于
repmgr
pg
库主备切换
..........................................................................................................1
1
、安装
repmgr
(主备库都要安装)
.....................................................................................2
2
、主库配置
...............................................................................................................................2
2.1
、基本信息
....................................................................................................................2
2.2
、备库连接测试
............................................................................................................4
2.3
、创建
repmgr.conf
文件
...............................................................................................4
2.4
、注册主库
....................................................................................................................4
2.5
、查看信息
....................................................................................................................4
3
、备库配置
...............................................................................................................................4
3.1
、基本配置
....................................................................................................................4
3.2
、创建
repmgr.conf
文件
...............................................................................................5
3.3
、克隆主库
data
目录
...................................................................................................6
3.4
、启动
pg
库并注册备库
..............................................................................................6
3.5
、查看信息
....................................................................................................................6
4
、配置主备
ssh
互信
................................................................................................................6
4.1
、主机
............................................................................................................................6
4.2
、备机
............................................................................................................................6
5
、切换测试
...............................................................................................................................7
5.1
switchover..................................................................................................................7
5.2
promote.......................................................................................................................8
系统版本
centos7.9
postgresql
版本
13.4
repmgr
版本
5.2.1
主机:
192.168.101.132 node1
备机:
192.168.101.133 node2
1
、安装
repmgr
(主备库都要安装)
[root@node1 ~]# tar -zxvf repmgr-5.2.1.tar.gz
[root@node1 ~]# cd repmgr-5.2.1
[root@node1 repmgr-5.2.1]# ./configure --prefix=/home/postgresql
//
这里编译会报错,因为没有
flex
[root@node1 repmgr-5.2.1]# yum install -y flex
//
安装之后在执行上述编译
[root@node1 repmgr-5.2.1]# make && make install
2
、主库配置
2.1
、基本信息
[root@node1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.101.132 node1
192.168.101.133 node2
[root@node1 ~]# cat /etc/profile
... ...
unset i
unset -f pathmunge
PATH=$PATH:/home/postgresql/bin
[root@node1 ~]# su - postgres
Last login: Wed Sep 22 17:19:08 CST 2021 on pts/0
of 10
10墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜