1PG_AUTOCTL DROP NODE(1)        pg_auto_failover        PG_AUTOCTL DROP NODE(1)
2
3
4

NAME

6       pg_autoctl drop node - pg_autoctl drop node
7
8       pg_autoctl drop node - Drop a node from the pg_auto_failover monitor
9

SYNOPSIS

11       This command drops a Postgres node from the pg_auto_failover monitor:
12
13          usage: pg_autoctl drop node [ [ [ --pgdata ] [ --destroy ] ] | [ --monitor [ [ --hostname --pgport ] | [ --formation --name ] ] ] ]
14
15          --pgdata      path to data directory
16          --monitor     pg_auto_failover Monitor Postgres URL
17          --formation   pg_auto_failover formation
18          --name        drop the node with the given node name
19          --hostname    drop the node with given hostname and pgport
20          --pgport      drop the node with given hostname and pgport
21          --destroy     also destroy Postgres database
22          --force       force dropping the node from the monitor
23          --wait        how many seconds to wait, default to 60
24

DESCRIPTION

26       Two  modes  of  operations  are implemented in the pg_autoctl drop node
27       command.
28
29       When removing a node that still exists, it is possible  to  use  pg_au‐
30       toctl  drop node --destroy to remove the node both from the monitor and
31       also delete the local Postgres instance entirely.
32
33       When removing a node that doesn't exist physically anymore, or when the
34       VM  that  used  to host the node has been lost entirely, use either the
35       pair of options --hostname and --pgport or the pair of options --forma‐
36       tion  and  --name  to match the node registration record on the monitor
37       database, and get it removed from the known list of nodes on the  moni‐
38       tor.
39
40       Then option --force can be used when the target node to remove does not
41       exist anymore. When a node has been lost entirely, it's not going to be
42       able  to  finish  the  procedure itself, and it is then possible to in‐
43       struct the monitor of the situation.
44

OPTIONS

46       --pgdata
47              Location of the Postgres node being managed locally. Defaults to
48              the  environment  variable PGDATA. Use --monitor to connect to a
49              monitor from anywhere, rather than the monitor URI used by a lo‐
50              cal Postgres node managed with pg_autoctl.
51
52       --monitor
53              Postgres  URI  used  to connect to the monitor. Must use the au‐
54              toctl_node username and  target  the  pg_auto_failover  database
55              name.  It  is possible to show the Postgres URI from the monitor
56              node using the command pg_autoctl_show_uri.
57
58       --hostname
59              Hostname of the Postgres node to remove from  the  monitor.  Use
60              either --name or --hostname --pgport, but not both.
61
62       --pgport
63              Port of the Postgres node to remove from the monitor. Use either
64              --name or --hostname --pgport, but not both.
65
66       --name Name of the node to remove from the monitor. Use  either  --name
67              or --hostname --pgport, but not both.
68
69       --destroy
70              By  default the pg_autoctl drop monitor commands does not remove
71              the Postgres database for the monitor. When using --destroy, the
72              Postgres installation is also deleted.
73
74       --force
75              By  default  a  node  is  expected  to  reach the assigned state
76              DROPPED when it is removed from the monitor, and has the  oppor‐
77              tunity  to  implement  clean-up actions. When the target node to
78              remove is not available anymore, it is possible to use  the  op‐
79              tion --force to immediately remove the node from the monitor.
80
81       --wait How  many  seconds  to wait for the node to be dropped entirely.
82              The command stops when the target node is not to be found on the
83              monitor  anymore,  or  when  the  timeout has elapsed, whichever
84              comes first. The value 0 (zero) disables the  timeout  and  dis‐
85              ables waiting entirely, making the command async.
86

EXAMPLES

88          $ pg_autoctl drop node --destroy --pgdata ./node3
89          17:52:21 54201 INFO  Reaching assigned state "secondary"
90          17:52:21 54201 INFO  Removing node with name "node3" in formation "default" from the monitor
91          17:52:21 54201 WARN  Postgres is not running and we are in state secondary
92          17:52:21 54201 WARN  Failed to update the keeper's state from the local PostgreSQL instance, see above for details.
93          17:52:21 54201 INFO  Calling node_active for node default/4/0 with current state: PostgreSQL is running is false, sync_state is "", latest WAL LSN is 0/0.
94          17:52:21 54201 INFO  FSM transition to "dropped": This node is being dropped from the monitor
95          17:52:21 54201 INFO  Transition complete: current state is now "dropped"
96          17:52:21 54201 INFO  This node with id 4 in formation "default" and group 0 has been dropped from the monitor
97          17:52:21 54201 INFO  Stopping PostgreSQL at "/Users/dim/dev/MS/pg_auto_failover/tmux/node3"
98          17:52:21 54201 INFO  /Applications/Postgres.app/Contents/Versions/12/bin/pg_ctl --pgdata /Users/dim/dev/MS/pg_auto_failover/tmux/node3 --wait stop --mode fast
99          17:52:21 54201 INFO  /Applications/Postgres.app/Contents/Versions/12/bin/pg_ctl status -D /Users/dim/dev/MS/pg_auto_failover/tmux/node3 [3]
100          17:52:21 54201 INFO  pg_ctl: no server running
101          17:52:21 54201 INFO  pg_ctl stop failed, but PostgreSQL is not running anyway
102          17:52:21 54201 INFO  Removing "/Users/dim/dev/MS/pg_auto_failover/tmux/node3"
103          17:52:21 54201 INFO  Removing "/Users/dim/dev/MS/pg_auto_failover/tmux/config/pg_autoctl/Users/dim/dev/MS/pg_auto_failover/tmux/node3/pg_autoctl.cfg"
104

AUTHOR

106       Microsoft
107
109       Copyright (c) Microsoft Corporation. All rights reserved.
110
111
112
113
1141.6                              Nov 24, 2021          PG_AUTOCTL DROP NODE(1)
Impressum