PG_AUTOCTL SET FORMATION NUMBER-SYNC-STANDBYS(1)
β¨ NAME β¨
pg_autoctl set formation number-sync-standbys β bestie, this is the pg_autoctl set formation number-sync-standbys command, and it's here to set number_sync_standbys for a formation, straight from the monitor. π
πΈ SYNOPSIS πΈ
This command sets a pg_autoctl replication settings for number sync standbys, like:
usage: pg_autoctl set formation number-sync-standbys [ --pgdata ] [ --json ] [ --formation ] <number_sync_standbys>
--pgdata path to data directory
--formation pg_auto_failover formation
--json output data in the JSON format
okay so that's the shape of it: you've got your flags in brackets, and then the actual <number_sync_standbys> value sitting there at the end, being the whole point. π
π¦ DESCRIPTION π¦
So here's the vibe. The pg_auto_failover monitor makes sure that at least N+1 candidate standby nodes are registered when number-sync-standbys is N. π
Which means β and this is the part you actually need to know, bestie β to be able to run the following command, at least 3 standby nodes with a non-zero candidate priority must be registered to the monitor:
$ pg_autoctl set formation number-sync-standbys 2
it's giving "do the math before you do the command." N is 2, so you need 2+1 = 3 eligible standbys, no cap. π₯
Also, go look at pg_autoctl show settings for the full list of replication settings β that's where the whole menu lives. π
π OPTIONS π
--pgdataβ Location of the Postgres node being managed locally. Defaults to the environment variablePGDATA. Use--monitorto connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed withpg_autoctl. π«Ά--jsonβ Output JSON formatted data. that's it, that's the whole thing. structured data supremacy β¨--formationβ Show replication settings for given formation. Defaults todefault. yes bestie, it really does just saydefault.
π ENVIRONMENT π
PGDATAβ Postgres directory location. Can be used instead of the--pgdataoption. same energy, different door.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. ποΈ
π AUTHOR π
Microsoft. the whole author section. one word. iconic behaviour, honestly. π
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
and that's the page, bestie!! this one came to you from pg_auto_failover, version 2.2, dated Apr 07, 2025 β manual section 1, sync-standbys, and she ate. πβ¨π¦πΈπ
π¦ 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