1PG_AUTOCTL SHOW EVENTS(1)      pg_auto_failover      PG_AUTOCTL SHOW EVENTS(1)
2
3
4

NAME

6       pg_autoctl show events - pg_autoctl show events
7
8       pg_autoctl  show  events  -  Prints monitor's state of nodes in a given
9       formation and group
10

SYNOPSIS

12       This command  outputs  the  events  that  the  pg_auto_failover  events
13       records  about  state  changes of the pg_auto_failover nodes managed by
14       the monitor:
15
16          usage: pg_autoctl show events  [ --pgdata --formation --group --count ]
17
18          --pgdata      path to data directory
19          --monitor     pg_auto_failover Monitor Postgres URL
20          --formation   formation to query, defaults to 'default'
21          --group       group to query formation, defaults to all
22          --count       how many events to fetch, defaults to 10
23          --watch       display an auto-updating dashboard
24          --json        output data in the JSON format
25

OPTIONS

27       --pgdata
28              Location of the Postgres node being managed locally. Defaults to
29              the  environment  variable PGDATA. Use --monitor to connect to a
30              monitor from anywhere, rather than the monitor URI used by a lo‐
31              cal Postgres node managed with pg_autoctl.
32
33       --monitor
34              Postgres  URI  used  to connect to the monitor. Must use the au‐
35              toctl_node username and  target  the  pg_auto_failover  database
36              name.  It  is possible to show the Postgres URI from the monitor
37              node using the command pg_autoctl show uri.
38
39       --formation
40              List the events recorded for nodes in the given  formation.  De‐
41              faults to default.
42
43       --count
44              By default only the last 10 events are printed.
45
46       --watch
47              Take  control  of  the terminal and display the current state of
48              the system and the last events from the monitor. The display  is
49              updated automatically every 500 milliseconds (half a second) and
50              reacts properly to window size change.
51
52              Depending on the terminal window size, a different set  of  col‐
53              umns  is visible in the state part of the output. See pg_autoctl
54              watch.
55
56       --json Output a JSON formatted data instead of a table formatted list.
57

ENVIRONMENT

59       PGDATA
60          Postgres directory location. Can be used instead of the --pgdata op‐
61          tion.
62
63       PG_AUTOCTL_MONITOR
64          Postgres  URI to connect to the monitor node, can be used instead of
65          the --monitor option.
66
67       XDG_CONFIG_HOME
68          The pg_autoctl command stores its configuration files in  the  stan‐
69          dard  place  XDG_CONFIG_HOME.  See the XDG Base Directory Specifica‐
70          tion.
71
72       XDG_DATA_HOME
73          The pg_autoctl command stores its internal states files in the stan‐
74          dard  place XDG_DATA_HOME, which defaults to ~/.local/share. See the
75          XDG Base Directory Specification.
76

EXAMPLES

78          $ pg_autoctl show events --count 2 --json
79          [
80           {
81               "nodeid": 1,
82               "eventid": 15,
83               "groupid": 0,
84               "nodehost": "localhost",
85               "nodename": "node1",
86               "nodeport": 5501,
87               "eventtime": "2021-03-18T12:32:36.103467+01:00",
88               "goalstate": "primary",
89               "description": "Setting goal state of node 1 \"node1\" (localhost:5501) to primary now that at least one secondary candidate node is healthy.",
90               "formationid": "default",
91               "reportedlsn": "0/4000060",
92               "reportedstate": "wait_primary",
93               "reportedrepstate": "async",
94               "candidatepriority": 50,
95               "replicationquorum": true
96           },
97           {
98               "nodeid": 1,
99               "eventid": 16,
100               "groupid": 0,
101               "nodehost": "localhost",
102               "nodename": "node1",
103               "nodeport": 5501,
104               "eventtime": "2021-03-18T12:32:36.215494+01:00",
105               "goalstate": "primary",
106               "description": "New state is reported by node 1 \"node1\" (localhost:5501): \"primary\"",
107               "formationid": "default",
108               "reportedlsn": "0/4000110",
109               "reportedstate": "primary",
110               "reportedrepstate": "quorum",
111               "candidatepriority": 50,
112               "replicationquorum": true
113           }
114          ]
115

AUTHOR

117       Microsoft
118
120       Copyright (c) Microsoft Corporation. All rights reserved.
121
122
123
124
1252.0                              Sep 13, 2023        PG_AUTOCTL SHOW EVENTS(1)
Impressum