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  
相关推荐
勤奋的凯尔森同学1 小时前
webmin配置终端显示样式,模仿UbuntuDesktop终端
linux·运维·服务器·ubuntu·webmin
月光水岸New1 小时前
Ubuntu 中建的mysql数据库使用Navicat for MySQL连接不上
数据库·mysql·ubuntu
狄加山6751 小时前
数据库基础1
数据库
我爱松子鱼2 小时前
mysql之规则优化器RBO
数据库·mysql
chengooooooo2 小时前
苍穹外卖day8 地址上传 用户下单 订单支付
java·服务器·数据库
Rverdoser3 小时前
【SQL】多表查询案例
数据库·sql
Galeoto3 小时前
how to export a table in sqlite, and import into another
数据库·sqlite
人间打气筒(Ada)3 小时前
MySQL主从架构
服务器·数据库·mysql
leegong231113 小时前
学习PostgreSQL专家认证
数据库·学习·postgresql
喝醉酒的小白3 小时前
PostgreSQL:更新字段慢
数据库·postgresql