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  
相关推荐
无妄啊______2 分钟前
mysql笔记9(子查询)
数据库·笔记·mysql
Looooking19 分钟前
MySQL 中常用函数使用
数据库·mysql
q5673152327 分钟前
如何在Django中创建新的模型实例
数据库·python·线性代数·django·sqlite
island131436 分钟前
从 InnoDB 到 Memory:MySQL 存储引擎的多样性
数据库·学习·mysql
记得开心一点嘛1 小时前
在Linux系统上使用Docker部署javaweb项目
linux·运维·docker
ZZDICT1 小时前
MySQL 子查询
数据库·mysql
isNotNullX1 小时前
如何用SQL Server和Oracle进行数据同步?
大数据·数据库·sql·oracle
Tak1Na1 小时前
2024.9.18
linux·运维·服务器
A^mber1 小时前
828华为云征文|云服务器Flexus X实例|Ubunt部署Vue项目
运维·服务器·华为云
让学习成为一种生活方式1 小时前
解析药用植物重楼甾体皂苷生物合成中的连续糖基化及其抗真菌作用-文献精读49
linux·数据库·算法·天然产物化学