1PG_AUTOCTL RUN(1) pg_auto_failover PG_AUTOCTL RUN(1)
2
3
4
6 pg_autoctl run - pg_autoctl run
7
8 pg_autoctl run - Run the pg_autoctl service (monitor or keeper)
9
11 This commands starts the processes needed to run a monitor node or a
12 keeper node, depending on the configuration file that belongs to the
13 --pgdata option or PGDATA environment variable.
14
15 usage: pg_autoctl run [ --pgdata --name --hostname --pgport ]
16
17 --pgdata path to data directory
18 --name pg_auto_failover node name
19 --hostname hostname used to connect from other nodes
20 --pgport PostgreSQL's port number
21
23 When registering Postgres nodes to the pg_auto_failover monitor using
24 the pg_autoctl create postgres command, the nodes are registered with
25 metadata: the node name, hostname and Postgres port.
26
27 The node name is used mostly in the logs and pg_autoctl show state com‐
28 mands and helps human administrators of the formation.
29
30 The node hostname and pgport are used by other nodes, including the
31 pg_auto_failover monitor, to open a Postgres connection.
32
33 Both the node name and the node hostname and port can be changed after
34 the node registration by using either this command (pg_autoctl run) or
35 the pg_autoctl config set command.
36
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 --name Node name used on the monitor to refer to this node. The host‐
45 name is a technical information, and given Postgres requirements
46 on the HBA setup and DNS resolution (both forward and reverse
47 lookups), IP addresses are often used for the hostname.
48
49 The --name option allows using a user-friendly name for your
50 Postgres nodes.
51
52 --hostname
53 Hostname or IP address (both v4 and v6 are supported) to use
54 from any other node to connect to this node.
55
56 When not provided, a default value is computed by running the
57 following algorithm.
58
59 1. We get this machine's "public IP" by opening a connection
60 to the given monitor hostname or IP address. Then we get
61 TCP/IP client address that has been used to make that con‐
62 nection.
63
64 2. We then do a reverse DNS lookup on the IP address found in
65 the previous step to fetch a hostname for our local ma‐
66 chine.
67
68 3. If the reverse DNS lookup is successful , then pg_autoctl
69 does a forward DNS lookup of that hostname.
70
71 When the forward DNS lookup response in step 3. is an IP address
72 found in one of our local network interfaces, then pg_autoctl
73 uses the hostname found in step 2. as the default --hostname.
74 Otherwise it uses the IP address found in step 1.
75
76 You may use the --hostname command line option to bypass the
77 whole DNS lookup based process and force the local node name to
78 a fixed value.
79
80 --pgport
81 Postgres port to use, defaults to 5432.
82
84 Microsoft
85
87 Copyright (c) Microsoft Corporation. All rights reserved.
88
89
90
91
922.0 Sep 13, 2023 PG_AUTOCTL RUN(1)