'\" t .\" Title: pcp_promote_node .\" Author: The Pgpool Global Development Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 2023 .\" Manual: pgpool-II 4.3.7 Documentation .\" Source: pgpool-II 4.3.7 .\" Language: English .\" .TH "PCP_PROMOTE_NODE" "1" "2023" "pgpool-II 4.3.7" "pgpool-II 4.3.7 Documentation" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pcp_promote_node \- promotes the given node as new main to Pgpool\-II .SH "SYNOPSIS" .HP \w'\fBpcp_promote_node\fR\ 'u \fBpcp_promote_node\fR [\fIoptions\fR...] [\fInode_id\fR] [\fIgracefully\fR] [\fIswitchover\fR] .SH "DESCRIPTION" .PP \fBpcp_promote_node\fR promotes the given node as new primary to Pgpool\-II\&. In streaming replication mode only\&. Please note that this command does not actually promote standby PostgreSQL backend unless switchover option is specified: it just changes the internal status of Pgpool\-II and trigger failover and users have to promote standby PostgreSQL outside Pgpool\-II\&. .PP If switchover is specified, Pgpool\-II detaches current primary (changes the internal status to down) and execute the failover_command, with the new main node argument to be set to the specified node id\&. Because most failover scripts promote the new main node, the specified node will be the new primary node\&. The follow_primary_command is necessary to be set properly to turn the former primary into standby\&. .PP \fBpcp_promote_node\fR executes followings if switchover is not specified\&. Please be warned that if follow_primary_command is set, the command will be executed\&. It is a standard advice that you disable follow_primary_command before executing this command\&. .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Change the status of standby PostgreSQL from standby to primary\&. It just changes the internal status of Pgpool\-II and it does not actually promote PostgreSQL standby server\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} Change the status of PostgreSQL node which is not specified by this command\*(Aqs argument to down\&. It just changes the internal status of Pgpool\-II and it does not actually make PostgreSQL standby server down\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 3.\h'+01'\c .\} .el \{\ .sp -1 .IP " 3." 4.2 .\} If follow_primary_command is set, execute follow_primary_command against PostgreSQL\&. .RE .PP \fBpcp_promote_node\fR executes followings if switchover is specified\&. If follow_primary_command is set, the command will be executed\&. You need to set follow_primary_command before executing this command because failover script will create the new primary and other nodes need to be turned into standbys .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Change the status of primary PostgreSQL from up to down\&. This triggers failover_command execution, with the new main node argument to be set to the specified node id\&. Because most failover scripts promote the new main node, the specified node will become the new primary node\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} Change the status of standby PostgreSQL node which is not specified by this command\*(Aqs argument to down\&. It just changes the internal status of Pgpool\-II and it does not actually make PostgreSQL standby server down\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 3.\h'+01'\c .\} .el \{\ .sp -1 .IP " 3." 4.2 .\} If follow_primary_command is set, execute follow_primary_command against PostgreSQL\&. .RE .sp .SH "OPTIONS" .PP .PP \fB\-n \fR\fB\fInode_id\fR\fR .br \fB\-\-node\-id=\fR\fB\fInode_id\fR\fR .RS 4 The index of backend node to promote as new main\&. The specified node must be in "up" or "waiting" status\&. .RE .PP \fB\-g \fR .br \fB\-\-gracefully\fR .RS 4 Wait until all clients are disconnected (unless client_idle_limit_in_recovery is \-1 or recovery_timeout is expired)\&. .RE .PP \fB\-s \fR .br \fB\-\-switchover\fR .RS 4 Let the specified node to be actually promoted by triggering the failover_command\&. Also change the current primary node status to down\&. .RE .PP \fBOther options \fR .RS 4 See \fBpcp_common_options\fR(1)\&. .RE