1PG_AUTOCTL DISABLE MONITOR(1)  pg_auto_failover  PG_AUTOCTL DISABLE MONITOR(1)
2
3
4

NAME

6       pg_autoctl disable monitor - pg_autoctl disable monitor
7
8       pg_autoctl disable monitor - Disable the monitor for this node
9

SYNOPSIS

11       It  is  possible  to disable the pg_auto_failover monitor and enable it
12       again online in a running pg_autoctl Postgres node. The main  use-cases
13       where  this  operation is useful is when the monitor node has to be re‐
14       placed, either after a full crash of the previous monitor node, of  for
15       migrating  to  a new monitor node (hardware replacement, region or zone
16       migration, etc).
17
18           usage: pg_autoctl disable monitor  [ --pgdata --force ]
19
20          --pgdata      path to data directory
21          --force       force unregistering from the monitor
22

OPTIONS

24       --pgdata
25              Location of the Postgres node being managed locally. Defaults to
26              the  environment  variable PGDATA. Use --monitor to connect to a
27              monitor from anywhere, rather than the monitor URI used by a lo‐
28              cal Postgres node managed with pg_autoctl.
29
30       --force
31              The --force covers the two following situations:
32
33                 1. By  default,  the command expects to be able to connect to
34                    the current monitor. When the current known monitor in the
35                    setup  is  not  running  anymore, use --force to skip this
36                    step.
37
38                 2. When pg_autoctl could connect to the monitor and the  node
39                    is  found  there,  this is normally an error that prevents
40                    from disabling the monitor. Using --force allows the  com‐
41                    mand  to  drop the node from the monitor and continue with
42                    disabling the monitor.
43

ENVIRONMENT

45       PGDATA
46          Postgres directory location. Can be used instead of the --pgdata op‐
47          tion.
48
49       PG_AUTOCTL_MONITOR
50          Postgres  URI to connect to the monitor node, can be used instead of
51          the --monitor option.
52
53       XDG_CONFIG_HOME
54          The pg_autoctl command stores its configuration files in  the  stan‐
55          dard  place  XDG_CONFIG_HOME.  See the XDG Base Directory Specifica‐
56          tion.
57
58       XDG_DATA_HOME
59          The pg_autoctl command stores its internal states files in the stan‐
60          dard  place XDG_DATA_HOME, which defaults to ~/.local/share. See the
61          XDG Base Directory Specification.
62

EXAMPLES

64          $ pg_autoctl show state
65              Name |  Node |      Host:Port |       LSN |   Connection |       Current State |      Assigned State
66          ------+-------+----------------+-----------+--------------+---------------------+--------------------
67          node1 |     1 | localhost:5501 | 0/4000148 |   read-write |             primary |             primary
68          node2 |     2 | localhost:5502 | 0/4000148 |    read-only |           secondary |           secondary
69          node3 |     3 | localhost:5503 | 0/4000148 |    read-only |           secondary |           secondary
70
71
72          $ pg_autoctl disable monitor --pgdata node3
73          12:41:21 43039 INFO  Found node 3 "node3" (localhost:5503) on the monitor
74          12:41:21 43039 FATAL Use --force to remove the node from the monitor
75
76          $ pg_autoctl disable monitor --pgdata node3 --force
77          12:41:32 43219 INFO  Removing node 3 "node3" (localhost:5503) from monitor
78
79          $ pg_autoctl show state
80           Name |  Node |      Host:Port |       LSN |   Connection |       Current State |      Assigned State
81          ------+-------+----------------+-----------+--------------+---------------------+--------------------
82          node1 |     1 | localhost:5501 | 0/4000760 |   read-write |             primary |             primary
83          node2 |     2 | localhost:5502 | 0/4000760 |    read-only |           secondary |           secondary
84

AUTHOR

86       Microsoft
87
89       Copyright (c) Microsoft Corporation. All rights reserved.
90
91
92
93
942.0                              Sep 13, 2023    PG_AUTOCTL DISABLE MONITOR(1)
Impressum