PG_AUTOCTL DISABLE MONITOR(1)
π PG_AUTOCTL DISABLE MONITOR(1) π
okay bestie, welcome to pg_autoctl disable monitor β the pg_autoctl manual page for turning the monitor off for a node. yes, that's the whole vibe. let's go β¨
πΈ NAME πΈ
pg_autoctl disable monitor β pg_autoctl disable monitor
pg_autoctl disable monitor β disable the monitor for this node
so like, it's the command, and it does the thing, and the thing is turning off the monitor for this node. iconic, no notes π
β¨ SYNOPSIS β¨
okay so the tea is: you can totally disable the pg_auto_failover monitor and then enable it again, online, on a pg_autoctl Postgres node that's already running. no downtime drama, no restarting anything π
and when is this actually useful?? the main use-cases are when the monitor node has to be replaced β either after a full crash of the old monitor node, or when you're migrating to a brand new monitor node (think: hardware replacement, region or zone migration, etc). glow-up for your monitor, fr fr π¦
usage: pg_autoctl disable monitor [ --pgdata --force ]
--pgdata path to data directory
--force force unregistering from the monitor
π OPTIONS π
--pgdataβ where's the Postgres node you're managing locally? this is it. it defaults to the environment variablePGDATA. oh and pssst: use--monitorif you wanna connect to a monitor from literally anywhere, instead of using the monitor URI that a local Postgres node managed withpg_autoctlwould use. flexibility, we love her π--forceβ okay so--forceis covering two situations, and here they are:- by default, the command expects to be able to connect to the current monitor. so when the current known monitor in the setup isn't running anymore, use
--forceto skip that step. no monitor? no problem π - when
pg_autoctlcould connect to the monitor and the node is found there, that's normally an error that stops you from disabling the monitor. using--forcelets the command drop the node from the monitor and then keep going with disabling the monitor. breaking up with the monitor, but politely π«Ά
- by default, the command expects to be able to connect to the current monitor. so when the current known monitor in the setup isn't running anymore, use
π ENVIRONMENT π
PGDATAβ Postgres directory location. can be used instead of the--pgdataoption. same energy, fewer flags β¨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 π
first, let's see what the state of the world is:
$ 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
okay now watch what happens when we try to disable the monitor on node3 without --force:
$ 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
yeahhh, FATAL. it found the node and said "bestie, you need --force for that." π
so let's do it with --force:
$ pg_autoctl disable monitor --pgdata node3 --force
12:41:32 43219 INFO Removing node 3 "node3" (localhost:5503) from monitor
and now the state, which is giving... node3 is gone:
$ 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.2, dated Apr 07, 2025, straight from the PG_AUTOCTL DISABLE MONITOR(1) manual. go forth and disable that monitor responsibly π
β¨πΈ
π¦ where this page comes from
- debian trixie: pg-auto-failover-cli 2.2-2 Β· PostgreSQL
- ubuntu questing: pg-auto-failover-cli 2.2-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms