What is Watchdog

"watchdog" is a sub process of pgpool-II aiming for adding high availability feature to it. Features added by watchdog include:

Server composition

Figure below describes how pgpool-II and watchdog process is configured.

watchdog server composition

Starting/stopping watchdog

watchdog process is started/stopped automatically by pgpool-II, therefore there is no dedicated command to start/stop it. However, pgpool-II must to be started with root privilege because watchdog process needs to control the virtual IP interface.

Configuring watchdog (pgpool.conf)

watchdog configuration parameters is described in pgpool.conf. There is sample configuration in WATCHDOG section in pgpool.conf.sample file. All following options are required to be specified in watchdog process.

Basic configuration

use_watchdog

If on, activates watchdog. Default is off.

trusted_servers

The list of trusted servers to check the up stream connections. Each server is required to respond to ping. Specify a comma separated list of servers such as "hostA,hostB,hostC".

delegate_IP

Specifies the virtual IP address (VIP) of pgpool-II that is connected from client servers (application servers etc.). When a pgpool is switched from standby to active, the pgpool takes over this VIP.

wd_hostname

Specifies the hostname or IP address for mutual monitoring of watchdog processes.

wd_port

Specifies the port number for mutual monitoring of watchdog processes.

wd_interval

This parameter specifies the interval between life checks of pgpool-II in second. (A number greater than or equal to 1)

ping_path

This parameter specifies a path of ping command for monitoring connection to the upper servers. Set the only path such as "/bin".

ifconfig_path

This parameter specifies a path of a command to switch the IP address. Set the only path such as "/sbin".

if_up_cmd

This parameter specifies a command to bring up the virtual IP. Set the command and parameters such as "ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0". $_IP_$ is replaced by the IP address specified in delegate_IP.

if_down_cmd

This parameter specifies a command to bring down the virtual IP. Set the command and parameters such as "ifconfig eth0:0 down".

arping_path

This parameter specifies a path of a command to send an ARP request after the virtual IP is switched. Set the only path such as "/usr/sbin".

arping_cmd

This parameter specifies a command to send an ARP request after the virtual IP is switched. Set the command and parameters such as "arping -U $_IP_$ -w 1". $_IP_$ is replaced by the IP address specified in delegate_IP.

wd_life_point

The times to retry a failed life check of pgpool-II. (A number greater than or equal to 1)

wd_lifecheck_query

Actual query to check pgpool-II. Default is "SELECT 1"

Servers to be monitored

other_pgpool_hostname0

Specifies the hostname pgpool-II server to be monitored. The number at the end of the parameter name is referred as "server id", and it starts from 0.

other_pgpool_port0

Specifies the port number for pgpool on pgpool-II server to be monitored. The number at the end of the parameter name is referred as "server id", and it starts from 0.

other_wd_port0

Specifies the port number for watchdog on pgpool-II server to be monitored. The number at the end of the parameter name is referred as "server id", and it starts from 0.