.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "PG_AUTOCTL CONFIG SET" "1" "Nov 06, 2022" "2.0" "pg_auto_failover" .SH NAME pg_autoctl config set \- pg_autoctl config set .sp pg_autoctl config set \- Set the value of a given pg_autoctl configuration variable .SH SYNOPSIS .sp This command prints a \fBpg_autoctl\fP configuration setting: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C usage: pg_autoctl config set [ \-\-pgdata ] [ \-\-json ] section.option [ value ] \-\-pgdata path to data directory .ft P .fi .UNINDENT .UNINDENT .SH OPTIONS .INDENT 0.0 .TP .B \-\-pgdata Location of the Postgres node being managed locally. Defaults to the environment variable \fBPGDATA\fP\&. Use \fB\-\-monitor\fP to connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed with \fBpg_autoctl\fP\&. .TP .B \-\-json Output JSON formatted data. .UNINDENT .SH ENVIRONMENT .sp PGDATA .INDENT 0.0 .INDENT 3.5 Postgres directory location. Can be used instead of the \fB\-\-pgdata\fP option. .UNINDENT .UNINDENT .sp PG_AUTOCTL_MONITOR .INDENT 0.0 .INDENT 3.5 Postgres URI to connect to the monitor node, can be used instead of the \fB\-\-monitor\fP option. .UNINDENT .UNINDENT .sp XDG_CONFIG_HOME .INDENT 0.0 .INDENT 3.5 The pg_autoctl command stores its configuration files in the standard place XDG_CONFIG_HOME. See the \fI\%XDG Base Directory Specification\fP\&. .UNINDENT .UNINDENT .sp XDG_DATA_HOME .INDENT 0.0 .INDENT 3.5 The pg_autoctl command stores its internal states files in the standard place XDG_DATA_HOME, which defaults to \fB~/.local/share\fP\&. See the \fI\%XDG Base Directory Specification\fP\&. .UNINDENT .UNINDENT .SH DESCRIPTION .sp This commands allows to set a pg_autoctl configuration setting to a new value. Most settings are possible to change and can be reloaded online. .sp Some of those commands can then be applied with a \fBpg_autoctl reload\fP command to an already running process. .SH SETTINGS .sp pg_autoctl.role .INDENT 0.0 .INDENT 3.5 This setting can not be changed. It can be either \fBmonitor\fP or \fBkeeper\fP and the rest of the configuration file is read depending on this value. .UNINDENT .UNINDENT .sp pg_autoctl.monitor .INDENT 0.0 .INDENT 3.5 URI of the pg_autoctl monitor Postgres service. Can be changed with a reload. .sp To register an existing node to a new monitor, use \fBpg_autoctl disable monitor\fP and then \fBpg_autoctl enable monitor\fP\&. .UNINDENT .UNINDENT .sp pg_autoctl.formation .INDENT 0.0 .INDENT 3.5 Formation to which this node has been registered. Changing this setting is not supported. .UNINDENT .UNINDENT .sp pg_autoctl.group .INDENT 0.0 .INDENT 3.5 Group in which this node has been registered. Changing this setting is not supported. .UNINDENT .UNINDENT .sp pg_autoctl.name .INDENT 0.0 .INDENT 3.5 Name of the node as known to the monitor and listed in \fBpg_autoctl show state\fP\&. Can be changed with a reload. .UNINDENT .UNINDENT .sp pg_autoctl.hostname .INDENT 0.0 .INDENT 3.5 Hostname or IP address of the node, as known to the monitor. Can be changed with a reload. .UNINDENT .UNINDENT .sp pg_autoctl.nodekind .INDENT 0.0 .INDENT 3.5 This setting can not be changed and depends on the command that has been used to create this pg_autoctl node. .UNINDENT .UNINDENT .sp postgresql.pgdata .INDENT 0.0 .INDENT 3.5 Directory where the managed Postgres instance is to be created (or found) and managed. Can\(aqt be changed. .UNINDENT .UNINDENT .sp postgresql.pg_ctl .INDENT 0.0 .INDENT 3.5 Path to the \fBpg_ctl\fP tool used to manage this Postgres instance. Absolute path depends on the major version of Postgres and looks like \fB/usr/lib/postgresql/13/bin/pg_ctl\fP when using a debian or ubuntu OS. .sp Can be changed after a major upgrade of Postgres. .UNINDENT .UNINDENT .sp postgresql.dbname .INDENT 0.0 .INDENT 3.5 Name of the database that is used to connect to Postgres. Can be changed, but then must be changed manually on the monitor\(aqs \fBpgautofailover.formation\fP table with a SQL command. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 When using pg_auto_failover enterprise edition with Citus support, this is the database where pg_autoctl maintains the list of Citus nodes on the coordinator. Using the same database name as your application that uses Citus is then crucial. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp postgresql.host .INDENT 0.0 .INDENT 3.5 Hostname to use in connection strings when connecting from the local \fBpg_autoctl\fP process to the local Postgres database. Defaults to using the Operating System default value for the Unix Domain Socket directory, either \fB/tmp\fP or when using debian or ubuntu \fB/var/run/postgresql\fP\&. .sp Can be changed with a reload. .UNINDENT .UNINDENT .sp postgresql.port .INDENT 0.0 .INDENT 3.5 Port on which Postgres should be managed. Can be changed offline, between a \fBpg_autoctl stop\fP and a subsequent \fBpg_autoctl start\fP\&. .UNINDENT .UNINDENT .sp postgresql.listen_addresses .INDENT 0.0 .INDENT 3.5 Value to set to Postgres parameter of the same name. At the moment \fBpg_autoctl\fP only supports a single address for this parameter. .UNINDENT .UNINDENT .sp postgresql.auth_method .INDENT 0.0 .INDENT 3.5 Authentication method to use when editing HBA rules to allow the Postgres nodes of a formation to connect to each other, and to the monitor, and to allow the monitor to connect to the nodes. .sp Can be changed online with a reload, but actually adding new HBA rules requires a restart of the "node\-active" service. .UNINDENT .UNINDENT .sp postgresql.hba_level .INDENT 0.0 .INDENT 3.5 This setting reflects the choice of \fB\-\-skip\-pg\-hba\fP or \fB\-\-pg\-hba\-lan\fP that has been used when creating this pg_autoctl node. Can be changed with a reload, though the HBA rules that have been previously added will not get removed. .UNINDENT .UNINDENT .sp ssl.active, ssl.sslmode, ssl.cert_file, ssl.key_file, etc .INDENT 0.0 .INDENT 3.5 Please use the command \fBpg_autoctl enable ssl\fP or \fBpg_autoctl disable ssl\fP to manage the SSL settings in the \fBssl\fP section of the configuration. Using those commands, the settings can be changed online. .UNINDENT .UNINDENT .sp replication.maximum_backup_rate .INDENT 0.0 .INDENT 3.5 Used as a parameter to \fBpg_basebackup\fP, defaults to \fB100M\fP\&. Can be changed with a reload. Changing this value does not affect an already running \fBpg_basebackup\fP command. .sp Limiting the bandwidth used by \fBpg_basebackup\fP makes the operation slower, and still has the advantage of limiting the impact on the disks of the primary server. .UNINDENT .UNINDENT .sp replication.backup_directory .INDENT 0.0 .INDENT 3.5 Target location of the \fBpg_basebackup\fP command used by pg_autoctl when creating a secondary node. When done with fetching the data over the network, then pg_autoctl uses the \fIrename(2)\fP system\-call to rename the temporary download location to the target PGDATA location. .sp The \fIrename(2)\fP 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. .sp Can be changed online with a reload, will not affect already running \fBpg_basebackup\fP sub\-processes. .UNINDENT .UNINDENT .sp replication.password .INDENT 0.0 .INDENT 3.5 Used as a parameter in the connection string to the upstream Postgres node. The "replication" connection uses the password set\-up in the pg_autoctl configuration file. .sp Changing the \fBreplication.password\fP of a pg_autoctl configuration 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): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C alter user pgautofailover_replicator password \(aqh4ckm3m0r3\(aq; .ft P .fi .UNINDENT .UNINDENT .sp The \fBreplication.password\fP can be changed online with a reload, but requires restarting the Postgres service to be activated. Postgres only reads the \fBprimary_conninfo\fP connection string at start\-up, up to and including Postgres 12. With Postgres 13 and following, it is possible to \fIreload\fP this Postgres parameter. .UNINDENT .UNINDENT .sp timeout.network_partition_timeout .INDENT 0.0 .INDENT 3.5 Timeout (in seconds) that pg_autoctl waits before deciding that it is on the losing side of a network partition. When pg_autoctl fails to connect to the monitor and when the local Postgres instance \fBpg_stat_replication\fP system view is empty, and after this many seconds have passed, then pg_autoctl demotes itself. .sp Can be changed with a reload. .UNINDENT .UNINDENT .sp timeout.prepare_promotion_catchup .INDENT 0.0 .INDENT 3.5 Currently not used in the source code. Can be changed with a reload. .UNINDENT .UNINDENT .sp timeout.prepare_promotion_walreceiver .INDENT 0.0 .INDENT 3.5 Currently not used in the source code. Can be changed with a reload. .UNINDENT .UNINDENT .sp timeout.postgresql_restart_failure_timeout .INDENT 0.0 .INDENT 3.5 When pg_autoctl fails 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. .sp Can be changed with a reload. .UNINDENT .UNINDENT .sp timeout.postgresql_restart_failure_max_retries .INDENT 0.0 .INDENT 3.5 When pg_autoctl fails 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. .sp Can be changed with a reload. .UNINDENT .UNINDENT .SH AUTHOR Microsoft .SH COPYRIGHT Copyright (c) Microsoft Corporation. All rights reserved. .\" Generated by docutils manpage writer. .