PG_AUTOCTL SET NODE REPLICATION-QUORUM(1)
π PG_AUTOCTL SET NODE REPLICATION-QUORUM π
okay bestie, welcome to the pg_autoctl set node replication-quorum manual page, from the pg_auto_failover crew π¦
the full name situation is a little extra, so here it is: pg_autoctl set node replication-quorum, and also just pg_autoctl set replication-quorum β both of them are out here setting the replication-quorum property, and they get that property from the monitor. yes ma'am, the monitor is the one spilling the settings tea β
β¨ SYNOPSIS β¨
this command sets the pg_autoctl replication quorum for a given node, periodt:
usage: pg_autoctl set node replication-quorum [ --pgdata ] [ --json ] [ --formation ] [ --name ] <true|false>
--pgdata path to data directory
--formation pg_auto_failover formation
--name pg_auto_failover node name
--json output data in the JSON format
notice the <true|false> at the end β that's not optional, that's the whole point, you gotta pick a lane π
πΈ DESCRIPTION πΈ
so like, if you want the full list of replication settings, go check out pg_autoctl show settings. this page is just about the one property. iykyk π«Ά
π OPTIONS π
--pgdataβ where the Postgres node you're managing locally keeps its data. defaults to thePGDATAenvironment variable. and heads up: 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. different vibes, different connection π«--jsonβ spits the data out in JSON format. for when you want your output structured and cute π--formationβ shows replication settings for the given formation. defaults todefault. it's giving "default formation main character energy" β¨--nameβ shows replication settings for the given node, selected by name. gotta know her name to talk about her π
π¦ ENVIRONMENT π¦
PGDATAβ Postgres directory location. can be used instead of the--pgdataoption. same energy, less typing πPG_AUTOCTL_MONITORβ Postgres URI to connect to the monitor node, can be used instead of the--monitoroption. set it once, live your life πXDG_CONFIG_HOMEβ thepg_autoctlcommand stores its configuration files in the standard placeXDG_CONFIG_HOME. See the XDG Base Directory Specification. very organized of her, honestly π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. internal states? she's keeping a diary and it's in~/.local/shareπ
π₯ EXAMPLES π₯
first one, no JSON, just living:
$ pg_autoctl set node replication-quorum --name node1 false
12:49:37 94092 INFO Waiting for the settings to have been applied to the monitor and primary node
12:49:37 94092 INFO New state is reported by node 1 "node1" (localhost:5501): "apply_settings"
12:49:37 94092 INFO Setting goal state of node 1 "node1" (localhost:5501) to primary after it applied replication properties change.
12:49:37 94092 INFO New state is reported by node 1 "node1" (localhost:5501): "primary"
false
and now the same situation but with the --json glow-up:
$ pg_autoctl set node replication-quorum --name node1 true --json
12:49:42 94199 INFO Waiting for the settings to have been applied to the monitor and primary node
12:49:42 94199 INFO New state is reported by node 1 "node1" (localhost:5501): "apply_settings"
12:49:42 94199 INFO Setting goal state of node 1 "node1" (localhost:5501) to primary after it applied replication properties change.
12:49:43 94199 INFO New state is reported by node 1 "node1" (localhost:5501): "primary"
{
"replication-quorum": true
}
see how it waits, reports state, and then commits to the goal state? that's a whole journey and she ate every step of it π
π AUTHOR π
Microsoft
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
okay that's the whole page bestie, you're officially caught up π«Ά this was pg_auto_failover version 2.2, dated Apr 07, 2025 β love that for us, go forth and set your replication quorum π β¨π
π¦ 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