PG_AUTOCTL DISABLE MAINTENANCE(1) | pg_auto_failover | PG_AUTOCTL DISABLE MAINTENANCE(1) |
pg_autoctl disable maintenance - pg_autoctl disable maintenance
pg_autoctl disable maintenance - Disable Postgres maintenance mode on this node
A pg_auto_failover can be put to a maintenance state. The Postgres node is then still registered to the monitor, and is known to be unreliable until maintenance is disabled. A node in the maintenance state is not a candidate for promotion.
Typical use of the maintenance state include Operating System or Postgres reboot, e.g. when applying security upgrades.
usage: pg_autoctl disable maintenance [ --pgdata --allow-failover ] --pgdata path to data directory
PGDATA
PG_AUTOCTL_MONITOR
XDG_CONFIG_HOME
XDG_DATA_HOME
$ pg_autoctl show state
Name | Node | Host:Port | LSN | Connection | Current State | Assigned State ------+-------+----------------+-----------+--------------+---------------------+-------------------- node1 | 1 | localhost:5501 | 0/4000810 | read-write | primary | primary node2 | 2 | localhost:5502 | 0/4000810 | read-only | secondary | secondary node3 | 3 | localhost:5503 | 0/4000810 | none | maintenance | maintenance $ pg_autoctl disable maintenance --pgdata node3 12:06:37 47542 INFO Listening monitor notifications about state changes in formation "default" and group 0 12:06:37 47542 INFO Following table displays times when notifications are received
Time | Name | Node | Host:Port | Current State | Assigned State ---------+-------+-------+----------------+---------------------+-------------------- 12:06:37 | node3 | 3 | localhost:5503 | maintenance | catchingup 12:06:37 | node3 | 3 | localhost:5503 | catchingup | catchingup 12:06:37 | node3 | 3 | localhost:5503 | catchingup | secondary 12:06:37 | node3 | 3 | localhost:5503 | secondary | secondary $ pg_autoctl show state
Name | Node | Host:Port | LSN | Connection | Current State | Assigned State ------+-------+----------------+-----------+--------------+---------------------+-------------------- node1 | 1 | localhost:5501 | 0/4000848 | read-write | primary | primary node2 | 2 | localhost:5502 | 0/4000848 | read-only | secondary | secondary node3 | 3 | localhost:5503 | 0/4000000 | read-only | secondary | secondary
Microsoft
Copyright (c) Microsoft Corporation. All rights reserved.
November 6, 2022 | 2.0 |