PG_AUTOCTL SET NODE CANDIDATE-PRIORITY(1)
π pg_autoctl set node candidate-priority β a manual, but make it bestie π
okay so this is page PG_AUTOCTL SET NODE CANDIDATE-PRIORITY(1) from the pg_auto_failover manual, and honestly? it's giving "tiny command, big responsibility". buckle up, we're setting a node's candidate priority and the monitor is gonna hear about it. π
β¨ NAME β¨
pg_autoctl set node candidate-priority β literally just that. the name is the name, bestie, no notes.
pg_autoctl set candidate-priority β same energy, set the candidate-priority property from the monitor. π
πΈ SYNOPSIS πΈ
this command sets the pg_autoctl candidate priority for a given node:
usage: pg_autoctl set node candidate-priority [ --pgdata ] [ --json ] [ --formation ] [ --name ] <priority: 0..100>
--pgdata path to data directory
--formation pg_auto_failover formation
--name pg_auto_failover node name
--json output data in the JSON format
so you're passing a <priority: 0..100> β that's the range, no going rogue with 9000, the vibes have limits. π
π¦ DESCRIPTION π¦
see also pg_autoctl show settings for the full list of replication settings. that's the lore drop if you want the whole picture, iykyk. π
π OPTIONS π
--pgdataβ where the Postgres node you're managing locally keeps its data. it defaults to the environment variablePGDATA. and hey, use--monitorif you wanna connect to a monitor from literally anywhere, instead of the monitor URI that a local Postgres node managed withpg_autoctlis using. π--jsonβ output JSON formatted data. machine-readable, chef's kiss. π€--formationβ show replication settings for a given formation. defaults todefault. ποΈ--nameβ show replication settings for a given node, selected by name. say its name, respectfully. π«Ά
π 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 π₯
setting it to 65 for node1, and look at the monitor doing the absolute most:
$ pg_autoctl set node candidate-priority --name node1 65
12:47:59 92326 INFO Waiting for the settings to have been applied to the monitor and primary node
12:47:59 92326 INFO New state is reported by node 1 "node1" (localhost:5501): "apply_settings"
12:47:59 92326 INFO Setting goal state of node 1 "node1" (localhost:5501) to primary after it applied replication properties change.
12:47:59 92326 INFO New state is reported by node 1 "node1" (localhost:5501): "primary"
65
and same thing but 50 and --json, because we love structured data in this house:
$ pg_autoctl set node candidate-priority --name node1 50 --json
12:48:05 92450 INFO Waiting for the settings to have been applied to the monitor and primary node
12:48:05 92450 INFO New state is reported by node 1 "node1" (localhost:5501): "apply_settings"
12:48:05 92450 INFO Setting goal state of node 1 "node1" (localhost:5501) to primary after it applied replication properties change.
12:48:05 92450 INFO New state is reported by node 1 "node1" (localhost:5501): "primary"
{
"candidate-priority": 50
}
π AUTHOR π
Microsoft
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
okay that's the whole page, you ate. this was version 2.2, dated Apr 07, 2025, and yes the header and footer both spell it PG_AUTOCTL S...ATE-PRIORITY(1) because the terminal was being dramatic about column width. slay, go set some priorities. π«Άπβ¨
π¦ 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