1PG_AUTOCTL DISABLE MONITOR(1) pg_auto_failover PG_AUTOCTL DISABLE MONITOR(1)
2
3
4
6 pg_autoctl disable monitor - pg_autoctl disable monitor
7
8 pg_autoctl disable monitor - Disable the monitor for this node
9
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
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
45 $ pg_autoctl show state
46 Name | Node | Host:Port | LSN | Connection | Current State | Assigned State
47 ------+-------+----------------+-----------+--------------+---------------------+--------------------
48 node1 | 1 | localhost:5501 | 0/4000148 | read-write | primary | primary
49 node2 | 2 | localhost:5502 | 0/4000148 | read-only | secondary | secondary
50 node3 | 3 | localhost:5503 | 0/4000148 | read-only | secondary | secondary
51
52
53 $ pg_autoctl disable monitor --pgdata node3
54 12:41:21 43039 INFO Found node 3 "node3" (localhost:5503) on the monitor
55 12:41:21 43039 FATAL Use --force to remove the node from the monitor
56
57 $ pg_autoctl disable monitor --pgdata node3 --force
58 12:41:32 43219 INFO Removing node 3 "node3" (localhost:5503) from monitor
59
60 $ pg_autoctl show state
61 Name | Node | Host:Port | LSN | Connection | Current State | Assigned State
62 ------+-------+----------------+-----------+--------------+---------------------+--------------------
63 node1 | 1 | localhost:5501 | 0/4000760 | read-write | primary | primary
64 node2 | 2 | localhost:5502 | 0/4000760 | read-only | secondary | secondary
65
67 Microsoft
68
70 Copyright (c) Microsoft Corporation. All rights reserved.
71
72
73
74
751.6 Jan 21, 2022 PG_AUTOCTL DISABLE MONITOR(1)