PG_AUTOCTL_DISABLE_MONITOR(1)
β¨ NAME β¨
pg_autoctl disable monitor β bestie, this is the one that turns the monitor OFF for this node π«Ά
It lives in the pg_auto_failover manual (section 1, obviously, she's a command), and the long-form name is literally just:
pg_autoctl disable monitor β Disable the monitor for this node
πΈ SYNOPSIS πΈ
okay so here's the tea: you can disable the pg_auto_failover monitor and then enable it again online, on a running pg_autoctl Postgres node. no downtime era. π
The main use-cases where this is the move:
- the monitor node has to be replaced
- after a full crash of the previous monitor node
- migrating to a new monitor node (hardware replacement, region or zone migration, etc.)
Here's the usage line, verbatim, no cap:
usage: pg_autoctl disable monitor [ --pgdata --force ]
--pgdata path to data directory
--force force unregistering from the monitor
π OPTIONS π
--pgdataβ where the Postgres node that's being managed locally lives. Defaults to the environment variablePGDATA. Also, heads up: use--monitorto connect to a monitor from anywhere, instead of the monitor URI used by a local Postgres node managed withpg_autoctl.--forceβ okay so--forceis covering TWO whole situations, and she's doing the most:- By default, the command expects to be able to connect to the current monitor. When the current known monitor in the setup is not running anymore, use
--forceto skip this step. β¨ - When
pg_autoctlcould connect to the monitor and the node is found there, this is normally an error that prevents from disabling the monitor. Using--forceallows the command to drop the node from the monitor and continue with disabling the monitor.
- By default, the command expects to be able to connect to the current monitor. When the current known monitor in the setup is not running anymore, use
π ENVIRONMENT π
PGDATAβ Postgres directory location. Can be used instead of the--pgdataoption.PG_AUTOCTL_MONITORβ Postgres URI to connect to the monitor node, can be used instead of the--monitoroption.XDG_CONFIG_HOMEβ Thepg_autoctlcommand stores its configuration files in the standard placeXDG_CONFIG_HOME. See the XDG Base Directory Specification.XDG_DATA_HOMEβ Thepg_autoctlcommand stores its internal states files in the standard placeXDG_DATA_HOME, which defaults to~/.local/share. See the XDG Base Directory Specification.
π¦ EXAMPLES π¦
the whole glow-up, start to finish. first, a vibe check on the cluster:
$ pg_autoctl show state
Name | Node | Host:Port | LSN | Connection | Current State | Assigned State
------+-------+----------------+-----------+--------------+---------------------+--------------------
node1 | 1 | localhost:5501 | 0/4000148 | read-write | primary | primary
node2 | 2 | localhost:5502 | 0/4000148 | read-only | secondary | secondary
node3 | 3 | localhost:5503 | 0/4000148 | read-only | secondary | secondary
then we try to disable the monitor on node3 with no --forceβ¦ and she said no π:
$ pg_autoctl disable monitor --pgdata node3
12:41:21 43039 INFO Found node 3 "node3" (localhost:5503) on the monitor
12:41:21 43039 FATAL Use --force to remove the node from the monitor
okay fine, --force it is, slay π
:
$ pg_autoctl disable monitor --pgdata node3 --force
12:41:32 43219 INFO Removing node 3 "node3" (localhost:5503) from monitor
and boom, node3 has left the chat:
$ pg_autoctl show state
Name | Node | Host:Port | LSN | Connection | Current State | Assigned State
------+-------+----------------+-----------+--------------+---------------------+--------------------
node1 | 1 | localhost:5501 | 0/4000760 | read-write | primary | primary
node2 | 2 | localhost:5502 | 0/4000760 | read-only | secondary | secondary
π AUTHOR π
Microsoft π
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
and that's the whole page, bestie!! πβ¨
this was pg_auto_failover, version 2.1, dated Jan 18, 2025, and it's page PG_AUTOCTL DISABLE MONITOR(1) of the manual. mwah. π
ππ¦
π¦ where this page comes from
- fedora 43: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- fedora 44: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms