PG_AUTOCTL_CREATE_FORMATION(1)
π PG_AUTOCTL CREATE FORMATION(1) π
okay bestie, so this is the pg_autoctl create formation page from the pg_auto_failover manual β and yeah, we're in section 1 of the manual, the classic "user commands" girlies. let's get into it π«Ά
β¨ NAME β¨
pg_autoctl create formation β pg_autoctl create formation
pg_autoctl create formation β spin up a brand new formation on the pg_auto_failover monitor π
πΈ SYNOPSIS πΈ
this command registers a new formation on the monitor, with the kind you picked:
usage: pg_autoctl create formation [ --pgdata --monitor --formation --kind --dbname --with-secondary --without-secondary ]
--pgdata path to data directory
--monitor pg_auto_failover Monitor Postgres URL
--formation name of the formation to create
--kind formation kind, either "pgsql" or "citus"
--dbname name for postgres database to use in this formation
--enable-secondary create a formation that has multiple nodes that can be
used for fail over when others have issues
--disable-secondary create a citus formation without nodes to fail over to
--number-sync-standbys minimum number of standbys to confirm write
no cap, that's the whole vibe right there π
π¦ DESCRIPTION π¦
one single pg_auto_failover monitor can manage literally any number of formations, and each formation is made up of at least one Postgres service group. this command creates a new formation so that, once it exists, you can go ahead and register Postgres nodes into it. it's giving "set up the group chat before you add the members" energy π
π OPTIONS π
the following options are available to pg_autoctl create formation:
--pgdataβ where you wanna initialize a Postgres database cluster, using eitherpg_ctl initdborpg_basebackup. defaults to the environment variablePGDATA. main character location energy π--monitorβ the Postgres URI used to connect to the monitor. it must use theautoctl_nodeusername and target thepg_auto_failoverdatabase name. pro tip: you can show the Postgres URI from the monitor node withpg_autoctl show uri. π₯--formationβ the name of the formation to create. name her, bestie β¨--kindβ apg_auto_failoverformation can be kindpgsqlor kindcitus. as of right now,citusformation kinds are not managed in the Open Source version ofpg_auto_failover. iykyk π«Ά--dbnameβ the name of the database to use in the formation, mostly useful for formation kindscitus, where the Citus extension is only installed in a single target database. one database, one destiny π--enable-secondaryβ the formation being created allows using standby nodes. defaults totrue. mostly useful for Citus formations. π--disable-secondaryβ see--enable-secondaryabove. same thing, opposite direction π--number-sync-standbyβ Postgres streaming replication usessynchronous_standby_namesto set up how many standby nodes should have received a copy of the transaction data. when you're usingpg_auto_failover, this setup is handled at the formation level instead.- defaults to
zerowhen creating the first two Postgres nodes in a formation in the same group. when set tozero,pg_auto_failoveruses synchronous replication only when a standby node is available: the idea is to allow failover β this setting does not allow proper HA for Postgres. π¨ - when adding a third node that participates in the quorum (one primary, two secondaries), the setting is automatically changed from
zerotoone. glow-up, automatic β¨
- defaults to
π ENVIRONMENT π
PGDATAβ Postgres directory location. can be used instead of the--pgdataoption.PG_AUTOCTL_MONITORβ Postgres URI to connect to the monitor node, can be used instead of 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.
these env vars are lowkey the "instead of typing the flag" besties. use them, they're iconic π
π AUTHOR π
Microsoft
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
and that's the whole page, bestie!! this is from pg_auto_failover version 2.1, dated Jan 18, 2025, and it lives in section 1 of the manual as PG_AUTOCTL CREATE FORMATION(1). periodt. go create a formation, you've got this π
ππ¦
π¦ where this page comes from
- fedora 43: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- fedora 44: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms