pg_auto_failover主库维护操作流程
1 PG集群维护
1.1 主库维护
从节点设置维护状态
[postgres@localhost ~]$ pg_autoctl enable maintenance
修改主库postgresql.conf配置文件
1 停止主库
[root@localhost KDCC_installtool]# systemctl stop postgresql
2 修改postgresql.conf配置文件
[postgres@localhost ~]$ cd $PGDATA
[postgres@localhost pg_data]$ vi postgresql.conf
3 启动主库
[root@localhost KDCC_installtool]# systemctl start postgresql
从库取消维护状态
[postgres@localhost ~]$ pg_autoctl disable maintenance
集群状态检查
[postgres@localhost ~]$ pg_autoctl show state
1.2 从库维护
修改从库postgresql.conf配置文件
1 停止从库
[root@localhost KDCC_installtool]# systemctl stop postgresql
2 修改postgresql.conf配置文件
[postgres@localhost ~]$ cd $PGDATA
[postgres@localhost pg_data]$ vi postgresql.conf
3 启动从库
[root@localhost KDCC_installtool]# systemctl start postgresql
集群状态检查
[postgres@localhost ~]$ pg_autoctl show state
2 PG集群主从切换
2.1 手动故障切换
[postgres@localhost ~]$ pg_autoctl perform failover
注意事项:当2.1的failover操作hang住,导致无法切换。可以考虑采用2.2的promotion 操作强制提升从库为主库。
2.2 手动提升从节点为主库
[postgres@localhost ~]$ pg_autoctl perform promotion –name node_2
pg_auto_failover主库维护操作流程
本文2024-09-23 01:13:36发表“云苍穹知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-cangqiong-144583.html
- 组织人员同步(星空旗舰-飞书)操作手册V1.0.docx
- 金蝶云·苍穹-数据表模型设计器整体介绍_20241017.pdf
- 金蝶云·苍穹新手入门实战课程配套课件 -5第五章.zip
- 金蝶云·苍穹新手入门实战课程配套课件 -1第一章.zip
- 金蝶云·苍穹-平台引领,Cosmic让智能无处不在.pdf
- KIS云·旗舰版7.0 生产任务管理解决方案(2024.08.01).pptx
- 金蝶云·苍穹新手入门实战课程配套课件 -4第四章.zip
- 金蝶云·苍穹新手入门实战课程配套课件 -7第七章.zip
- 益企成长讲堂-构建透明化生产车间的新篇章.pptx
- 金蝶KIS云旗舰版移动系列整体配置和应用方案介绍(20240815直播).pptx