pgpool2.git / summary / log / commit / refs
commit 9bbbd49e4e7a43edc697593a7d038eb4f8d60118
Author: Yugo Nagata <nagata@sraoss.co.jp>
Date: Wed May 15 03:20:33 2013 +0000
Add description about watchdog's new feature.
doc/pgpool-en.html | 400 ++++++++++++++++++++++++++++++++++--------------
doc/pgpool-ja.html | 434 +++++++++++++++++++++++++++++++++++++++--------------
2 files changed, 609 insertions(+), 225 deletions(-)
diff --git a/doc/pgpool-en.html b/doc/pgpool-en.html
index cd874da15..fd4edabf3 100644
--- a/doc/pgpool-en.html
+++ b/doc/pgpool-en.html
@@ -610,7 +610,7 @@ max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connect
<dd>
<p>
Specify the file name of pool_passwd for md5 authentication.
- Default value is "pool_passwd". "" disables to read pool_passwd.
+ Default value is "pool_passwd". "" disables to read pool_passwd.
See <a href="#md5">Authentication / Access Controls</a> for more details.
</p>
<p>
@@ -1691,7 +1691,7 @@ must be met:
</p>
<ul>
<li>PostgreSQL version 7.4 or later</li>
- <li>either in replication mode or master slave mode</li>
+ <li>either in replication mode or master slave mode</li>
<li>the query must not be in an explicitly declared
transaction (i.e. not in a BEGIN ~ END block) when operated in replication mode</li>
<li>it's not SELECT INTO
@@ -1700,18 +1700,18 @@ must be met:
ignore_leading_white_space = true will ignore leading white space.
(Except for SELECTs using writing functions specified in <a href="#BLACK_FUNCTION_LIST">black_list</a> or
<a href="#WHITE_FUNCTION_LIST">white_list</a>)
- <li><span class="version">V3.0 -</span>in master slave mode, in addition to above, following conditions must be met:
- <ul>
- <li>does not use temporary tables</li>
- <li>does not use unlogged tables</li>
- <li>does not use system catalogs</li>
- <li>However, if following conditions are met, load balance is possible even if in an explicit transaction</li>
- <ul>
- <li>transaction isolation level is not SERIALIZABLE</li>
- <li>the transaction has not issued a write query yet(until a write query issued, load balance is possible)</li>
- </ul>
- </ul>
- </li>
+ <li><span class="version">V3.0 -</span>in master slave mode, in addition to above, following conditions must be met:
+ <ul>
+ <li>does not use temporary tables</li>
+ <li>does not use unlogged tables</li>
+ <li>does not use system catalogs</li>
+ <li>However, if following conditions are met, load balance is possible even if in an explicit transaction</li>
+ <ul>
+ <li>transaction isolation level is not SERIALIZABLE</li>
+ <li>the transaction has not issued a write query yet(until a write query issued, load balance is possible)</li>
+ </ul>
+ </ul>
+ </li>
</ul>
@@ -2684,13 +2684,13 @@ These are the parameters used with both of shmem and memcached.
<p>
Specify a comma separated list of table names whose SELECT results are to be cached even if
they are VIEWs or unlogged tables. You can use regular expression (to which added automatically ^ and $).
- </p>
+ </p>
<p>
TABLEs and VIEWs in both of white_memqcache_table_list and
<a href="#BLACK_MEMQCACHE_TABLE_LIST">black_memqcache_table_list</a> are cached.
</p>
- <p>
- You need to add both non schema qualified name and schema qualified name if you plan to use both of them in your query. For exmaple, if you want to use both "table1" and "public.table1" in your query, you need to add "table1,public.table1", not just "table1".
+ <p>
+ You need to add both non schema qualified name and schema qualified name if you plan to use both of them in your query. For exmaple, if you want to use both "table1" and "public.table1" in your query, you need to add "table1,public.table1", not just "table1".
</p>
</dd>
@@ -2701,8 +2701,8 @@ These are the parameters used with both of shmem and memcached.
Specify a comma separated list of table names whose SELECT results are <strong>NOT</strong> to be cached.
You can use regular expression (to which added automatically ^ and $).
</p>
- <p>
- You need to add both non schema qualified name and schema qualified name if you plan to use both of them in your query. For exmaple, if you want to use both "table1" and "public.table1" in your query, you need to add "table1,public.table1", not just "table1".
+ <p>
+ You need to add both non schema qualified name and schema qualified name if you plan to use both of them in your query. For exmaple, if you want to use both "table1" and "public.table1" in your query, you need to add "table1,public.table1", not just "table1".
</p>
</dd>
@@ -3778,66 +3778,74 @@ Pgpool-HA can be available from the pgpool development site as an open source so
<!-- ================================================================================ -->
<h1 id="watchdog">Watchdog <span class="version">V3.2 -</span></h1>
+<h2 id="what_is_watchdog">What is watchdog</h2>
<p>
"Watchdog" is a sub process of pgpool-II to add high availability.
-Features added by watchdog include:
+This resolve the single point of failure by coordinating multiple pgpool-IIs.
+watchdog adds the following features to pgpool-II.
</p>
-<dl>
-<dt>Life checking of pgpool service</dt>
- <dd>
+<h3>Life checking of pgpool-II</h3>
<p>
- Watchdog monitors responses of pgpool <i>service</i> rather than process.
- It sends queries to PostgreSQL via pgpool which is being monitored
- by watchdog and watchdog checks the response.
+ Watchdog monitors pgpool-IIs by either of two methods, "heartbeat" mode or "query" mode.
</p>
+ <ul>
+ <li>
+ In heartbeat mode, watchdog monitors other pgpool-II process by using heartbeat signal.
+ Watchdog receives heartbeat signals sent by other pgpool-II periodically.
+ If there are no signal for a certain period, watchdog regards it as failure of the pgpool-II.
+ </li>
+ <li>
+ In query mode, watchdog monitors pgpool-II's service rather than process.
+ watchdog sends queries to other pgpool-II and checks the response.
+ </li>
+ </ul>
<p>
Also watchdog monitors connections to upstream servers
- (application servers etc.) from the pgpool.
- The connection between the upstream servers and the pgpool is monitored as a service of pgpool.
+ (application servers etc.) from the pgpool-II, and checks whether the pgpool-II can serves to the servers.
+ If the monitoring fails, watchdog treats the pgpool-II as down.
</p>
- </dd>
-<dt>Mutual monitoring of watchdog processes</dt>
- <dd>
+<h3>Coordinating multiple pgpool-IIs</h3>
<p>
- Watchdog processes exchange information on the monitored servers
- to keep the information up to date,
- and to allow watchdog processes to mutually monitor each other.
+ Watchdog coordinates multiple pgpool-IIs by exchanging information with each other.
</p>
- </dd>
+ <ul>
+ <li>
+ When backend node status changes by failover etc., watchdog notifies the information to other pgpool-IIs and synchronizes them.
+ When online recovery occurs, watchdog restricts client connections to other pgpool-IIs for avoiding inconsistency between backends.
+ </li>
+ <li>
+ Commands on failback or failover (<a href="#FAILOVER_COMMAND">failover_command</a>,
+ <a href="#FAILBACK_COMMAND">failback_command</a>, <a href="#FOLLOW_MASTER_COMMAND">follow_master_command</a>)
+ are executed by only one pgpool-II by interlocking.
+ </li>
+ </ul>
-<dt>Changing active/standby state in case of certain faults detected</dt>
- <dd>
+<h3>Changing active/standby state in case of certain faults detected</h3>
<p>
- When a fault is detected in the pgpool service, watchdog notifies the other watchdogs of it.
- Watchdogs then decide the new active pgpool if previous active pgpool is broken
- by voting and change active/standby state.
+ When a fault of pgpool-II is detected, watchdog notifies the other watchdogs of it.
+ If this is the active pgpool-II, watchdogs decides the new active pgpool-II by voting and change active/standby state.
</p>
- </dd>
-<dt>Automatic virtual IP address assigning synchronous to server switching</dt>
- <dd>
+<h3>Automatic virtual IP address assigning synchronous to server switching</h3>
<p>
- When a standby pgpool server promotes to active, the new active server brings up virtual IP interface.
+ When a standby pgpool-II server promotes to active, the new active server brings up virtual IP interface.
Meanwhile, the previous active server brings down the virtual IP interface.
- This enables the active pgpool to work using the same IP address even when servers are switched.
+ This enables the active pgpool-II to work using the same IP address even when servers are switched.
</p>
- </dd>
-<dt>Automatic registration of a server as standby in recovery</dt>
- <dd>
+<h3>Automatic registration of a server as standby in recovery</h3>
<p>
When broken server recovers or new server is attached,
the watchdog process notifies the other watchdog process along with information of the new server,
and the watchdog process receives information on the active server and other servers.
- Then, the attached server is registered as a standby.
+ Then, the attached server is registered as a standby.
</p>
- </dd>
</dl>
-<h2 id="deploy_watchdog">Server composition</h2>
+<h2 id="watchdog_server_composition">Server composition</h2>
<p>
Figure below describes how pgpool-II and watchdog process is configured.
@@ -3846,13 +3854,17 @@ Figure below describes how pgpool-II and watchdog process is configured.
<h2 id="start_watchdog">Starting/stopping watchdog</h2>
<p>
-Watchdog process is started/stopped automatically by pgpool-II,
+Watchdog process starts/stops automatically as sub-processes of pgpool-II,
therefore there is no dedicated command to start/stop it.
-However, pgpool-II must to be started with <font color="red">root privilege</font>
-because watchdog process needs to control the virtual IP interface.
</p>
<p>
-The life checking starts after waiting for all of the pgpools to start.
+Watchdog requires <font color="red">root privilege</font> for controling the virtual IP interface.
+One method is to start pgpool-II by root privilege.
+However, for security reason, to set custom commands to <a href="#IF_UP_CMD">if_up_cmd</a>,
+<a href="#IF_DOWN_CMD">if_up_cmd</a>, <a href="#ARPING_CMD">if_up_cmd</a> using sudo or setuid is recommended method.
+</p>
+<p>
+The life checking starts after confirming that all of the pgpool-IIs are alive.
</p>
<h2>Configuring watchdog (pgpool.conf)</h2>
@@ -3860,9 +3872,7 @@ The life checking starts after waiting for all of the pgpools to start.
Watchdog configuration parameters are described in pgpool.conf.
There is sample configuration in WATCHDOG section in pgpool.conf.sample file.
</p>
-<p>
-<font color="red">CAUTION: You need to set <a href="#NUM_INIT_CHILDREN">num_init_children</a> large enough if you plan to use watchdog. This is because the watchdog process connects to pgpool-II as a client.</font>
-</p>
+
<p>
All following options are required to be specified in watchdog process.
</p>
@@ -3891,6 +3901,10 @@ All following options are required to be specified in watchdog process.
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".
+ If none of the server are pingable, watchdog regards it as failure of the pgpool-II.
+ </p>
+ <p>
+ If this option is empty, watchdog doesn't check up stream connections.
</p>
<p>
You need to restart pgpool-II if you change this value.
@@ -3910,140 +3924,218 @@ All following options are required to be specified in watchdog process.
</dd>
</dl>
-<h4>Life checking pgpool-II</h4>
+<h4>Virtual IP address</h4>
+
+<p>
+Configuration about virtual IP interface control
+</p>
<dl>
-<dt><a name="WD_INTERVAL"></a>wd_interval <span class="version">V3.2 -</span></dt>
+<dt><a name="DELEGATE_IP"></a>delegate_IP <span class="version">V3.2 -</span></dt>
<dd>
<p>
- This parameter specifies the interval between life checks of pgpool-II
- in second.
- (A number greater than or equal to 1)
+ Specifies the virtual IP address (VIP) of pgpool-II that is connected from
+ client servers (application servers etc.).
+ When a pgpool-II is switched from standby to active, the pgpool-II takes over this VIP.
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="WD_LIFE_POINT"></a>wd_life_point <span class="version">V3.2 -</span></dt>
+<dt><a name="IFCONFIG_PATH"></a>ifconfig_path <span class="version">V3.2 -</span></dt>
<dd>
<p>
- The times to retry a failed life check of pgpool-II.
- (A number greater than or equal to 1)
+ This parameter specifies a path of a command to switch the IP address.
+ Set the only path such as "/sbin".
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="WD_LIFECHECK_QUERY"></a>wd_lifecheck_query <span class="version">V3.2 -</span></dt>
+<dt><a name="IF_UP_CMD"></a>if_up_cmd <span class="version">V3.2 -</span></dt>
<dd>
<p>
- Actual query to check pgpool-II.
- Default is "SELECT 1"
+ 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 <a href="#DELEGATE_IP">delegate_IP</a>.
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="WD_LIFECHECK_DBNAME"></a>wd_lifecheck_dbname <span class="version">V3.3 -</span></dt>
+<dt><a name="IF_DOWN_CMD"></a>if_down_cmd <span class="version">V3.2 -</span></dt>
<dd>
<p>
- The database name connected for checking pgpool-II.
- Default is "template1"
+ This parameter specifies a command to bring down the virtual IP.
+ Set the command and parameters such as
+ "ifconfig eth0:0 down".
+ </p>
+ <p>
+ You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="WD_LIFECHECK_USER"></a>wd_lifecheck_user <span class="version">V3.3 -</span></dt>
+<dt><a name="ARPING_PATH"></a>arping_path <span class="version">V3.2 -</span></dt>
<dd>
<p>
- The user name to check pgpool-II.
- This user must exist in all the PostgreSQL backends.
- Default is "nobody"
+ 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".
+ </p>
+ <p>
+ You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="WD_LIFECHECK_PASSWORD"></a>wd_lifecheck_password <span class="version">V3.3 -</span></dt>
+<dt><a name="ARPING_CMD"></a>arping_cmd <span class="version">V3.2 -</span></dt>
<dd>
<p>
- The password of the user to check pgpool-II.
- Default is ""
+ 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 <a href="#DELEGATE_IP">delegate_IP</a>.
+ </p>
+ <p>
+ You need to restart pgpool-II if you change this value.
</p>
</dd>
</dl>
-<h4>Virtual IP address</h4>
+<h4>Behaivor on escalation</h4>
+
+<p> Configuration about behavior when pgpool-II escalates to active (virtual IP holder)
<dl>
-<dt><a name="DELEGATE_IP"></a>delegate_IP <span class="version">V3.2 -</span></dt>
+<dt><a name="CLEAR_MEMQCACHE_ON_ESCALATION"></a>clear_memqcache_on_escalation <span class="version">V3.3 -</span></dt>
<dd>
<p>
- 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.
+ If this is on, watchdog clears all the query cache in the shared memory when pgpool-II escaltes to active.
+ This prevents the new active pgpool-II from using old query caches inconsistence to the old active.
+ Default is on.
+ </p>
+ <p>
+ This works only if <a href="#MEMQCACHE_METHOD">memqcache_method</a> is 'shmem'.
+ </p>
+ </dd>
+
+<dt><a name="wd_escalation_command"></a>wd_escalation_command <span class="version">V3.3 -</span></dt>
+ <dd>
+ <p>
+ Watchdog executes this command on the new active when pgpool-II escaltes to active.
+ The timing is just before virtual IP brings up.
+ </p>
+ </dd>
+</dl>
+
+<h3>Life checking pgpool-II</h3>
+
+<p>Watchdog checks pgpool-II status periodically. This is called "life check".
+
+<h4>Common</h4>
+
+<dl>
+<dt><a name="WD_LIFECHECK_METHOD"></a>wd_lifecheck_method <span class="version">V3.3 -</span></dt>
+ <dd>
+ <p>
+ This parameter specifies the method of life check. This is either of 'heartbeat' (default) or 'query'.
+ </p>
+ <p>
+ In 'heartbeat' mode, watchdog sends heartbeat singals (UDP packets) periodically to other pgpool-II.
+ Watchdog also receives the signals from other pgpool-II.
+ If there are no signal for a certain period, watchdog regards is as failure of the pgpool-II.
+ </p>
+ <p>
+ In 'query' mode, watchdog sends monitoring queries to other pgpool-II and checks the response.
+ </p>
+ <p>
+ <font color="red">CAUTION: In query mode, you need to set <a href="#NUM_INIT_CHILDREN">num_init_children</a>
+ large enough if you plan to use watchdog. This is because the watchdog process connects to pgpool-II as a client.</font>
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="IFCONFIG_PATH"></a>ifconfig_path <span class="version">V3.2 -</span></dt>
+<dt><a name="WD_INTERVAL"></a>wd_interval <span class="version">V3.2 -</span></dt>
<dd>
<p>
- This parameter specifies a path of a command to switch the IP address.
- Set the only path such as "/sbin".
+ This parameter specifies the interval between life checks of pgpool-II
+ in second.
+ (A number greater than or equal to 1)
+ Default is 10.
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
+</dl>
-<dt><a name="IF_UP_CMD"></a>if_up_cmd <span class="version">V3.2 -</span></dt>
+<h4>Configuration of heartbeat mode</h4>
+
+<dl>
+<dt><a name="WD_HEARTBEAT_PORT"></a>wd_heartbeat_port <span class="version">V3.3 -</span></dt>
<dd>
<p>
- 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 <a href="#DELEGATE_IP">delegate_IP</a>.
+ This option specifies the port number to receive heartbeat signals.
+ This works only heartbeat mode.
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="IF_DOWN_CMD"></a>if_down_cmd <span class="version">V3.2 -</span></dt>
+<dt><a name="WD_HEARTBEAT_KEEPALIVE"></a>wd_heartbeat_keepalive <span class="version">V3.3 -</span></dt>
<dd>
<p>
- This parameter specifies a command to bring down the virtual IP.
- Set the command and parameters such as
- "ifconfig eth0:0 down".
+ This option specifies the interval time (sec.) of sending heartbeat signals.
+ Default is 2.
+ This works only heartbeat mode.
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="ARPING_PATH"></a>arping_path <span class="version">V3.2 -</span></dt>
+<dt><a name="WD_HEARTBEAT_DEADTIME"></a>wd_heartbeat_deadtime <span class="version">V3.3 -</span></dt>
<dd>
<p>
- 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".
+ If there are no heartbeat signal for the period specified by this option, watchdog regards it as failure of the remote pgpool-II.
+ This works only heartbeat mode.
</p>
<p>
You need to restart pgpool-II if you change this value.
</p>
</dd>
-<dt><a name="ARPING_CMD"></a>arping_cmd <span class="version">V3.2 -</span></dt>
+<dt><a name="WD_HEARTBEAT_DEVICE"></a>wd_heartbeat_port<font color="red">0</font> <span class="version">V3.3 -</span></dt>
<dd>
<p>
- 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 <a href="#DELEGATE_IP">delegate_IP</a>.
+ This option specifies the network device name for sending heartbeat signals.
+ You can use multiple devices.
+ The number at the end of the parameter name is referred as "device number",
+ and it starts from 0.
+ If you want to set mutiple destination (<a href="WD_HEARTBEAT_DESTINATION">wd_heartbeat_destiationN</a>) for one device,
+ specify the device name repeatedly using different numbers.
+ This works only heartbeat mode.
+ </p>
+ <p>
+ You need to restart pgpool-II if you change this value.
+ </p>
+ </dd>
+
+<dt><a name="WD_HEARTBEAT_DESTINATION"></a>wd_heartbeat_destination<font color="red">0</font> <span class="version">V3.3 -</span></dt>
+ <dd>
+ <p>
+ This option specifies the destination of heartbeat signals which is sent from the device specified by
+ <a href="WD_HEARTBEAT">wd_heartbeat_deviceX</a>. Use IP address or hostname.
+ The number at the end of the parameter name is referred as "device number",
+ and it starts from 0.
+ This works only heartbeat mode.
</p>
<p>
You need to restart pgpool-II if you change this value.
@@ -4051,12 +4143,71 @@ All following options are required to be specified in watchdog process.
</dd>
</dl>
-<h3>Server itself to be monitored</h3>
+<h4>Configuration of query mode</h4>
+
+<dl>
+<dt><a name="WD_LIFE_POINT"></a>wd_life_point <span class="version">V3.2 -</span></dt>
+ <dd>
+ <p>
+ The times to retry a failed life check of pgpool-II.
+ (A number greater than or equal to 1)
+ Default is 3.
+ This works only query mode.
+ </p>
+ <p>
+ You need to restart pgpool-II if you change this value.
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_QUERY"></a>wd_lifecheck_query <span class="version">V3.2 -</span></dt>
+ <dd>
+ <p>
+ Actual query to check pgpool-II.
+ Default is "SELECT 1".
+ This works only query mode.
+ </p>
+ <p>
+ You need to restart pgpool-II if you change this value.
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_DBNAME"></a>wd_lifecheck_dbname <span class="version">V3.3 -</span></dt>
+ <dd>
+ <p>
+ The database name connected for checking pgpool-II.
+ Default is "template1".
+ This works only query mode.
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_USER"></a>wd_lifecheck_user <span class="version">V3.3 -</span></dt>
+ <dd>
+ <p>
+ The user name to check pgpool-II.
+ This user must exist in all the PostgreSQL backends.
+ Default is "nobody".
+ This works only query mode.
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_PASSWORD"></a>wd_lifecheck_password <span class="version">V3.3 -</span></dt>
+ <dd>
+ <p>
+ The password of the user to check pgpool-II.
+ Default is "".
+ This works only query mode.
+ </p>
+ </dd>
+</dl>
+
+
+<h3>Communication between watchdogs</h3>
<dl>
<dt><a name="WD_HOSTNAME"></a>wd_hostname <span class="version">V3.2 -</span></dt>
<dd>
<p>
- Specifies the hostname or IP address for mutual monitoring of watchdog processes.
+ Specifies the hostname or IP address of pgpool-II server.
+ This is used for sending/receiving queries and packets, and also as identifier of watchdog.
</p>
<p>
You need to restart pgpool-II if you change this value.
@@ -4066,7 +4217,21 @@ All following options are required to be specified in watchdog process.
<dt><a name="WD_PORT"></a>wd_port <span class="version">V3.2 -</span></dt>
<dd>
<p>
- Specifies the port number for mutual monitoring of watchdog processes.
+ Specifies the port number for watchdog communication.
+ </p>
+ <p>
+ You need to restart pgpool-II if you change this value.
+ </p>
+ </dd>
+
+<dt><a name="WD_AUTHKEY"></a>wd_authkey <span class="version">V3.3 -</span></dt>
+ <dd>
+ <p>
+ This option specifies the authentication key used in watchdog communication.
+ All the pgpool-II must have the same key.
+ Packets from watchdog of wrong key will be rejects.
+ This authentication is applied also for heatrbeat singals if lifecheck method is heartbeat mode.
+ If this is empty (default), watchdog doesn't conduct authenticate.
</p>
<p>
You need to restart pgpool-II if you change this value.
@@ -4081,19 +4246,27 @@ All following options are required to be specified in watchdog process.
<dd>
<p>
Specifies the hostname pgpool-II server to be monitored.
+ This is used for sending/receiving queries and packets, and also as identifier of watchdog.
The number at the end of the parameter name is referred as "server id",
and it starts from 0.
</p>
+ <p>
+ You need to restart pgpool-II if you change this value.
+ </p>
</dd>
<dt><a name="OTHER_PGPOOL_PORT"></a>other_pgpool_port<font color="red">0</font>
<span class="version">V3.2 -</span></dt>
<dd>
<p>
- Specifies the port number for pgpool on pgpool-II server to be monitored.
+ Specifies the port number for pgpool service of pgpool-II server to be monitored.
+ In query mode, the queries specified in <a href="#WD_LIFECHECK_QUERY">wd_lifecheck_query</a> is sent to this port.
The number at the end of the parameter name is referred as "server id",
and it starts from 0.
</p>
+ <p>
+ You need to restart pgpool-II if you change this value.
+ </p>
</dd>
<dt><a name="OTHER_WD_PORT"></a>other_wd_port<font color="red">0</font> <span class="version">V3.2 -</span></dt>
@@ -4103,13 +4276,16 @@ All following options are required to be specified in watchdog process.
The number at the end of the parameter name is referred as "server id",
and it starts from 0.
</p>
+ <p>
+ You need to restart pgpool-II if you change this value.
+ </p>
</dd>
</dl>
-<h2 id="WATCHDOG_RESTRICTIONS">Restrictions on watchdog</h2>
+<h2 id="watchdog_restrictions">Restrictions on watchdog</h2>
<ul>
<li>
-When all the DB nodes are detached from a pgpool-II due to PostgreSQL server failure or
+In query mode, when all the DB nodes are detached from a pgpool-II due to PostgreSQL server failure or
pcp_detach_node issued, watchdog regards that the pgpool-II service is in down status and
brings the virtual IP assigned to watchdog down. Thus clients of pgpool cannot connect to
pgpool-II using the virtual IP any more. This is neccessary to avoid <i>split-brain</i>,
diff --git a/doc/pgpool-ja.html b/doc/pgpool-ja.html
index cb097a9df..db9a5ff7b 100644
--- a/doc/pgpool-ja.html
+++ b/doc/pgpool-ja.html
@@ -516,7 +516,7 @@ pgpool.confでは空白行や#で始まる行はコメントと見なされま
</p>
</dd>
</dl>
-
+
<h3>Pools</h3>
<dl>
@@ -625,7 +625,7 @@ pgpool.confでは空白行や#で始まる行はコメントと見なされま
<p>
md5 認証で用いる認証ファイルのファイル名を指定します。
デフォルト値は "pool_passwd" です。
- 空文字列("")を指定すると 認証ファイルの読込は無効になります。
+ 空文字列("")を指定すると 認証ファイルの読込は無効になります。
詳細は<a href="#md5">認証・アクセス制御方式</a>を参照してください。
</p>
<p>
@@ -3145,7 +3145,7 @@ benchs2=# show pool_status;
listen_addresses | localhost | host name(s) or IP address(es) to listen to
port | 9999 | pgpool accepting port number
socket_dir | /tmp | pgpool socket directory
- pcp_port | 9898 | PCP port # to bind
+ pcp_port | 9898 | PCP port # to bind
pcp_socket_dir | /tmp | PCP socket directory
</pre>
@@ -3525,7 +3525,7 @@ DESTDIR=$3 # database cluster of the DB node to be recovered
port=5432 # PostgreSQL port number
archdir=/data/archive_log # archive log directory
-# Force to flush current value of sequences to xlog
+# Force to flush current value of sequences to xlog
psql -p $port -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1|
while read i
do
@@ -3872,7 +3872,7 @@ pgpool-IIは、独立したサーバに配置することもできますし、
<dt>DBサーバと同居
<dd>
<p>
- PostgreSQLの稼働しているDBサバと同居させる方法です。
+ PostgreSQLの稼働しているDBサーバと同居させる方法です。
この方法では、pgpool-IIが単一障害点になることがなく、余計なサーバを追加する必要もない点が優れていますが、
アプリケーションがどのDBサーバに接続するのかを自ら判断する必要があるのが欠点です。
この問題を解決するには、pgpool-HAと組み合わせて仮想IPを利用します。
@@ -3891,42 +3891,54 @@ pgpool-IIと同様、pgpoolプロジェクトのサブプロジェクトであ
<!-- ================================================================================ -->
<h1 id="watchdog">Watchdog <span class="version">V3.2 ~</span></h1>
+<h2 id="what_is_watchdog">watchdog とは</h2>
<p>
-watchdog プロセスは pgpool-II 本体から起動される、高可用性を目的としたプロセスです。
-以下の機能を提供します。
+watchdog プロセスは pgpool-II から起動される、高可用性を目的としたプロセスです。
+複数の pgpool-II を連携させることで単一障害点を回避します。
+watchdog は以下の機能を提供します。
</p>
-<dl>
-<dt>pgpool サービスの死活監視</dt>
- <dd>
+<h3>pgpool-II の死活監視</h3>
+<p>watchdog は pgpool-II の監視を行います。監視の方法は「ハートビート」モードと「クエリ」モードの2つがあります。</p>
+<ul>
+<li>
+ ハートビートモードでは、watchdog はハートビート信号を用いて 他の pgpool-II プロセスの死活監視を行います。
+ watchdog は、他の pgpool-II の watchdog より定期的に送られるハートビート信号を受け取り、これが一定期間以上途切れた場合にはその pgpool-II プロセスに障害が発生したと判断します。
+ </li>
+<li>
+ クエリモードでは、watchdog は pgpool-II のプロセスではなく「サービス」の応答を監視します。
+ このモードでは、監視対象の pgpool-II にクエリを発行しその応答をチェックします。
+ </li>
+</ul>
<p>
- watchdog は pgpool のプロセスではなく、サービスの応答を監視します。
- 監視対象の pgpool から PostgreSQL に問い合わせを行い、その応答をチェックします。
+ また watchdog は、pgpool-II から上位のサーバ(アプリケーションサーバなど)への接続も監視し、上位サーバへ pgpool-II のサービスを提供できるかチェックしています。
+ この監視に失敗した場合には、watchdog は pgpool-II に障害が発生しているとみなしダウンステータスに移行します。
</p>
+<h3>pgpool-II 間の協調動作</h3>
<p>
- また watchdog は、pgpool から上位のサーバ(アプリケーションサーバなど)への接続も監視します。
- 上位サーバから PostgreSQL への接続・応答を pgpool のサービスとして死活監視します。
+ watchdog は互いに情報交換を行うことで複数の pgpool-II を協調動作させます。
</p>
- </dd>
-
-<dt>watchdog プロセスの相互監視</dt>
- <dd>
- <p>
- 各 watchdog はお互いの監視対象のサーバの情報を交換します。
- これにより、pgpool サーバの情報を最新に保てるだけでなく、各 watchdog プロセスの相互監視を行っています。
+<ul>
+ <li>
+ フェールオーバなどでバックエンドノードの状態が変化した場合には、この情報を他の pgpool-II へ伝達し、同期を行います。
+ </li>
+ <li>
+ オンラインリカバリ時には、複数の pgpool-II で DB に不整合が生じないよう他の pgpool-II へのクライアントの接続を制限します。
+ </li>
</p>
- </dd>
+ <li>
+ フェールオーバ、ファイルバックの際に実行されるコマンド(<a href="#FAILOVER_COMMAND">failover_command</a>,
+ <a href="#FAILBACK_COMMAND">failback_command</a>, <a href="#FOLLOW_MASTER_COMMAND">follow_master_command</a>)は、インターロック機構により、1つの pgpool-II でのみ実行されます。
+ </li>
+</ul>
-<dt>障害発生検知時のアクティブ、スタンバイ切り替え</dt>
- <dd>
+<h3>障害発生検知時のアクティブ、スタンバイ切り替え</h3>
<p>
- pgpool のサービスに障害を検知した場合、watchdog は他の watchdog に障害検知を通知します。
- 故障した pgpool がアクティブの場合、他の watchdog は新しいアクティブを投票で決め、
+ pgpool-II の障害を検知した場合、watchdog は他の watchdog に障害検知を通知します。
+ 故障した pgpool-II がアクティブの場合、他の watchdog は新しいアクティブを投票で決め、
アクティブ・スタンバイの切り替えを行います。
</p>
- </dd>
-<dt>サーバ切り替えと連動した仮想 IP アドレスの自動付け替え</dt>
- <dd>
+<h3>サーバ切り替えと連動した仮想 IP アドレスの自動付け替え</h3>
<p>
スタンバイが新しいアクティブに昇格する際、新アクティブ機の watchdog は
アクティブ用の仮想IPインターフェースを起動します。
@@ -3935,20 +3947,16 @@ watchdog プロセスは pgpool-II 本体から起動される、高可用性を
一方、旧アクティブ機の watchdog はアクティブ用仮想 IP インターフェースを停止します。
これにより、サーバが切り替わった後もアクティブは同じ IP アドレスでサービスを継続することができます。
</p>
- </dd>
-<dt>サーバ復旧時、スタンバイ機としての自動登録</dt>
- <dd>
+<h3>サーバ復旧時、スタンバイ機としての自動登録</h3>
<p>
障害機の復旧や新規サーバを追加する場合、watchdog はサーバの情報を他の watchdog に通知し、
他の watchdog からはアクティブや他のサーバの情報を受け取ります。
これにより追加したサーバはスタンバイ機として自動的に追加されます。
</p>
- </dd>
-</dl>
-<h2 id="watchdog_structure">サーバ構成</h2>
+<h2 id="watchdog_server_composition">サーバ構成</h2>
<p>
watchdogプロセスを含むpgpool-IIサーバは以下の図のようなシステム構成をとります。
</p>
@@ -3957,12 +3965,16 @@ watchdogプロセスを含むpgpool-IIサーバは以下の図のようなシス
<h2 id="start_watchdog">watchdog の起動と停止</h2>
<p>
-watchdog プロセスは pgpool-II から自動的に起動・停止されますので、固有の起動・停止コマンドはありません。
-しかし、watchdog プロセスは仮想IPインターフェースの起動・停止を行いますので、
-pgpool-II の起動は <font color="red">root 権限で</font> 行う必要があります。
+watchdog プロセスは pgpool-II の子プロセスとして自動的に起動・停止されますので、固有の起動・停止コマンドはありません。
</p>
<p>
-なお、他の pgpool および接続先の PostgreSQL が全て起動するのを待ってから、死活監視を開始します。
+watchdog は仮想 IP インターフェースの起動・停止を行うため、 <font color="red">root 権限</font>を要求します。
+pgpool-II を起動する際に root 権限で実行するのが1つの方法です。
+しかし、セキュリティ上の理由からは、sudo や setuid を利用したコマンドを <a href="#IF_UP_CMD">if_up_cmd</a>、
+<a href="#IF_DOWN_CMD">if_up_cmd</a>、<a href="#ARPING_CMD">if_up_cmd</a> に設定するのがより良い方法です。
+</p>
+<p>
+なお、死活監視は他の全ての pgpool-II が生きていることを確認したのちに開始されます。
</p>
<h2 id="config_watchdog">pgpool.conf の設定</h2>
@@ -3971,9 +3983,6 @@ watchdog プロセスの設定項目は pgpool.conf に記述します。
pgpool.conf.sample ファイルの WATCHDOG セクションにサンプルを記述していますので、参照してください。
</p>
<p>
-<font color="red">注意: watchdogを有効化する場合は、<a href="#NUM_INIT_CHILDREN">num_init_children</a>に十分大きな値を設定して下さい。watchdog自身もpgpool-IIにクライアントとして接続するためです。</font>
-</p>
-<p>
watchdog プロセスは以下の項目すべてを指定する必要があります。
</p>
@@ -3994,9 +4003,9 @@ watchdog プロセスは以下の項目すべてを指定する必要があり
<h4>上位サーバへの接続</h4>
<p>
-pgpool あるいは PostgreSQL のサービス提供先(DB クライアント)のサーバを、上位サーバと呼びます。
-pgpoolが生きていて PostgreSQLと繋がっている場合でも、
-上位サーバとのリンクが切れていれば「サービス」を継続できません。
+pgpool-II あるいは PostgreSQL のサービス提供先(DB クライアント)のサーバを、上位サーバと呼びます。
+pgpool-II が生きていて PostgreSQL と繋がっている場合でも、
+上位サーバとのリンクが切れていればサービスを継続できません。
そのため、watchdog は上位サーバとのリンクが繋がっているかどうかも監視します。
</p>
@@ -4007,9 +4016,10 @@ pgpoolが生きていて PostgreSQLと繋がっている場合でも、
上位接続を確認するための信頼できるサーバリストです。
ping の応答が得られる必要があります。
"hostA,hostB,hostC ..." のようにカンマで区切って複数のサーバを指定できます。
+ 全てのサーバへの ping が失敗した場合、watchdog は pgpool-II に障害が発生したと判断します。
</p>
<p>
- 指定がない場合は上位サーバへのネットワーク到達監視をしません。
+ 指定がない場合は上位サーバへの接続監視は行いません。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
@@ -4028,126 +4038,299 @@ pgpoolが生きていて PostgreSQLと繋がっている場合でも、
</dd>
</dl>
-<h4>pgpool-II の死活監視</h4>
+<h4>仮想 IP</h4>
+
+<p>
+仮想 IP の制御に関する設定です。
+</p>
<dl>
-<dt><a name="WD_INTERVAL"></a>wd_interval <span class="version">V3.2 ~</span></dt>
+<dt><a name="DELEGATE_IP"></a>delegate_IP <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- pgpool-II への生存監視の間隔(秒)です。
- (1 以上の数値)
+ (アプリケーションサーバなど)外部からの接続される pgpool-II の仮想 IP アドレスです。
+ スタンバイからアクティブに切り替わる際、pgpool-II はこの仮想 IP を引き継ぎます。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
-<dt><a name="WD_LIFE_POINT"></a>wd_life_point <span class="version">V3.2 ~</span></dt>
+<dt><a name="IFCONFIG_PATH"></a>ifconfig_path <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- pgpool-II の死活監視で応答が得られなかった場合のリトライ回数です。
- (1 以上の数値)
+ IP アドレス切り替えに利用するコマンドのパスです。
+ "/sbin" のようにパスだけを指定します。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
-<dt><a name="WD_LIFECHECK_QUERY"></a>wd_lifecheck_query <span class="version">V3.2 ~</span></dt>
+<dt><a name="IF_UP_CMD"></a>if_up_cmd <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- pgpool-II の死活監視のために発行されるクエリです。
- デフォルトは "SELECT 1" です。
+ 仮想 IP を起動するために実行するコマンドです。
+ "ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0"
+ のようにコマンドとパラメータを指定します。
+ $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
+<dt><a name="IF_DOWN_CMD"></a>if_down_cmd <span class="version">V3.2 ~</span></dt>
+ <dd>
+ <p>
+ 仮想IPを停止するために実行するコマンドです。
+ "ifconfig eth0:0 down"
+ のようにコマンドとパラメータを指定します。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="ARPING_PATH"></a>arping_path <span class="version">V3.2 ~</span></dt>
+ <dd>
+ <p>
+ IP アドレス切り替え後に ARP リクエストを送信するコマンドのパスです。
+ "/usr/sbin" のようにパスだけを指定します。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="ARPING_CMD"></a>arping_cmd <span class="version">V3.2 ~</span></dt>
+ <dd>
+ <p>
+ IPアドレス切り替え後にARPリクエストを送信するコマンドです。
+ "arping -U $_IP_$ -w 1"
+ のようにコマンドとパラメータを指定します。
+ $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
</dl>
-<h4>仮想 IP</h4>
+<h4>昇格時の振る舞い</h4>
+<p>pgpool-II がアクティブ(仮想 IP を保持しているステータス)に昇格した時の振る舞いの設定です。</p>
<dl>
-<dt><a name="DELEGATE_IP"></a>delegate_IP <span class="version">V3.2 ~</span></dt>
+
+<dt><a name="CLEAR_MEMQCACHE_ON_ESCALATION"></a>clear_memqcache_on_escalation <span class="version">V3.3 ~</span></dt>
<dd>
<p>
- (アプリケーションサーバなど)外部からの接続される pgpool-II の仮想 IP アドレスです。
- スタンバイからアクティブに切り替わる際、pgpool はこの仮想 IP を引き継ぎます。
+ このオプションが on の場合、pgpool-II がアクティブに昇格した時に、共有メモリ上のクエリキャッシュを全て削除します。
+ これにより、旧アクティブと非整合な古いクエリキャッシュが使われることを防止します。
+ <a href="#MEMQCACHE_METHOD">memqcache_method</a> が 'shmem' の場合のみ有効です。
+ デフォルトは on です。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
-<dt><a name="IFCONFIG_PATH"></a>ifconfig_path <span class="version">V3.2 ~</span></dt>
+<dt><a name="wd_escalation_command"></a>wd_escalation_command <span class="version">V3.3 ~</span></dt>
<dd>
<p>
- IP アドレス切り替えに利用するコマンドのパスです。
- "/sbin" のようにパスだけを指定します。
+ pgpool-II がアクティブに昇格した時に、ここで指定したコマンドが実行されます。
+ コマンドは、仮想 IP が立ち上がる直前のタイミングで実行されます。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
-<dt><a name="IF_UP_CMD"></a>if_up_cmd <span class="version">V3.2 ~</span></dt>
+</dl>
+
+<h3>pgpool-II の死活監視</h3>
+
+<p>watchdog は一定時間間隔で pgpool-II の状態のチェック、すなわち死活監視を行います。</p>
+
+<h4>共通設定</h4>
+
+<dl>
+<dt><a name="WD_LIFECHECK_METHOD"></a>wd_lifecheck_method <span class="version">V3.3 ~</span></dt>
<dd>
<p>
- 仮想 IP を起動するために実行するコマンドです。
- "ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0"
- のようにコマンドとパラメータを指定します。
- $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。
+ 死活監視の方法を指定します。指定できる値は 'heartbeat' (デフォルト)か 'query' です。
+ </p>
+ <p>
+ 'heartbeat' を指定した場合には、監視は「ハートビートモード」で行われます。
+ watchdog は一定間隔でハートビート信号(UDP パケット)を他の pgpool-II へ送信します。
+ また watchdog は他の pgpool-II から送られてくる信号を受信し、これが一定時間以上途絶えた場合にはその pgpool-II に障害が発生したと判断します。
+ </p>
+ <p>
+ 'query' を指定した場合には、監視は「クエリモード」で行われます。
+ watchdog は監視用のクエリを pgpool-II に発行し、それが成功するかどうかで pgpool-II が生きているかどうかを判断します。
+ </p>
+ <p>
+ <font color="red">注意: クエリモードを使用する場合は、<a href="#NUM_INIT_CHILDREN">num_init_children</a>に十分大きな値を設定して下さい。watchdog 自身も pgpool-II にクライアントとして接続するためです。</font>
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
-<dt><a name="IF_DOWN_CMD"></a>if_down_cmd <span class="version">V3.2 ~</span></dt>
+<dt><a name="WD_INTERVAL"></a>wd_interval <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- 仮想IPを停止するために実行するコマンドです。
- "ifconfig eth0:0 down"
- のようにコマンドとパラメータを指定します。
+ 死活監視を行う間隔(秒)です。
+ (1 以上の数値)
+ デフォルトの値は 10 です。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
+</dl>
-<dt><a name="ARPING_PATH"></a>arping_path <span class="version">V3.2 ~</span></dt>
+<h4>ハートビートモードの設定</h4>
+
+<dl>
+<dt><a name="WD_HEARTBEAT_PORT"></a>wd_heartbeat_port <span class="version">V3.3 ~</span></dt>
<dd>
<p>
- IP アドレス切り替え後に ARP リクエストを送信するコマンドのパスです。
- "/usr/sbin" のようにパスだけを指定します。
+ ハートビート信号を受信するポート番号を指定します。
+ ハートビートモードの場合のみ有効です。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
-<dt><a name="ARPING_CMD"></a>arping_cmd <span class="version">V3.2 ~</span></dt>
+<dt><a name="WD_HEARTBEAT_KEEPALIVE"></a>wd_heartbeat_keepalive <span class="version">V3.3 ~</span></dt>
<dd>
<p>
- IPアドレス切り替え後にARPリクエストを送信するコマンドです。
- "arping -U $_IP_$ -w 1"
- のようにコマンドとパラメータを指定します。
- $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。
+ ハートビート信号を送信する間隔(秒)を指定します。
+ デフォルトは 2 です。
+ ハートビートモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="WD_HEARTBEAT_DEADTIME"></a>wd_heartbeat_deadtime <span class="version">V3.3 ~</span></dt>
+ <dd>
+ <p>
+ このオプションで指定された間隔(秒)の間ハートビート信号が途絶えた場合、その pgpool-II に障害が発生したとみなされます。
+ ハートビートモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="WD_HEARTBEAT_DEVICE"></a>wd_heartbeat_port<font color="red">0</font> <span class="version">V3.3 ~</span></dt>
+ <dd>
+ <p>
+ ハートビートの送受信に用いるネットワークデバイス名を指定します。
+ 複数のデバイスが設定可能です。
+ 数値の部分はデバイスの番号です。
+ デバイス毎に 0 からの連番にします。
+ 1つのデバイスに複数のハートビート送信先(<a href="WD_HEARTBEAT_DESTINATION">wd_heartbeat_destiationN</a>)を設定する場合は、重複するデバイス名を異なる番号で指定してください。
+ ハートビートモードの場合のみ有効です。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
</p>
</dd>
+<dt><a name="WD_HEARTBEAT_DESTINATION"></a>wd_heartbeat_destination<font color="red">0</font> <span class="version">V3.3 ~</span></dt>
+ <dd>
+ <p>
+ <a href="WD_HEARTBEAT">wd_heartbeat_deviceX</a>に指定したデバイスから送るハートビート信号の宛先を、ホスト名か IP で指定します。
+ 数値の部分はデバイスの番号です。
+ デバイス毎に 0 からの連番にします。
+ ハートビートモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
</dl>
-<h3>死活監視の受信設定セクション</h3>
+<h4>クエリモードの設定</h4>
+
+<dl>
+<dt><a name="WD_LIFE_POINT"></a>wd_life_point <span class="version">V3.2 ~</span></dt>
+ <dd>
+ <p>
+ 監視クエリの応答が得られなかった場合のリトライ回数です。
+ (1 以上の数値)
+ デフォルトの値は 3 です。
+ クエリモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_QUERY"></a>wd_lifecheck_query <span class="version">V3.2 ~</span></dt>
+ <dd>
+ <p>
+ pgpool-II の死活監視のために発行されるクエリです。
+ デフォルトは "SELECT 1" です。
+ クエリモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_DBNAME"></a>wd_lifecheck_dbname <span class="version">V3.3 ~</span></dt>
+ <dd>
+ <p>
+ 監視クエリを送る際の接続先のデータベース名です。
+ デフォルトは 'template1' です。
+ クエリモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_USER"></a>wd_lifecheck_user <span class="version">V3.3 ~</span></dt>
+ <dd>
+ <p>
+ 監視クエリを送る際にデータベースに接続するユーザ名です。
+ デフォルトは 'nobody' です。
+ クエリモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="WD_LIFECHECK_PASSWORD"></a>wd_lifecheck_password <span class="version">V3.3 ~</span></dt>
+ <dd>
+ <p>
+ 監視クエリを送る際にデータベースに接続するパスワードです。
+ デフォルトでは設定されていません。
+ クエリモードの場合のみ有効です。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+</dl>
+
+<h3>watchdog 間通信</h3>
+
+<p>watchdog 間の情報交換に関する設定です。</p>
+
<dl>
<dt><a name="WD_HOSTNAME"></a>wd_hostname <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- watchdog プロセスが相互監視を受信する為のホスト名または IP アドレスです。
+ pgpool-II サーバのホスト名または IP アドレスです。
+ クエリやパケットの送受信の他、watchdog の識別子としても用います。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
@@ -4157,7 +4340,21 @@ pgpoolが生きていて PostgreSQLと繋がっている場合でも、
<dt><a name="WD_PORT"></a>wd_port <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- watchdog プロセスが相互監視を受信する為のポート番号です。
+ wachdog 間の情報交換のためのパケットを受信するポート番号を指定します。
+ </p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
+ </dd>
+
+<dt><a name="WD_AUTHKEY"></a>wd_authkey <span class="version">V3.3 ~</span></dt>
+ <dd>
+ <p>
+ wachdog 間通信で用いられる認証キーです。
+ 全ての pgpool-II で同じキーを指定する必要があります。
+ 認証キーが異なる watchdog からの通信は拒絶されます。
+ 死活監視をハートビートモードで行う場合には、この認証はハートビート信号にも適用されます。
+ 指定が無い場合には認証は行われず、これがデフォルトです。
</p>
<p>
このパラメータを変更した時には pgpool-II を再起動してください。
@@ -4165,40 +4362,51 @@ pgpoolが生きていて PostgreSQLと繋がっている場合でも、
</dd>
</dl>
-<h3>死活監視対象サーバ指定セクション</h3>
+<h3>監視対象サーバ</h3>
<dl>
<dt><a name="OTHER_PGPOOL_HOSTNAME"></a>other_pgpool_hostname<font color="red">0</font> <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- 監視対象のpgpool-IIサーバのホスト名を指定します。
- 数値の部分は監視対象サーバの番号です。
+ 監視対象の pgpool-II サーバのホスト名を指定します。
+ クエリやパケットの送受信の他、watchdog の識別子としても用います。
+ 数値の部分は監視対象サーバの通し番号です。
監視対象のサーバ毎に 0 からの連番にします。
</p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
</dd>
<dt><a name="OTHER_PGPOOL_PORT"></a>other_pgpool_port<font color="red">0</font> <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- 監視対象のpgpool-IIサーバのpgpool用のポート番号を指定します。
- 数値の部分は監視対象サーバの番号です。
+ 監視対象の pgpool-II サーバの pgpool ポート番号を指定します。
+ クエリモード使用時に、<a href="#WD_LIFECHECK_QUERY">wd_lifecheck_query</a> に指定したクエリがこのポートへ送られます。
+ 数値の部分は監視対象サーバの通し番号です。
監視対象のサーバ毎に 0 からの連番にします。
</p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
</dd>
<dt><a name="OTHER_WD_PORT"></a>other_wd_port<font color="red">0</font> <span class="version">V3.2 ~</span></dt>
<dd>
<p>
- 監視対象のpgpool-IIサーバのwatchdog用のポート番号を指定します
+ 監視対象の pgpool-II サーバの watchdog パケット受信ポート番号を指定します
数値の部分は監視対象サーバの番号です。
監視対象のサーバ毎に 0 からの連番にします。
</p>
+ <p>
+ このパラメータを変更した時には pgpool-II を再起動してください。
+ </p>
</dd>
</dl>
-<h2 id="WATCHDOG_RESTRICTIONS">watchdog の制限事項</h2>
+<h2 id="watchdog_restrictions">watchdog の制限事項</h2>
<ul>
<li>
- PostgreSQL サーバのダウンや pcp_detach_node の実行により pgpool-II から全ての DB ノードが切り離された場合、
+ クエリモード使用時に、PostgreSQL サーバのダウンや pcp_detach_node の実行により pgpool-II から全ての DB ノードが切り離された場合、
watchdog は pgpool-II のサービスがダウンした状態とみなし、watchdog に割り当てられていた仮想 IP は停止されます。
そのため、クライアントは仮想 IP を使って pgpool-II への接続することは出来なくなります。
これは、アクティブの pgpool-II が複数できてしまう「スプリットブレイン」状況を避けるための仕様です。
@@ -4910,17 +5118,17 @@ name : listen_addresses
value: localhost
desc : host name(s) or IP address(es) to listen to
-name : port
-value: 9999
+name : port
+value: 9999
desc : pgpool accepting port number
name : socket_dir
-value: /tmp
+value: /tmp
desc : pgpool socket directory
name : pcp_port
-value: 9898
-desc : PCP port # to bind
+value: 9898
+desc : PCP port # to bind
</pre>
@@ -5004,7 +5212,7 @@ pgpool-IIを指定されたモードでシャットダウンします。指定
りです。
s - smart モード
-f - fast モード
+f - fast モード
i - immediate モード
pgpool-IIが起動していない場合はConnectionErrorと表示され、終了コード8で終了し
@@ -5207,7 +5415,7 @@ FROM句に複数のテーブル、又はサブクエリがある場合
<p>
以下の例では、P1-tableが P 状態のテーブルでL1-table,L2-tableが L 状態のテーブルだとします。
すると上記の表により、P1-table (左)とL1-table (右) が結合し P 状態となり、
-さらに P 状態と L 状態のL2-tableが結合してFROM句の実行ステータスは P 状態となります。
+さらに P 状態と L 状態のL2-tableが結合してFROM句の実行ステータスは P 状態となります。
<pre>
SELECT * FROM P1-table,L1-table,L2-table;
</pre>
@@ -5331,10 +5539,10 @@ SELECT L1-table.col FROM L1-table WHERE L1-table.col % 2 = 0 AND L1-table.col IN
<pre>
SELECT L1-table.col FROM dblink(SELECT loadbalance(SELECT L1-table.col FROM L1-table WHERE L1-table.col % 2 = 0 AND TRUE))
WHERE
- L1-table.col %2 = 0 AND
- L1-table.col IN
+ L1-table.col %2 = 0 AND
+ L1-table.col IN
(
- SELECT P1-Table FROM
+ SELECT P1-Table FROM
dblink(select pool_parallel(SELECT P1-table FROM P1-table))
) ;
</pre>
@@ -6371,7 +6579,7 @@ SELECTの最終実行ステータスとパフォーマンスのおおよその
<li>チュートリアル</li>
<p><a href="#memqcache">オンメモリクエリキャッシュ</a> と <a href="#watchdog">Watchdog 機能</a>
- のチュートリアルを作成しました。(Nozomi Anzai)</p>
+ のチュートリアルを作成しました。(Nozomi Anzai)</p>
</ul>
@@ -6805,7 +7013,7 @@ autoconf
<li>watchdog のポート番号が既に使用されていた場合にエラーメッセージを出力するよう修正しました。
(Yugo Nagata)
-<p>
+<p>
この問題は [pgpool-general: 1167] で Will Ferguson さんによって報告されました。
</p>
<blockquote>
@@ -6840,7 +7048,7 @@ autoconf
</p>
<blockquote>
#35 Authentication is timeout<br />
- Reporter: tuomas
+ Reporter: tuomas
Date: 2012-11-20 11:54
<a href="http://www.pgpool.net/mantisbt/view.php?id=35">
http://www.pgpool.net/mantisbt/view.php?id=35</a>
@@ -7525,7 +7733,7 @@ Date: Wed, 05 Oct 2011 15:15:07 -0700
</p>
</li>
-<li>ストリーミングレプリケーションモードでレプリケーション遅延が大きくなったときに、
+<li>ストリーミングレプリケーションモードでレプリケーション遅延が大きくなったときに、
"portal not found" エラーが発生するバグを修正しました。 (Tatsuo Ishii)
<p>
これは delay_threshold が導入以来、ずっと存在していたバグです。
@@ -7541,9 +7749,9 @@ Date: Wed, 05 Oct 2011 15:15:07 -0700
<li>pg_md5 で、ユーザからのパスワード入力の後には改行するように修正しました。 (Yugo Nagata)</li>
-<li>watchdog のポート番号が既に使用されていた場合にエラーメッセージを出力するよう修正しました。
+<li>watchdog のポート番号が既に使用されていた場合にエラーメッセージを出力するよう修正しました。
(Yugo Nagata)
-<p>
+<p>
この問題は [pgpool-general: 1167] で Will Ferguson さんによって報告されました。
</p>
<blockquote>
@@ -7573,12 +7781,12 @@ Date: Wed, 05 Oct 2011 15:15:07 -0700
<li>pool_read() が不正なパケットを読み込んだ場合に、read_startup_packet() がアラームクロック
をリセットして StartupPacket を解放するよう修正しました。 (Nozomi Anzai)
<p>
- 修正前は、pgpool ポートの監視を行うプログラムの接続により、認証のタイムアウトが発生していました。
+ 修正前は、pgpool ポートの監視を行うプログラムの接続により、認証のタイムアウトが発生していました。
この問題は、バグトラック #35 で報告されました。
</p>
<blockquote>
#35 Authentication is timeout<br />
- Reporter: tuomas
+ Reporter: tuomas
Date: 2012-11-20 11:54
<a href="http://www.pgpool.net/mantisbt/view.php?id=35">
http://www.pgpool.net/mantisbt/view.php?id=35</a>
@@ -7589,7 +7797,7 @@ Date: Wed, 05 Oct 2011 15:15:07 -0700
<p>
このポインタは事前に memset() によって初期化されているため、実際にはこのバグによる害は
ありませんでした。
-</p>
+</p>
</li>
<li>ヘルプメッセージに -f オプションの説明を追加しました。 (Tatsuo Ishii)</li>
@@ -7842,7 +8050,7 @@ Date: Wed, 05 Oct 2011 15:15:07 -0700
<h3>バグ修正</h3>
<p>
</p><ul>
- <li>pgpool-regclass()をPostgreSQL 8.0以降でコンパイルできるように修正しました。7.4はまだエラーが出ます(Tatsuo Ishii)
+ <li>pgpool-regclass()をPostgreSQL 8.0以降でコンパイルできるように修正しました。7.4はまだエラーが出ます(Tatsuo Ishii)
</li><li>ストリーミングレプリケーション構成で/*NO LOAD BALANCE*/コメントを使用したときに
ハングアップする可能性を修正しました(Toshihiro Kitagawa)
</li><li>Flush(H)メッセージやCloseComplete(C)メッセージを受信したときのハングアップを修正しました(Toshihiro Kitagawa)
@@ -8829,7 +9037,7 @@ S: <-- ok since no previous SELECT is sent. kind mismatch error occurs!
<h2>2.0.1 (hikitsuboshi) 2007/11/21</h2>
<ul>
<li> UPDATE もしくは DELETE を実行するとプロセスがダウンする不具合を
- 修正しました。(Yoshiyuki Asaba)
+ 修正しました。(Yoshiyuki Asaba)
</li><li> <a href="#MASTER_SLAVE_MODE">master_slave</a> を true に設定している場合に、SQL 構文エラーを検知
した時にマスタにのみそのクエリを送信するようにしました。(Yoshiyuki Asaba)
</li></ul>
@@ -8889,7 +9097,7 @@ HINT: check data consistency between master and other db node
<li> 新しく <a href="AUTHENTICATION_TIMEOUT">authentication_timeout</a> という
パラメータを追加しました。(Yoshiyuki Asaba)
<ul>
- <li>このパラメータでは認証時間のタイムアウトを設定します。
+ <li>このパラメータでは認証時間のタイムアウトを設定します。
</li><li>デフォルト値は 60 (1 分)です。
</li></ul>
</li><li> スタートアップパケットの長さが 10000 バイト越えている場合には、接続を切断するようにしました。(Yoshiyuki Asaba)
[parent: f2b7fb783df2]