1PG_AUTOCTL CREATE FORMATION(1) pg_auto_failover PG_AUTOCTL CREATE FORMATION(1)
2
3
4
6 pg_autoctl create formation - pg_autoctl create formation
7
8 pg_autoctl create formation - Create a new formation on the
9 pg_auto_failover monitor
10
12 This command registers a new formation on the monitor, with the speci‐
13 fied kind:
14
15 usage: pg_autoctl create formation [ --pgdata --monitor --formation --kind --dbname --with-secondary --without-secondary ]
16
17 --pgdata path to data directory
18 --monitor pg_auto_failover Monitor Postgres URL
19 --formation name of the formation to create
20 --kind formation kind, either "pgsql" or "citus"
21 --dbname name for postgres database to use in this formation
22 --enable-secondary create a formation that has multiple nodes that can be
23 used for fail over when others have issues
24 --disable-secondary create a citus formation without nodes to fail over to
25 --number-sync-standbys minimum number of standbys to confirm write
26
28 A single pg_auto_failover monitor may manage any number of formations,
29 each composed of at least one Postgres service group. This commands
30 creates a new formation so that it is then possible to register Post‐
31 gres nodes in the new formation.
32
34 The following options are available to pg_autoctl create formation:
35
36 --pgdata
37 Location where to initialize a Postgres database cluster, using
38 either pg_ctl initdb or pg_basebackup. Defaults to the environ‐
39 ment variable PGDATA.
40
41 --monitor
42 Postgres URI used to connect to the monitor. Must use the au‐
43 toctl_node username and target the pg_auto_failover database
44 name. It is possible to show the Postgres URI from the monitor
45 node using the command pg_autoctl show uri.
46
47 --formation
48 Name of the formation to create.
49
50 --kind A pg_auto_failover formation could be of kind pgsql or of kind
51 citus. At the moment citus formation kinds are not managed in
52 the Open Source version of pg_auto_failover.
53
54 --dbname
55 Name of the database to use in the formation, mostly useful to
56 formation kinds citus where the Citus extension is only in‐
57 stalled in a single target database.
58
59 --enable-secondary
60 The formation to be created allows using standby nodes. Defaults
61 to true. Mostly useful for Citus formations.
62
63 --disable-secondary
64 See --enable-secondary above.
65
66 --number-sync-standby
67 Postgres streaming replication uses synchronous_standby_names to
68 setup how many standby nodes should have received a copy of the
69 transaction data. When using pg_auto_failover this setup is han‐
70 dled at the formation level.
71
72 Defaults to zero when creating the first two Postgres nodes in a
73 formation in the same group. When set to zero pg_auto_failover
74 uses synchronous replication only when a standby node is avail‐
75 able: the idea is to allow failover, this setting does not allow
76 proper HA for Postgres.
77
78 When adding a third node that participates in the quorum (one
79 primary, two secondaries), the setting is automatically changed
80 from zero to one.
81
83 PGDATA
84 Postgres directory location. Can be used instead of the --pgdata op‐
85 tion.
86
87 PG_AUTOCTL_MONITOR
88 Postgres URI to connect to the monitor node, can be used instead of
89 the --monitor option.
90
91 XDG_CONFIG_HOME
92 The pg_autoctl command stores its configuration files in the stan‐
93 dard place XDG_CONFIG_HOME. See the XDG Base Directory Specifica‐
94 tion.
95
96 XDG_DATA_HOME
97 The pg_autoctl command stores its internal states files in the stan‐
98 dard place XDG_DATA_HOME, which defaults to ~/.local/share. See the
99 XDG Base Directory Specification.
100
102 Microsoft
103
105 Copyright (c) Microsoft Corporation. All rights reserved.
106
107
108
109
1102.0 Sep 13, 2023 PG_AUTOCTL CREATE FORMATION(1)