'\" t .\" Title: watchdog_setup .\" 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 "WATCHDOG_SETUP" "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" watchdog_setup \- Create a temporary installation of Pgpool\-II clusters with watchdog .SH "SYNOPSIS" .HP \w'\fBwatchdog_setup\fR\ 'u \fBwatchdog_setup\fR [\fIoption\fR...] .SH "DESCRIPTION" .PP watchdog_setup creates a temporary installation of Pgpool\-II clusters with watchdog enabled, which includes a Pgpool\-II installation and specified number of PostgreSQL installations under current directory\&. Current directory must be empty before running watchdog_setup\&. .PP watchdog_setup is for testing purpose only and should not be used to create production installations\&. Also please note that heartbeat is not used\&. .PP watchdog_setup uses \fBpgpool_setup\fR(1) as a workhorse\&. .PP Currently watchdog_setup supports streaming replication mode, snapshot isolation mode, native replication mode, logical replication mode and raw mode\&. .SH "OPTIONS" .PP watchdog_setup accepts the following command\-line arguments: .PP \fB\-wn \fR\fB\fInum_pgpool\fR\fR .RS 4 Specifies the number of Pgpool\-II installations\&. If this is omitted, 3 is used\&. .RE .PP \fB\-wp \fR\fB\fIwatchdog_base_port\fR\fR .RS 4 Specify the starting base port number used by Pgpool\-II and PostgreSQL\&. For the first Pgpool\-II, Pgpool\-II port is watchdog_base_port\&. pcp port is watchdog_base_port + 1, watchdog port is watchdog_base_port + 2\&. wd_heartbeat_port is watchdog_base_port + 3 (though heartbeat is not used)\&. The first PostgreSQL node\*(Aqs port is watchdog_base_port + 4, second PostgreSQL node\*(Aqs port is watchdog_base_port + 5 and so on\&. .sp If this is omitted, 50000 is used\&. .RE .PP \fB\-m \fR\fB\fImode\fR\fR .RS 4 Specifies the running mode\&. \fImode\fR can be r (native replication mode), i (snapshot isolation mode), s (streaming replication mode), l (logical replication mode) or n (raw mode)\&. If this is omitted, s is used\&. .RE .PP \fB\-n \fR\fB\fInum_clusters\fR\fR .RS 4 Specifies the number of PostgreSQL installations\&. If this is omitted, 2 is used\&. .RE .PP \fB\-\-no\-stop\fR .RS 4 Do not stop pgpool and PostgreSQL after the work\&. .RE .PP \fB\-d\fR .RS 4 Start pgpool with debug mode\&. .RE .SH "ENVIRONMENT VARIABLES" .PP watchdog_setup recognizes following environment variables: .PP \fBPGPOOL_SETUP\fR .RS 4 Specifies the path to pgpool_setup command\&. The default is "pgpool_setup", thus it is assumed that pgpool_setup is in the command search path\&. .RE .PP \fBPGPOOL_INSTALL_DIR\fR .RS 4 Specifies the Pgpool\-II installation directory\&. Pgpool\-II binaries is expected to be placed under PGPOOL_INSTALL_DIR/bin and pgpool\&.conf and pool_hba\&.conf etc\&. are expected to be placed under PGPOOL_INSTALL_DIR/etc\&. The default is /usr/local\&. .RE .PP \fBPGPOOLDIR\fR .RS 4 Specifies the path to Pgpool\-II configuration files\&. The default is PGPOOL_INSTALL_DIR/etc\&. .RE .PP \fBPGBIN\fR .RS 4 Specifies the path to PostgreSQL commands such as initdb, pg_ctl and psql\&. The default is /usr/local/pgsql/bin\&. .RE .PP \fBPGLIB\fR .RS 4 Specifies the path to PostgreSQL shared libraries\&. The default is /usr/local/pgsql/lib\&. .RE .PP \fBPGSOCKET_DIR\fR .RS 4 Specifies the path to Unix socket directory\&. The default is /tmp\&. .RE .PP \fBINITDBARG\fR .RS 4 Specifies the arguments for initdb command\&. The default is "\-\-no\-locale \-E UTF_8"\&. .RE .SH "EXAMPLE" .PP .if n \{\ .RS 4 .\} .nf $ watchdog_setup Starting set up ============= setting up pgpool 0 ============= Starting set up in streaming replication mode creating startall and shutdownall creating failover script creating database cluster /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool0/data0\&.\&.\&.done\&. update postgresql\&.conf creating pgpool_remote_start creating basebackup\&.sh creating recovery\&.conf creating database cluster /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool0/data1\&.\&.\&.done\&. update postgresql\&.conf creating pgpool_remote_start creating basebackup\&.sh creating recovery\&.conf temporarily start data0 cluster to create extensions temporarily start pgpool\-II to create standby nodes INFO: unrecognized configuration parameter "debug_level" node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay \-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 | /tmp | 51000 | up | 0\&.500000 | primary | 0 | true | 0 1 | /tmp | 51001 | down | 0\&.500000 | standby | 0 | false | 0 (2 rows) recovery node 1\&.\&.\&.pcp_recovery_node \-\- Command Successful done\&. creating follow primary script Pager usage is off\&. node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay \-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 | /tmp | 51000 | up | 0\&.500000 | primary | 0 | false | 0 1 | /tmp | 51001 | up | 0\&.500000 | standby | 0 | true | 0 (2 rows) shutdown all pgpool\-II setting for streaming replication mode is done\&. To start the whole system, use /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool0/startall\&. To shutdown the whole system, use /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool0/shutdownall\&. pcp command user name is "t\-ishii", password is "t\-ishii"\&. Each PostgreSQL, pgpool\-II and pcp port is as follows: #1 port is 51000 #2 port is 51001 pgpool port is 50000 pcp port is 50001 The info above is in README\&.port\&. ============= setting up pgpool 1 ============= Starting set up in streaming replication mode creating startall and shutdownall creating failover script creating database cluster /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool1/data0\&.\&.\&.done\&. update postgresql\&.conf creating pgpool_remote_start creating basebackup\&.sh creating recovery\&.conf creating database cluster /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool1/data1\&.\&.\&.done\&. update postgresql\&.conf creating pgpool_remote_start creating basebackup\&.sh creating recovery\&.conf temporarily start data0 cluster to create extensions temporarily start pgpool\-II to create standby nodes INFO: unrecognized configuration parameter "debug_level" node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay \-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 | /tmp | 51000 | up | 0\&.500000 | primary | 0 | true | 0 1 | /tmp | 51001 | down | 0\&.500000 | standby | 0 | false | 0 (2 rows) recovery node 1\&.\&.\&.pcp_recovery_node \-\- Command Successful done\&. creating follow primary script Pager usage is off\&. node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay \-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 | /tmp | 51000 | up | 0\&.500000 | primary | 0 | true | 0 1 | /tmp | 51001 | up | 0\&.500000 | standby | 0 | false | 0 (2 rows) shutdown all pgpool\-II setting for streaming replication mode is done\&. To start the whole system, use /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool1/startall\&. To shutdown the whole system, use /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool1/shutdownall\&. pcp command user name is "t\-ishii", password is "t\-ishii"\&. Each PostgreSQL, pgpool\-II and pcp port is as follows: #1 port is 51000 #2 port is 51001 pgpool port is 50004 pcp port is 50005 The info above is in README\&.port\&. ============= setting up pgpool 2 ============= Starting set up in streaming replication mode creating startall and shutdownall creating failover script creating database cluster /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool2/data0\&.\&.\&.done\&. update postgresql\&.conf creating pgpool_remote_start creating basebackup\&.sh creating recovery\&.conf creating database cluster /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool2/data1\&.\&.\&.done\&. update postgresql\&.conf creating pgpool_remote_start creating basebackup\&.sh creating recovery\&.conf temporarily start data0 cluster to create extensions temporarily start pgpool\-II to create standby nodes INFO: unrecognized configuration parameter "debug_level" node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay \-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 | /tmp | 51000 | up | 0\&.500000 | primary | 0 | true | 0 1 | /tmp | 51001 | down | 0\&.500000 | standby | 0 | false | 0 (2 rows) recovery node 1\&.\&.\&.pcp_recovery_node \-\- Command Successful done\&. creating follow primary script Pager usage is off\&. node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay \-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0 | /tmp | 51000 | up | 0\&.500000 | primary | 0 | true | 0 1 | /tmp | 51001 | up | 0\&.500000 | standby | 0 | false | 0 (2 rows) shutdown all pgpool\-II setting for streaming replication mode is done\&. To start the whole system, use /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool2/startall\&. To shutdown the whole system, use /home/t\-ishii/work/pgpool\-II/current/pgpool2/src/test/a/pgpool2/shutdownall\&. pcp command user name is "t\-ishii", password is "t\-ishii"\&. Each PostgreSQL, pgpool\-II and pcp port is as follows: #1 port is 51000 #2 port is 51001 pgpool port is 50008 pcp port is 50009 The info above is in README\&.port\&. $ ls pgpool0 pgpool1 pgpool2 shutdownall startall $ sh startall waiting for server to start\&.\&.\&.\&.16123 2016\-08\-18 16:26:53 JST LOG: redirecting log output to logging collector process 16123 2016\-08\-18 16:26:53 JST HINT: Future log output will appear in directory "pg_log"\&. done server started waiting for server to start\&.\&.\&.\&.16136 2016\-08\-18 16:26:54 JST LOG: redirecting log output to logging collector process 16136 2016\-08\-18 16:26:54 JST HINT: Future log output will appear in directory "pg_log"\&. done server started t\-ishii@localhost: psql \-p 50000 test Pager usage is off\&. psql (9\&.5\&.4) Type "help" for help\&. test=# \eq $ pcp_watchdog_info \-p 50001 \-v Password: Watchdog Cluster Information Total Nodes : 3 Remote Nodes : 2 Member Remote Nodes : 2 Nodes required for quorum: 2 Quorum state : QUORUM EXIST Alive Remote Nodes : 2 VIP up on local node : NO Leader Node Name : Linux_tishii\-CF\-SX3HE4BP_50004 Leader Host Name : localhost Watchdog Node Information Node Name : Linux_tishii\-CF\-SX3HE4BP_50000 Host Name : localhost Delegate IP : Not_Set Pgpool port : 50000 Watchdog port : 50002 Node priority : 1 Status : 7 Status Name : STANDBY Membership Status : MEMBER Node Name : Linux_tishii\-CF\-SX3HE4BP_50004 Host Name : localhost Delegate IP : Not_Set Pgpool port : 50004 Watchdog port : 50006 Node priority : 1 Status : 4 Status Name : LEADER Membership Status : MEMBER Node Name : Linux_tishii\-CF\-SX3HE4BP_50008 Host Name : localhost Delegate IP : Not_Set Pgpool port : 50008 Watchdog port : 50010 Node priority : 1 Status : 7 Status Name : STANDBY Membership Status : MEMBER .fi .if n \{\ .RE .\} .sp