PG_AUTOCTL_SET_NODE_REPLICATION-QUORUM(1)

πŸ“¦
version 2.1 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– pg_autoctl set node replication-quorum β€” the manual, but make it cute πŸ’–

okay bestie, welcome to PG_AUTOCTL SET NODE REPLICATION-QUORUM(1), the section-1 manual page for the pg_autoctl girlies (and fellas, and everyone in between). this one's about flipping the replication-quorum switch on a node and making the monitor actually listen. it's giving "small command, big consequences" energy. let's get into it. πŸ¦‹


✨ NAME ✨

pg_autoctl set node replication-quorum β€” literally just pg_autoctl set node replication-quorum.

pg_autoctl set replication-quorum β€” sets the replication-quorum property from the monitor. that's the whole job. no cap. πŸ’…


🌸 SYNOPSIS 🌸

this command sets the pg_autoctl replication quorum for a given node, like so:

usage: pg_autoctl set node replication-quorum  [ --pgdata ] [ --json ] [ --formation ] [ --name ] <true|false>

--pgdata      path to data directory
--formation   pg_auto_failover formation
--name        pg_auto_failover node name
--json        output data in the JSON format

so yes, you do have to hand it a <true|false> at the end. it's not gonna guess your vibe for you. πŸ™ˆ


πŸ‘‘ DESCRIPTION πŸ‘‘

if you wanna see the whole menu of replication settings (not just this one), go check out pg_autoctl show settings. it's the full list, the whole collection, the complete era. πŸŽ€


πŸ’… OPTIONS πŸ’…

  • --pgdata β€” where the Postgres node you're managing lives locally. defaults to the environment variable PGDATA. and hey, if you'd rather connect to a monitor from literally anywhere instead of using the monitor URI that a local Postgres node managed with pg_autoctl is using, use --monitor instead. slay. ✨
  • --json β€” output JSON formatted data. that's it, that's the option. 🀝
  • --formation β€” show replication settings for the given formation. defaults to default, because of course it does.
  • --name β€” show replication settings for the given node, selected by name. gotta name names, bestie. πŸ’–

🌈 ENVIRONMENT 🌈

  • PGDATA Postgres directory location. you can use this instead of the --pgdata option. same energy, different spelling.
  • PG_AUTOCTL_MONITOR Postgres URI to connect to the monitor node. works instead of the --monitor option. so if you're allergic to flags, this is your moment. πŸ”₯
  • XDG_CONFIG_HOME the pg_autoctl command stores its configuration files in the standard place XDG_CONFIG_HOME. see the XDG Base Directory Specification. it's very "i read the spec" of it.
  • XDG_DATA_HOME the pg_autoctl command stores its internal states files in the standard place XDG_DATA_HOME, which defaults to ~/.local/share. see the XDG Base Directory Specification. again. the spec stays winning.

🧚 EXAMPLES 🧚

turning it OFF, in all its verbose glory:

$ pg_autoctl set node replication-quorum --name node1 false
12:49:37 94092 INFO  Waiting for the settings to have been applied to the monitor and primary node
12:49:37 94092 INFO  New state is reported by node 1 "node1" (localhost:5501): "apply_settings"
12:49:37 94092 INFO  Setting goal state of node 1 "node1" (localhost:5501) to primary after it applied replication properties change.
12:49:37 94092 INFO  New state is reported by node 1 "node1" (localhost:5501): "primary"
false

and now turning it ON, but make it JSON:

$ pg_autoctl set node replication-quorum --name node1 true --json
12:49:42 94199 INFO  Waiting for the settings to have been applied to the monitor and primary node
12:49:42 94199 INFO  New state is reported by node 1 "node1" (localhost:5501): "apply_settings"
12:49:42 94199 INFO  Setting goal state of node 1 "node1" (localhost:5501) to primary after it applied replication properties change.
12:49:43 94199 INFO  New state is reported by node 1 "node1" (localhost:5501): "primary"
{
    "replication-quorum": true
}

see how it waits, applies, reports, and then hands you the answer? that's the whole arc. character development, honestly. πŸ˜­πŸ’œ


πŸŽ€ AUTHOR πŸŽ€

Microsoft


Copyright (c) Microsoft Corporation. All rights reserved.


and that's the page, bestie!! 🫢 this was PG_AUTOCTL SET NODE REPLICATION-QUORUM(1), version 2.1, dated Jan 18, 2025, and yes β€” that's the manual name, the version and the date, all right here in the sign-off so the footer didn't have to be boring. go forth and quorum responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from