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