1PG_AUTOCTL CONFIG SET(1) pg_auto_failover PG_AUTOCTL CONFIG SET(1)
2
3
4
6 pg_autoctl config set - pg_autoctl config set
7
8 pg_autoctl config set - Set the value of a given pg_autoctl configura‐
9 tion variable
10
12 This command prints a pg_autoctl configuration setting:
13
14 usage: pg_autoctl config set [ --pgdata ] [ --json ] section.option [ value ]
15
16 --pgdata path to data directory
17
19 --pgdata
20 Location of the Postgres node being managed locally. Defaults to
21 the environment variable PGDATA. Use --monitor to connect to a
22 monitor from anywhere, rather than the monitor URI used by a lo‐
23 cal Postgres node managed with pg_autoctl.
24
25 --json Output JSON formatted data.
26
28 PGDATA
29 Postgres directory location. Can be used instead of the --pgdata op‐
30 tion.
31
32 PG_AUTOCTL_MONITOR
33 Postgres URI to connect to the monitor node, can be used instead of
34 the --monitor option.
35
36 XDG_CONFIG_HOME
37 The pg_autoctl command stores its configuration files in the stan‐
38 dard place XDG_CONFIG_HOME. See the XDG Base Directory Specifica‐
39 tion.
40
41 XDG_DATA_HOME
42 The pg_autoctl command stores its internal states files in the stan‐
43 dard place XDG_DATA_HOME, which defaults to ~/.local/share. See the
44 XDG Base Directory Specification.
45
47 This commands allows to set a pg_autoctl configuration setting to a new
48 value. Most settings are possible to change and can be reloaded online.
49
50 Some of those commands can then be applied with a pg_autoctl reload
51 command to an already running process.
52
54 pg_autoctl.role
55 This setting can not be changed. It can be either monitor or keeper
56 and the rest of the configuration file is read depending on this
57 value.
58
59 pg_autoctl.monitor
60 URI of the pg_autoctl monitor Postgres service. Can be changed with
61 a reload.
62
63 To register an existing node to a new monitor, use pg_autoctl dis‐
64 able monitor and then pg_autoctl enable monitor.
65
66 pg_autoctl.formation
67 Formation to which this node has been registered. Changing this set‐
68 ting is not supported.
69
70 pg_autoctl.group
71 Group in which this node has been registered. Changing this setting
72 is not supported.
73
74 pg_autoctl.name
75 Name of the node as known to the monitor and listed in pg_autoctl
76 show state. Can be changed with a reload.
77
78 pg_autoctl.hostname
79 Hostname or IP address of the node, as known to the monitor. Can be
80 changed with a reload.
81
82 pg_autoctl.nodekind
83 This setting can not be changed and depends on the command that has
84 been used to create this pg_autoctl node.
85
86 postgresql.pgdata
87 Directory where the managed Postgres instance is to be created (or
88 found) and managed. Can't be changed.
89
90 postgresql.pg_ctl
91 Path to the pg_ctl tool used to manage this Postgres instance. Ab‐
92 solute path depends on the major version of Postgres and looks like
93 /usr/lib/postgresql/13/bin/pg_ctl when using a debian or ubuntu OS.
94
95 Can be changed after a major upgrade of Postgres.
96
97 postgresql.dbname
98 Name of the database that is used to connect to Postgres. Can be
99 changed, but then must be changed manually on the monitor's pgauto‐
100 failover.formation table with a SQL command.
101
102 WARNING:
103 When using pg_auto_failover enterprise edition with Citus sup‐
104 port, this is the database where pg_autoctl maintains the list
105 of Citus nodes on the coordinator. Using the same database name
106 as your application that uses Citus is then crucial.
107
108 postgresql.host
109 Hostname to use in connection strings when connecting from the local
110 pg_autoctl process to the local Postgres database. Defaults to using
111 the Operating System default value for the Unix Domain Socket direc‐
112 tory, either /tmp or when using debian or ubuntu /var/run/post‐
113 gresql.
114
115 Can be changed with a reload.
116
117 postgresql.port
118 Port on which Postgres should be managed. Can be changed offline,
119 between a pg_autoctl stop and a subsequent pg_autoctl start.
120
121 postgresql.listen_addresses
122 Value to set to Postgres parameter of the same name. At the moment
123 pg_autoctl only supports a single address for this parameter.
124
125 postgresql.auth_method
126 Authentication method to use when editing HBA rules to allow the
127 Postgres nodes of a formation to connect to each other, and to the
128 monitor, and to allow the monitor to connect to the nodes.
129
130 Can be changed online with a reload, but actually adding new HBA
131 rules requires a restart of the "node-active" service.
132
133 postgresql.hba_level
134 This setting reflects the choice of --skip-pg-hba or --pg-hba-lan
135 that has been used when creating this pg_autoctl node. Can be
136 changed with a reload, though the HBA rules that have been previ‐
137 ously added will not get removed.
138
139 ssl.active, ssl.sslmode, ssl.cert_file, ssl.key_file, etc
140 Please use the command pg_autoctl enable ssl or pg_autoctl disable
141 ssl to manage the SSL settings in the ssl section of the configura‐
142 tion. Using those commands, the settings can be changed online.
143
144 replication.maximum_backup_rate
145 Used as a parameter to pg_basebackup, defaults to 100M. Can be
146 changed with a reload. Changing this value does not affect an al‐
147 ready running pg_basebackup command.
148
149 Limiting the bandwidth used by pg_basebackup makes the operation
150 slower, and still has the advantage of limiting the impact on the
151 disks of the primary server.
152
153 replication.backup_directory
154 Target location of the pg_basebackup command used by pg_autoctl when
155 creating a secondary node. When done with fetching the data over the
156 network, then pg_autoctl uses the rename(2) system-call to rename
157 the temporary download location to the target PGDATA location.
158
159 The rename(2) system-call is known to be atomic when both the source
160 and the target of the operation are using the same file system /
161 mount point.
162
163 Can be changed online with a reload, will not affect already running
164 pg_basebackup sub-processes.
165
166 replication.password
167 Used as a parameter in the connection string to the upstream Post‐
168 gres node. The "replication" connection uses the password set-up in
169 the pg_autoctl configuration file.
170
171 Changing the replication.password of a pg_autoctl configuration has
172 no effect on the Postgres database itself. The password must match
173 what the Postgres upstream node expects, which can be set with the
174 following SQL command run on the upstream server (primary or other
175 standby node):
176
177 alter user pgautofailover_replicator password 'h4ckm3m0r3';
178
179 The replication.password can be changed online with a reload, but
180 requires restarting the Postgres service to be activated. Postgres
181 only reads the primary_conninfo connection string at start-up, up to
182 and including Postgres 12. With Postgres 13 and following, it is
183 possible to reload this Postgres parameter.
184
185 timeout.network_partition_timeout
186 Timeout (in seconds) that pg_autoctl waits before deciding that it
187 is on the losing side of a network partition. When pg_autoctl fails
188 to connect to the monitor and when the local Postgres instance
189 pg_stat_replication system view is empty, and after this many sec‐
190 onds have passed, then pg_autoctl demotes itself.
191
192 Can be changed with a reload.
193
194 timeout.prepare_promotion_catchup
195 Currently not used in the source code. Can be changed with a reload.
196
197 timeout.prepare_promotion_walreceiver
198 Currently not used in the source code. Can be changed with a reload.
199
200 timeout.postgresql_restart_failure_timeout
201 When pg_autoctl fails to start Postgres for at least this duration
202 from the first attempt, then it starts reporting that Postgres is
203 not running to the monitor, which might then decide to implement a
204 failover.
205
206 Can be changed with a reload.
207
208 timeout.postgresql_restart_failure_max_retries
209 When pg_autoctl fails to start Postgres for at least this many times
210 then it starts reporting that Postgres is not running to the moni‐
211 tor, which them might decide to implement a failover.
212
213 Can be changed with a reload.
214
216 Microsoft
217
219 Copyright (c) Microsoft Corporation. All rights reserved.
220
221
222
223
2242.0 Sep 13, 2023 PG_AUTOCTL CONFIG SET(1)