1PG_AUTOCTL SHOW EVENTS(1) pg_auto_failover PG_AUTOCTL SHOW EVENTS(1)
2
3
4
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
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
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 formated data instead of a table formatted list.
57
59 $ pg_autoctl show events --count 2 --json
60 [
61 {
62 "nodeid": 1,
63 "eventid": 15,
64 "groupid": 0,
65 "nodehost": "localhost",
66 "nodename": "node1",
67 "nodeport": 5501,
68 "eventtime": "2021-03-18T12:32:36.103467+01:00",
69 "goalstate": "primary",
70 "description": "Setting goal state of node 1 \"node1\" (localhost:5501) to primary now that at least one secondary candidate node is healthy.",
71 "formationid": "default",
72 "reportedlsn": "0/4000060",
73 "reportedstate": "wait_primary",
74 "reportedrepstate": "async",
75 "candidatepriority": 50,
76 "replicationquorum": true
77 },
78 {
79 "nodeid": 1,
80 "eventid": 16,
81 "groupid": 0,
82 "nodehost": "localhost",
83 "nodename": "node1",
84 "nodeport": 5501,
85 "eventtime": "2021-03-18T12:32:36.215494+01:00",
86 "goalstate": "primary",
87 "description": "New state is reported by node 1 \"node1\" (localhost:5501): \"primary\"",
88 "formationid": "default",
89 "reportedlsn": "0/4000110",
90 "reportedstate": "primary",
91 "reportedrepstate": "quorum",
92 "candidatepriority": 50,
93 "replicationquorum": true
94 }
95 ]
96
98 Microsoft
99
101 Copyright (c) Microsoft Corporation. All rights reserved.
102
103
104
105
1061.6 Aug 04, 2022 PG_AUTOCTL SHOW EVENTS(1)