PostgreSQL的repmgr命令参考(2)

PostgreSQL的repmgr命令参考(2)

1 repmgr node status

显示节点基本信息和复制状态的概述。此命令必须在本地节点上运行。

bash 复制代码
[pg12@test1 repmgr]$ repmgr -f /home/pg12/conf/repmgr.conf node status
Node "test1":
        PostgreSQL version: 12.9
        Total data size: 24 MB
        Conninfo: host=192.168.10.100 user=repmgr port=5432 dbname=postgres
        Role: standby
        WAL archiving: off
        Archive command: (none)
        Replication connections: 0 (of maximal 10)
        Replication slots: 0 physical (of maximal 10; 0 missing)
        Upstream node: test2 (ID: 2)
        Replication lag: 0 seconds
        Last received LSN: 0/33D3668
        Last replayed LSN: 0/33D3668
bash 复制代码
[pg12@test2 repmgr]$ repmgr -f /home/pg12/conf/repmgr.conf node status
Node "test2":
        PostgreSQL version: 12.9
        Total data size: 24 MB
        Conninfo: host=192.168.10.101 user=repmgr port=5432 dbname=postgres
        Role: primary
        WAL archiving: off
        Archive command: (none)
        Replication connections: 1 (of maximal 10)
        Replication slots: 0 physical (of maximal 10; 0 missing)
        Replication lag: n/a

2 repmgr node check

从复制的角度对节点执行一些运行状况检查。此命令必须在本地节点上运行。

bash 复制代码
[pg12@test1 repmgr]$ repmgr -f /home/pg12/conf/repmgr.conf node check
Node "test1":
        Server role: OK (node is standby)
        Replication lag: OK (0 seconds)
        WAL archiving: OK (0 pending archive ready files)
        Upstream connection: OK (node "test1" (ID: 1) is attached to expected upstream node "test2" (ID: 2))
        Downstream servers: OK (this node has no downstream nodes)
        Replication slots: OK (node has no physical replication slots)
        Missing physical replication slots: OK (node has no missing physical replication slots)
        Configured data directory: OK (configured "data_directory" is "/home/pg12/repmgr")
bash 复制代码
[pg12@test2 repmgr]$ repmgr -f /home/pg12/conf/repmgr.conf node check
Node "test2":
        Server role: OK (node is primary)
        Replication lag: OK (N/A - node is primary)
        WAL archiving: OK (0 pending archive ready files)
        Upstream connection: OK (N/A - node is primary)
        Downstream servers: OK (1 of 1 downstream nodes attached)
        Replication slots: OK (node has no physical replication slots)
        Missing physical replication slots: OK (node has no missing physical replication slots)
        Configured data directory: OK (configured "data_directory" is "/home/pg12/repmgr")

3 repmgr service status

此命令提供集群中所有活动节点的概览以及每个节点的repmgrd实例的状态。它可用于检查repmgr服务暂停和repmgr服务器取消暂停操作的结果。

bash 复制代码
[pg12@test1 repmgr]$ repmgr -f /home/pg12/conf/repmgr.conf service status
 ID | Name  | Role    | Status    | Upstream | repmgrd | PID   | Paused? | Upstream last seen
----+-------+---------+-----------+----------+---------+-------+---------+--------------------
 1  | test1 | standby |   running | test2    | running | 4304  | no      | 0 second(s) ago    
 2  | test2 | primary | * running |          | running | 13680 | no      | n/a    
bash 复制代码
[pg12@test2 repmgr]$ repmgr -f /home/pg12/conf/repmgr.conf service status
 ID | Name  | Role    | Status    | Upstream | repmgrd | PID   | Paused? | Upstream last seen
----+-------+---------+-----------+----------+---------+-------+---------+--------------------
 1  | test1 | standby |   running | test2    | running | 4304  | no      | 0 second(s) ago    
 2  | test2 | primary | * running |          | running | 13680 | no      | n/a  
相关推荐
努力的悟空21 分钟前
国土变更调查拓扑错误自动化修复工具的研究
运维·自动化
武子康1 小时前
Java-07 深入浅出 MyBatis - 一对多模型 SqlMapConfig 与 Mapper 详细讲解测试
java·开发语言·数据库·sql·mybatis·springboot
代码吐槽菌1 小时前
基于SSM的毕业论文管理系统【附源码】
java·开发语言·数据库·后端·ssm
周末不下雨2 小时前
win11+ubuntu22.04双系统 | 联想 24 y7000p | ubuntu 22.04 | 把ubuntu系统装到1T的移动固态硬盘上!!!
linux·运维·ubuntu
路有瑶台2 小时前
MySQL数据库学习(持续更新ing)
数据库·学习·mysql
数字扫地僧2 小时前
WebLogic 版本升级的注意事项与流程
数据库
Viktor_Ye2 小时前
高效集成易快报与金蝶应付单的方案
java·前端·数据库
耗同学一米八2 小时前
2024 年河北省职业院校技能大赛网络建设与运维赛项样题四
运维·网络
努力算法的小明3 小时前
SQL 复杂查询
数据库·sql
斗-匕3 小时前
MySQL 三大日志详解
数据库·mysql·oracle