Skip to content

cluster: repmgr cluster topology and sync mode

Inspect repmgr nodes, local role match, synchronous config, and recent cluster events (defaults to database esrep).

Reads external repmgr metadata from database esrep by default, identifies the local node against KES recovery role, inspects local repmgr.conf synchronous settings, and lists recent events. Read-only: never promotes, rejoins, or contacts peer nodes over SSH.

Usage

kbdiag cluster
kbdiag cluster --events-limit 0
kbdiag cluster --json

Key Options

OptionEffect
-d <db>Query repmgr metadata in <db> instead of auto-selecting esrep
--events-limit <n>Limit events shown in text output (5 by default; 0 shows all collected)
--jsonEmit structured JSON (cluster.nodes, cluster.sync, cluster.events, inst.downstreams)

Verdict & Reading Output

  • WARN (exit=1): cluster.primaries (multiple active primaries in repmgr metadata), cluster.role_mismatch (repmgr metadata disagrees with database recovery role), cluster.inactive (node marked inactive), cluster.detached (active repmgr standby not attached to this primary’s sys_stat_replication), or cluster.sync_degraded (repmgr.conf requests synchronous mode while synchronous_standby_names is empty).
  • UNKNOWN (exit=3): Unresolved local node, insufficient privilege (kbdiag_ro), unreadable local repmgr.conf (or remote TCP connection), or failed downstream check. Narrow terminals switch [NODES] and [EVENTS] to compact cards automatically.
  • OK (exit=0): Single consistent topology and synchronous state match across collected metadata and kernel views, or repmgr metadata schema is absent (not_applicable).

Example (KES V9 Primary, excerpt, COLUMNS=80)

cluster  OK  (primary, system@local, endpoint=/tmp/.s.KINGBASE.54321, db=esrep,
    2026-12-03T03:48:08Z)
[IDENTIFICATION]
  local identification: recovery role=primary matched the single active primary
    in repmgr.nodes (fallback; no repmgrd ID/primary_slot_name match)
[NODES]
  2  (repmgr metadata in database esrep)
  id  name   type     upstream  active  priority  location  slot
  1   node1  primary  -         yes     100       default   repmgr_slot_1
  2   node2  standby  node1     yes     100       default   repmgr_slot_2
  this node is node1: repmgr says primary, the database is a primary
  attached here: node2
[SYNCHRONOUS]
  repmgr.conf                async  (/data/kingbase/app/Server/bin/../etc/repmgr
    .conf)
  synchronous_standby_names  (empty: asynchronous)
[EVENTS]
  showing 3 of 20 collected (latest first; --events-limit 0 shows all collected)
  2026-11-28T00:04:35Z  node1  child_node_reconnect  ok=yes
    standby node "node2" (ID: 2) has reconnected after 1384 seconds
  ...
  • kbdiag repl — check kernel streaming replication links and replay lag
  • kbdiag slots — inspect physical/logical slots backing cluster standbys
  • kbdiag wal — check WAL retention and archive status