当前位置: 首页 > article >正文

PostgreSQL的repmgr命令参考(2)

PostgreSQL的repmgr命令参考(2)

1 repmgr node status

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

[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
[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

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

[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")
[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服务器取消暂停操作的结果。

[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    
[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  

http://www.kler.cn/a/306395.html

相关文章:

  • 企业一站式管理系统odoo的研究——PLM插件的搭建
  • A029-基于Spring Boot的物流管理系统的设计与实现
  • C++中的std::tuple和std::pair
  • React Hooks在现代前端开发中的应用
  • SpringMVC学习笔记(二)
  • Go语言 实现将中文转化为拼音
  • k8s Service 服务
  • 数据结构——(java版)Map与Set
  • 《JavaEE进阶》----16.<Mybatis简介、操作步骤、相关配置>
  • C#操作Windows时间同步
  • SSH公钥的身份验证(免密登录)
  • 基于SpringBoot的租房网站系统
  • Xilinx系FPGA学习笔记(八)FPGA与红外遥控
  • 【推荐项目】大学生心理预约管理系统
  • (1)LT9211学习笔记
  • 3177. 求出最长好子序列 II
  • ARM驱动学习之5 LEDS驱动
  • Blender/3ds Max/C4D哪个软件好?
  • C/C++语言基础--从C到C++的不同(上)
  • MyBatis - 一对多对象关联查询
  • OpenCV和Tesseract OCR识别复杂验证码喽~~
  • 使用 element UI 实现自定义日历
  • 日元走强引领外汇市场新动向,全球经济指标波动加剧
  • Radware 报告 Web DDoS 攻击活动
  • 7.1溪降技术:徒步
  • LEAN 赋型唯一性(Unique Typing)之 在 n-provability 下 的 赋型唯一性