1PG_AUTOCTL PERFORM SWITCHOVER(1)pg_auto_failoverPG_AUTOCTL PERFORM SWITCHOVER(1)
2
3
4

NAME

6       pg_autoctl perform switchover - pg_autoctl perform switchover
7
8       pg_autoctl  perform  switchover - Perform a switchover for given forma‐
9       tion and group
10

SYNOPSIS

12       This command  starts  a  Postgres  switchover  orchestration  from  the
13       pg_auto_switchover monitor:
14
15          usage: pg_autoctl perform switchover  [ --pgdata --formation --group ]
16
17          --pgdata      path to data directory
18          --formation   formation to target, defaults to 'default'
19          --group       group to target, defaults to 0
20

DESCRIPTION

22       The  pg_auto_switchover  monitor  can  be  used to orchestrate a manual
23       switchover, sometimes also  known  as  a  switchover.  When  doing  so,
24       split-brain  are  prevented thanks to intermediary states being used in
25       the Finite State Machine.
26
27       The pg_autoctl perform switchover command waits until the switchover is
28       known  complete on the monitor, or until the hard-coded 60s timeout has
29       passed.
30
31       The switchover orchestration is done in the background by the  monitor,
32       so  even if the pg_autoctl perform switchover stops on the timeout, the
33       switchover orchestration continues at the monitor.
34
35       See also pg_autoctl perform failover, a synonym for this command.
36

OPTIONS

38       --pgdata
39              Location of the Postgres node being managed locally. Defaults to
40              the  environment  variable PGDATA. Use --monitor to connect to a
41              monitor from anywhere, rather than the monitor URI used by a lo‐
42              cal Postgres node managed with pg_autoctl.
43
44       --formation
45              Formation to target for the operation. Defaults to default.
46
47       --group
48              Postgres  group to target for the operation. Defaults to 0, only
49              Citus formations may have more than one group.
50

ENVIRONMENT

52       PGDATA
53          Postgres directory location. Can be used instead of the --pgdata op‐
54          tion.
55
56       PG_AUTOCTL_MONITOR
57          Postgres  URI to connect to the monitor node, can be used instead of
58          the --monitor option.
59
60       PG_CONFIG
61          Can be set to the absolute path to the pg_config Postgres tool. This
62          is  mostly used in the context of building extensions, though it can
63          be a useful way to select a Postgres version when  several  are  in‐
64          stalled on the same system.
65
66       PATH
67          Used  the  usual  way  mostly. Some entries that are searched in the
68          PATH by the pg_autoctl command are expected to be found  only  once,
69          to avoid mistakes with Postgres major versions.
70
71       PGHOST, PGPORT, PGDATABASE, PGUSER, PGCONNECT_TIMEOUT, ...
72          See the Postgres docs about Environment Variables for details.
73
74       TMPDIR
75          The  pgcopydb  command creates all its work files and directories in
76          ${TMPDIR}/pgcopydb, and defaults to /tmp/pgcopydb.
77
78       XDG_CONFIG_HOME
79          The pg_autoctl command stores its configuration files in  the  stan‐
80          dard  place  XDG_CONFIG_HOME.  See the XDG Base Directory Specifica‐
81          tion.
82
83       XDG_DATA_HOME
84          The pg_autoctl command stores its internal states files in the stan‐
85          dard  place XDG_DATA_HOME, which defaults to ~/.local/share. See the
86          XDG Base Directory Specification.
87

AUTHOR

89       Microsoft
90
92       Copyright (c) Microsoft Corporation. All rights reserved.
93
94
95
96
972.0                              Sep 13, 2023 PG_AUTOCTL PERFORM SWITCHOVER(1)
Impressum