.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "PG_AUTOCTL RUN" "1" "Nov 06, 2022" "2.0" "pg_auto_failover" .SH NAME pg_autoctl run \- pg_autoctl run .sp pg_autoctl run \- Run the pg_autoctl service (monitor or keeper) .SH SYNOPSIS .sp This commands starts the processes needed to run a monitor node or a keeper node, depending on the configuration file that belongs to the \fB\-\-pgdata\fP option or \fBPGDATA\fP environment variable. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C usage: pg_autoctl run [ \-\-pgdata \-\-name \-\-hostname \-\-pgport ] \-\-pgdata path to data directory \-\-name pg_auto_failover node name \-\-hostname hostname used to connect from other nodes \-\-pgport PostgreSQL\(aqs port number .ft P .fi .UNINDENT .UNINDENT .SH DESCRIPTION .sp When registering Postgres nodes to the pg_auto_failover monitor using the \fI\%pg_autoctl create postgres\fP command, the nodes are registered with metadata: the node name, hostname and Postgres port. .sp The node name is used mostly in the logs and \fI\%pg_autoctl show state\fP commands and helps human administrators of the formation. .sp The node hostname and pgport are used by other nodes, including the pg_auto_failover monitor, to open a Postgres connection. .sp Both the node name and the node hostname and port can be changed after the node registration by using either this command (\fBpg_autoctl run\fP) or the \fI\%pg_autoctl config set\fP command. .SH OPTIONS .INDENT 0.0 .TP .B \-\-pgdata Location of the Postgres node being managed locally. Defaults to the environment variable \fBPGDATA\fP\&. Use \fB\-\-monitor\fP to connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed with \fBpg_autoctl\fP\&. .TP .B \-\-name Node name used on the monitor to refer to this node. The hostname is a technical information, and given Postgres requirements on the HBA setup and DNS resolution (both forward and reverse lookups), IP addresses are often used for the hostname. .sp The \fB\-\-name\fP option allows using a user\-friendly name for your Postgres nodes. .TP .B \-\-hostname Hostname or IP address (both v4 and v6 are supported) to use from any other node to connect to this node. .sp When not provided, a default value is computed by running the following algorithm. .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP 1. 3 We get this machine\(aqs "public IP" by opening a connection to the given monitor hostname or IP address. Then we get TCP/IP client address that has been used to make that connection. .IP 2. 3 We then do a reverse DNS lookup on the IP address found in the previous step to fetch a hostname for our local machine. .IP 3. 3 If the reverse DNS lookup is successful , then \fBpg_autoctl\fP does a forward DNS lookup of that hostname. .UNINDENT .UNINDENT .UNINDENT .sp When the forward DNS lookup response in step 3. is an IP address found in one of our local network interfaces, then \fBpg_autoctl\fP uses the hostname found in step 2. as the default \fB\-\-hostname\fP\&. Otherwise it uses the IP address found in step 1. .sp You may use the \fB\-\-hostname\fP command line option to bypass the whole DNS lookup based process and force the local node name to a fixed value. .TP .B \-\-pgport Postgres port to use, defaults to 5432. .UNINDENT .SH AUTHOR Microsoft .SH COPYRIGHT Copyright (c) Microsoft Corporation. All rights reserved. .\" Generated by docutils manpage writer. .