PG_AUTOCTL CONFIG SET(1)
π PG_AUTOCTL CONFIG SET(1) π
okay so bestie, we're in the pg_auto_failover manual, and this little page is pg_autoctl config set β the glow-up button for your config. π
β¨ NAME β¨
pg_autoctl config set β pg_autoctl config set
pg_autoctl config set β Set the value of a given pg_autoctl configuration variable π
πΈ SYNOPSIS πΈ
This command prints a pg_autoctl configuration setting:
usage: pg_autoctl config set [ --pgdata ] [ --json ] section.option [ value ]
--pgdata path to data directory
π OPTIONS π
--pgdataβ Where the Postgres node you're managing lives locally. It defaults to the environment variablePGDATA. Wanna talk to a monitor from literally anywhere instead of the monitor URI that a local Postgres node managed withpg_autoctlis using? That's what--monitoris for.--jsonβ Spits out the data in JSON format. structured, iconic, machine-readable. β¨
π¦ ENVIRONMENT π¦
PGDATAβ Postgres directory location. You can use this instead of the--pgdataoption, no cap.PG_AUTOCTL_MONITORβ Postgres URI for connecting to the monitor node. Works as a stand-in for 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. πΎ
π DESCRIPTION π
This command lets you set a pg_autoctl configuration setting to a new value. Most settings are actually changeable, and most of them can be reloaded online. Slay.
Some of those commands can then be applied with a pg_autoctl reload command to an already running process. π₯
π SETTINGS π
pg_autoctl.roleβ This setting can not be changed. It can be eithermonitororkeeper, and the rest of the configuration file gets read depending on this value.pg_autoctl.monitorβ URI of thepg_autoctlmonitor Postgres service. Can be changed with a reload.- Wanna register an existing node to a new monitor? Use
pg_autoctl disable monitorand thenpg_autoctl enable monitor. π
- Wanna register an existing node to a new monitor? Use
pg_autoctl.formationβ The formation this node has been registered to. Changing this setting is not supported.pg_autoctl.groupβ The group this node has been registered in. Changing this setting is not supported either.pg_autoctl.nameβ The name of the node as known to the monitor and listed inpg_autoctl show state. Can be changed with a reload.pg_autoctl.hostnameβ Hostname or IP address of the node, as known to the monitor. Can be changed with a reload.pg_autoctl.nodekindβ This setting can not be changed and depends on the command that was used to create thispg_autoctlnode.postgresql.pgdataβ Directory where the managed Postgres instance is to be created (or found) and managed. Can't be changed.postgresql.pg_ctlβ Path to thepg_ctltool used to manage this Postgres instance. The absolute path depends on the major version of Postgres and looks like/usr/lib/postgresql/13/bin/pg_ctlwhen you're on a debian or ubuntu OS.- Can be changed after a major upgrade of Postgres. β
postgresql.dbnameβ Name of the database used to connect to Postgres. Can be changed, but then it must be changed manually on the monitor'spgautofailover.formationtable with a SQL command.
WARNING: When usingpg_auto_failoverenterprise edition with Citus support, this is the database wherepg_autoctlmaintains the list of Citus nodes on the coordinator. Using the same database name as your application that uses Citus is then crucial. π
postgresql.hostβ Hostname to use in connection strings when connecting from the localpg_autoctlprocess to the local Postgres database. Defaults to using the Operating System default value for the Unix Domain Socket directory, either/tmpor, when using debian or ubuntu,/var/run/postgresql.- Can be changed with a reload.
postgresql.portβ Port on which Postgres should be managed. Can be changed offline, between apg_autoctl stopand a subsequentpg_autoctl start.postgresql.listen_addressesβ Value to set to the Postgres parameter of the same name. At the momentpg_autoctlonly supports a single address for this parameter. πpostgresql.auth_methodβ Authentication method to use when editing HBA rules, so the Postgres nodes of a formation can connect to each other, and to the monitor, and so the monitor can connect to the nodes.- Can be changed online with a reload, but actually adding new HBA rules requires a restart of the
node-activeservice. π
- Can be changed online with a reload, but actually adding new HBA rules requires a restart of the
postgresql.hba_levelβ This setting reflects the choice of--skip-pg-hbaor--pg-hba-lanthat was used when creating thispg_autoctlnode. Can be changed with a reload, though the HBA rules that have been previously added will not get removed. (they're staying. they said no.)ssl.active,ssl.sslmode,ssl.cert_file,ssl.key_file, etc β Please use the commandpg_autoctl enable sslorpg_autoctl disable sslto manage the SSL settings in thesslsection of the configuration. Using those commands, the settings can be changed online. π§replication.maximum_backup_rateβ Used as a parameter topg_basebackup, defaults to100M. Can be changed with a reload. Changing this value does not affect an already runningpg_basebackupcommand.- Limiting the bandwidth used by
pg_basebackupmakes the operation slower, and still has the advantage of limiting the impact on the disks of the primary server. β¨
- Limiting the bandwidth used by
replication.backup_directoryβ Target location of thepg_basebackupcommand used bypg_autoctlwhen creating a secondary node. When done with fetching the data over the network,pg_autoctluses therename(2)system-call to rename the temporary download location to the targetPGDATAlocation.- The
rename(2)system-call is known to be atomic when both the source and the target of the operation are using the same file system / mount point. π - Can be changed online with a reload, will not affect already running
pg_basebackupsub-processes.
- The
replication.passwordβ Used as a parameter in the connection string to the upstream Postgres node. The"replication"connection uses the password set-up in thepg_autoctlconfiguration file.- Changing the
replication.passwordof apg_autoctlconfiguration has no effect on the Postgres database itself. The password must match what the Postgres upstream node expects, which can be set with the following SQL command run on the upstream server (primary or other standby node):
- Changing the
alter user pgautofailover_replicator password 'h4ckm3m0r3';
- The
replication.passwordcan be changed online with a reload, but requires restarting the Postgres service to be activated. Postgres only reads theprimary_conninfoconnection string at start-up, up to and including Postgres 12. With Postgres 13 and following, it is possible to reload this Postgres parameter. π
timeout.network_partition_timeoutβ Timeout (in seconds) thatpg_autoctlwaits before deciding that it is on the losing side of a network partition. Whenpg_autoctlfails to connect to the monitor and when the local Postgres instancepg_stat_replicationsystem view is empty, and after this many seconds have passed, thenpg_autoctldemotes itself. π- Can be changed with a reload.
timeout.prepare_promotion_catchupβ Currently not used in the source code. Can be changed with a reload.timeout.prepare_promotion_walreceiverβ Currently not used in the source code. Can be changed with a reload.timeout.postgresql_restart_failure_timeoutβ Whenpg_autoctlfails to start Postgres for at least this duration from the first attempt, then it starts reporting that Postgres is not running to the monitor, which might then decide to implement a failover. π- Can be changed with a reload.
timeout.postgresql_restart_failure_max_retriesβ Whenpg_autoctlfails to start Postgres for at least this many times, then it starts reporting that Postgres is not running to the monitor, which them might decide to implement a failover.- Can be changed with a reload.
π AUTHOR π
Microsoft
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
okay that's the whole page bestie, you ate it up π version 2.2, dated Apr 07, 2025 β go forth and configure, mwah π«Άπ
π¦ 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