Puppet Class: pgpool::config::watchdog

Defined in:
manifests/config/watchdog.pp

Overview

Class: pgpool::config::watchdog

This configures the watchdog functions of pgpool in the pgpool.conf. It should be used in combination with pgpool::config::heartbeat to configure the other heartbeat backends.

Parameters

use_watchdog

String. Enables the watchdog in pgpool. Defaults to off.

trusted_servers

String. List of trusted servers for the watchdog. Defaults to .

ping_path

String. The path too where ping lives. Defaults to /bin.

wd_hostname

String. the IP or hostname of the server. Defaults to .

wd_port

Integer. The port for the watchdog. Defaults to 9000.

wd_authkey

String. The auth key to use for the watchdog. Defaults to .

delegate_IP

String. The virtual IP for pgpool. Defaults to .

ifconfig_path

String. The path to ifconfig. Defaults to /sbin.

if_up_cmd

String. The ifup cmd to use for the vip. Defaults to ifconfig eth0:0 inet $IP$ netmask 255.255.255.0.

if_down_cmd

String. The ifdown cmd to use for the vip. Defaults to ifconfig eth0:0 down.

arping_path

String. The path to arping. Defaults to /usr/bin.

arping_cmd

String. the arping command to arp the vip. Defaults to arping -U $IP$ -w 1.

clear_memqcache_onescalation

String. Should the watchdog clear the query cache when pgpool escalates to active. Defaults to on.

wd_escalation_command

String. The command that the watchdog should run when it escalates to active. Defaults to .

wd_lifecheck_method

String. The way the watchdog communicates with others. Should be one of query or heartbeat. Defaults to heartbeat.

wd_interval

Integer. The interval to check the other pgool instances. Defaults to 10.

wd_heartbeat_port

Integer. The port number to receive heartbeat signals. Defaults to 9694.

wd_heartbeat_keepalive

Integer. The interval time of keepalives. Defaults to 2.

wd_heartbeat_deadtime

Integer. How long to wait before considering someone dead. Defaults to 30.

wd_life_point

Integer. The times to retry a d failed live check. Defaults to 3.

wd_lifecheck_query

String. The query to use for checks. Defaults to SELECT 1.

wd_lifecheck_dbname

String. The db to use for the life check query. Defaults to template1.

wd_lifecheck_user

String. The user to use for the life check query. Defaults to nobody.

wd_lifecheck_password

String. The password to use for the lfie check query. Defaults to .

Variables

N/A

Examples

N/A

Authors

Alex Schultz <aschultz@next-development.com>

Parameters:

  • use_watchdog (Any) (defaults to: 'off')
  • trusted_servers (Any) (defaults to: '')
  • ping_path (Any) (defaults to: '/bin')
  • wd_hostname (Any) (defaults to: '')
  • wd_port (Any) (defaults to: 9000)
  • wd_authkey (Any) (defaults to: '')
  • delegate_IP (Any) (defaults to: '')
  • ifconfig_path (Any) (defaults to: '/sbin')
  • if_up_cmd (Any) (defaults to: 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0')
  • if_down_cmd (Any) (defaults to: 'ifconfig eth0:0 down')
  • arping_path (Any) (defaults to: '/usr/sbin')
  • arping_cmd (Any) (defaults to: 'arping -U $_IP_$ -w 1')
  • clear_memqcache_on_escalation (Any) (defaults to: 'on')
  • wd_escalation_command (Any) (defaults to: '')
  • wd_lifecheck_method (Any) (defaults to: 'heartbeat')
  • wd_interval (Any) (defaults to: 10)
  • wd_heartbeat_port (Any) (defaults to: 9694)
  • wd_heartbeat_keepalive (Any) (defaults to: 2)
  • wd_heartbeat_deadtime (Any) (defaults to: 30)
  • wd_life_point (Any) (defaults to: 3)
  • wd_lifecheck_query (Any) (defaults to: 'SELECT 1')
  • wd_lifecheck_dbname (Any) (defaults to: 'template1')
  • wd_lifecheck_user (Any) (defaults to: 'nobody')
  • wd_lifecheck_password (Any) (defaults to: '')


120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'manifests/config/watchdog.pp', line 120

class pgpool::config::watchdog (
  $use_watchdog                  = 'off',
  $trusted_servers               = '',
  $ping_path                     = '/bin',
  $wd_hostname                   = '',
  $wd_port                       = 9000,
  $wd_authkey                    = '',
  $delegate_IP                   = '',
  $ifconfig_path                 = '/sbin',
  $if_up_cmd                     = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0',
  $if_down_cmd                   = 'ifconfig eth0:0 down',
  $arping_path                   = '/usr/sbin',
  $arping_cmd                    = 'arping -U $_IP_$ -w 1',
  $clear_memqcache_on_escalation = 'on',
  $wd_escalation_command         = '',
  $wd_lifecheck_method           = 'heartbeat',
  $wd_interval                   = 10,
  $wd_heartbeat_port             = 9694,
  $wd_heartbeat_keepalive        = 2,
  $wd_heartbeat_deadtime         = 30,
  $wd_life_point                 = 3,
  $wd_lifecheck_query            = 'SELECT 1',
  $wd_lifecheck_dbname           = 'template1',
  $wd_lifecheck_user             = 'nobody',
  $wd_lifecheck_password         = '',
) {

  $watchdog_config = {
    'use_watchdog'                  => { value => $use_watchdog },
    'trusted_servers'               => { value => $trusted_servers },
    'ping_path'                     => { value => $ping_path },
    'wd_hostname'                   => { value => $wd_hostname },
    'wd_port'                       => { value => $wd_port },
    'wd_authkey'                    => { value => $wd_authkey },
    'delegate_IP'                   => { value => $delegate_IP },
    'ifconfig_path'                 => { value => $ifconfig_path },
    'if_up_cmd'                     => { value => $if_up_cmd },
    'if_down_cmd'                   => { value => $if_down_cmd },
    'arping_path'                   => { value => $arping_path },
    'arping_cmd'                    => { value => $arping_cmd },
    'clear_memqcache_on_escalation' => { value => $clear_memqcache_on_escalation },
    'wd_escalation_command'         => { value => $wd_escalation_command },
    'wd_lifecheck_method'           => { value => $wd_lifecheck_method },
    'wd_interval'                   => { value => $wd_interval },
    'wd_heartbeat_port'             => { value => $wd_heartbeat_port },
    'wd_heartbeat_keepalive'        => { value => $wd_heartbeat_keepalive },
    'wd_heartbeat_deadtime'         => { value => $wd_heartbeat_deadtime },
    'wd_life_point'                 => { value => $wd_life_point },
    'wd_lifecheck_query'            => { value => $wd_lifecheck_query },
    'wd_lifecheck_dbname'           => { value => $wd_lifecheck_dbname },
    'wd_lifecheck_user'             => { value => $wd_lifecheck_user },
    'wd_lifecheck_password'         => { value => $wd_lifecheck_password },
  }

  $watchdog_defaults = {
    ensure => present
  }

  create_resources(pgpool::config::val, $watchdog_config, $watchdog_defaults)
}