1PG_AUTOCTL DISABLE MAINTENANCE(1p)g_auto_failovePrG_AUTOCTL DISABLE MAINTENANCE(1)
2
3
4

NAME

6       pg_autoctl disable maintenance - pg_autoctl disable maintenance
7
8       pg_autoctl  disable  maintenance - Disable Postgres maintenance mode on
9       this node
10

SYNOPSIS

12       A pg_auto_failover can be put to a maintenance state. The Postgres node
13       is  then still registered to the monitor, and is known to be unreliable
14       until maintenance is disabled. A node in the maintenance state is not a
15       candidate for promotion.
16
17       Typical  use of the maintenance state include Operating System or Post‐
18       gres reboot, e.g. when applying security upgrades.
19
20           usage: pg_autoctl disable maintenance  [ --pgdata --allow-failover ]
21
22          --pgdata      path to data directory
23

OPTIONS

25       --pgdata
26              Location of the Postgres node being managed locally. Defaults to
27              the  environment  variable PGDATA. Use --monitor to connect to a
28              monitor from anywhere, rather than the monitor URI used by a lo‐
29              cal Postgres node managed with pg_autoctl.
30
31       --formation
32              Target formation where to disable secondary feature.
33

ENVIRONMENT

35       PGDATA
36          Postgres directory location. Can be used instead of the --pgdata op‐
37          tion.
38
39       PG_AUTOCTL_MONITOR
40          Postgres URI to connect to the monitor node, can be used instead  of
41          the --monitor option.
42
43       XDG_CONFIG_HOME
44          The  pg_autoctl  command stores its configuration files in the stan‐
45          dard place XDG_CONFIG_HOME. See the XDG  Base  Directory  Specifica‐
46          tion.
47
48       XDG_DATA_HOME
49          The pg_autoctl command stores its internal states files in the stan‐
50          dard place XDG_DATA_HOME, which defaults to ~/.local/share. See  the
51          XDG Base Directory Specification.
52

EXAMPLES

54          $ pg_autoctl show state
55           Name |  Node |      Host:Port |       LSN |   Connection |       Current State |      Assigned State
56          ------+-------+----------------+-----------+--------------+---------------------+--------------------
57          node1 |     1 | localhost:5501 | 0/4000810 |   read-write |             primary |             primary
58          node2 |     2 | localhost:5502 | 0/4000810 |    read-only |           secondary |           secondary
59          node3 |     3 | localhost:5503 | 0/4000810 |         none |         maintenance |         maintenance
60
61          $ pg_autoctl disable maintenance --pgdata node3
62          12:06:37 47542 INFO  Listening monitor notifications about state changes in formation "default" and group 0
63          12:06:37 47542 INFO  Following table displays times when notifications are received
64              Time |  Name |  Node |      Host:Port |       Current State |      Assigned State
65          ---------+-------+-------+----------------+---------------------+--------------------
66          12:06:37 | node3 |     3 | localhost:5503 |         maintenance |          catchingup
67          12:06:37 | node3 |     3 | localhost:5503 |          catchingup |          catchingup
68          12:06:37 | node3 |     3 | localhost:5503 |          catchingup |           secondary
69          12:06:37 | node3 |     3 | localhost:5503 |           secondary |           secondary
70
71          $ pg_autoctl show state
72           Name |  Node |      Host:Port |       LSN |   Connection |       Current State |      Assigned State
73          ------+-------+----------------+-----------+--------------+---------------------+--------------------
74          node1 |     1 | localhost:5501 | 0/4000848 |   read-write |             primary |             primary
75          node2 |     2 | localhost:5502 | 0/4000848 |    read-only |           secondary |           secondary
76          node3 |     3 | localhost:5503 | 0/4000000 |    read-only |           secondary |           secondary
77

AUTHOR

79       Microsoft
80
82       Copyright (c) Microsoft Corporation. All rights reserved.
83
84
85
86
872.0                              Sep 13, 2023PG_AUTOCTL DISABLE MAINTENANCE(1)
Impressum