PG_AUTOCTL CREATE COORDINATOR(1)

πŸ“¦
version 2.2 Β· 5 versions
, in debian trixie, ubuntu questing

✨ PG_AUTOCTL CREATE COORDINATOR ✨

okay bestie, quick vibe check: this is the pg_autoctl create coordinator page from the pg_auto_failover manual. yes the manual name is literally part of the flex. let's get into it πŸ’…


🌸 NAME 🌸

pg_autoctl create coordinator β€” pg_autoctl create coordinator

aka: spin up a pg_auto_failover Coordinator node. that's the whole job, and she does it gorgeously 🫢


πŸŽ€ SYNOPSIS πŸŽ€

so the command pg_autoctl create coordinator initializes a pg_auto_failover Coordinator node for a Citus formation. and the coordinator is not like the other girls in a Citus formation β€” she's special: that's where your client application connects, whether it's to manage the formation and the sharding of the tables, or just for its normal SQL traffic. main character energy, fr fr πŸ‘‘

and also? the coordinator has to register every worker in the formation. she's the group chat admin. she knows everyone. πŸ’–

usage: pg_autoctl create coordinator

  --pgctl           path to pg_ctl
  --pgdata          path to data directory
  --pghost          PostgreSQL's hostname
  --pgport          PostgreSQL's port number
  --hostname        hostname by which postgres is reachable
  --listen          PostgreSQL's listen_addresses
  --username        PostgreSQL's username
  --dbname          PostgreSQL's database name
  --name            pg_auto_failover node name
  --formation       pg_auto_failover formation
  --monitor         pg_auto_failover Monitor Postgres URL
  --auth            authentication method for connections from monitor
  --skip-pg-hba     skip editing pg_hba.conf rules
  --citus-secondary when used, this worker node is a citus secondary
  --citus-cluster   name of the Citus Cluster for read-replicas
  --ssl-self-signed setup network encryption using self signed certificates (does NOT protect against MITM)
  --ssl-mode        use that sslmode in connection strings
  --ssl-ca-file     set the Postgres ssl_ca_file to that file path
  --ssl-crl-file    set the Postgres ssl_crl_file to that file path
  --no-ssl          don't enable network encryption (NOT recommended, prefer --ssl-self-signed)
  --server-key      set the Postgres ssl_key_file to that file path
  --server-cert     set the Postgres ssl_cert_file to that file path

πŸ¦‹ DESCRIPTION πŸ¦‹

ngl this command works exactly the same as pg_autoctl create postgres, it just implements the following extra steps on top:

  1. adds shared_preload_libraries = citus to the local PostgreSQL instance configuration. like, she preloads it. iconique.
  2. enables the whole local area network to connect to the coordinator, by adding an entry for e.g. 192.168.1.0/24 in the PostgreSQL HBA configuration. the whole LAN. she's social like that 🌈
  3. creates the extension citus in the target database. slay.
IMPORTANT: the default --dbname is the same as the current system user name, which in many case is going to be postgres. Please make sure to use the --dbname option with the actual database that you're going to use with your application. 😭
IMPORTANT: Citus does not support multiple databases, you have to use the database where Citus is created. When using Citus, that is essential to the well behaving of worker failover. no cap, this one actually matters πŸ’€

πŸ’– OPTIONS πŸ’–

okay so the common options live in the pg_autoctl create postgres manual page β€” go read that one too, bestie. this section is only listing the options that are specific to pg_autoctl create coordinator:

  • --citus-secondary β€” use this option to create a coordinator dedicated to a Citus Secondary cluster. See Citus Secondaries and read-replica for more information. πŸ’«
  • --citus-cluster β€” use this option to name the Citus Secondary cluster that this coordinator node belongs to. Use the same cluster name again for the worker nodes that are part of this cluster β€” matchy matchy, it's giving coordinated fits πŸ‘― See Citus Secondaries and read-replica for more information.

πŸ‘‘ AUTHOR πŸ‘‘

Microsoft


Copyright (c) Microsoft Corporation. All rights reserved.


and that's the whole page, babe 🫢 this was version 2.2, dated Apr 07, 2025, and it's part of the pg_auto_failover manual β€” PG_AUTOCTL CREATE COORDINATOR(1). go make a coordinator, she's gonna eat πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from