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  
相关推荐
PyAIGCMaster3 分钟前
文本模式下成功。ubuntu P104成功。
服务器·数据库·ubuntu
drebander16 分钟前
MySQL 查询优化案例分享
数据库·mysql
初晴~32 分钟前
【Redis分布式锁】高并发场景下秒杀业务的实现思路(集群模式)
java·数据库·redis·分布式·后端·spring·
盖世英雄酱5813637 分钟前
InnoDB 的页分裂和页合并
数据库·后端
Linux运维技术栈1 小时前
Ansible(自动化运维)环境搭建及ansible-vault加密配置
运维·自动化·ansible
YashanDB2 小时前
【YashanDB知识库】XMLAGG方法的兼容
数据库·yashandb·崖山数据库
独行soc2 小时前
#渗透测试#漏洞挖掘#红蓝攻防#护网#sql注入介绍11基于XML的SQL注入(XML-Based SQL Injection)
数据库·安全·web安全·漏洞挖掘·sql注入·hw·xml注入
Bessssss2 小时前
centos权限大集合,覆盖多种权限类型,解惑权限后有“. + t s”问题!
linux·运维·centos
苹果醋33 小时前
Golang的文件加密工具
运维·vue.js·spring boot·nginx·课程设计
jwensh3 小时前
【Jenkins】Declarative和Scripted两种脚本模式有什么具体的区别
运维·前端·jenkins