pgpool2.git / summary / log / commit / refs
commit 893f009e91da28adbbebf0b6c82de6dc48cf78ca
Author: Nozomi Anzai <anzai@sraoss.co.jp>
Date: Wed Jul 24 06:56:56 2013 +0000
Add the description about pgpool.pg_ctl.
Some visual improvements.
doc/pgpool-en.html | 1371 +++++++++++++++++++++++++++-------------------------
doc/pgpool-ja.html | 1139 +++++++++++++++++++++++--------------------
doc/pgpool.css | 21 +
3 files changed, 1327 insertions(+), 1204 deletions(-)
diff --git a/doc/pgpool-en.html b/doc/pgpool-en.html
index 88fb881f8..265c69323 100644
--- a/doc/pgpool-en.html
+++ b/doc/pgpool-en.html
@@ -37,9 +37,9 @@ Last modified: Tue Jul 23 08:04:32 JST 2013
<li><a href="#backup">Backup</a></li>
<li><a href="#deploy">Deploying pgpool-II</a></li>
<li><a href="#watchdog">Watchdog</a></li>
+ <li><a href="#pcp_command">PCP commands</a></li>
<li><a href="#troubleshooting">Troubleshooting</a></li>
<li><a href="#restriction">Restrictions</a></li>
- <li><a href="#reference">References</a></li>
<li><a href="#internal">internal</a></li>
</ul>
</div>
@@ -123,9 +123,9 @@ See <a href="#restriction">Restrictions</a> for more details.</strong>
<h1>License<a name="license"></a></h1>
+<p>Copyright (c) 2003-2013 PgPool Global Development Group</p>
+<p><br></p>
<p>
-Copyright (c) 2003-2013 PgPool Global Development Group
-
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
@@ -180,8 +180,10 @@ pgpool-II's source code can be downloaded from:
make. Also, pgpool-II links with the libpq library, so the libpq library and its development
headers must be installed on the machine used to build pgpool-II. Additionally
the OpenSSL library and its development headers must be present in order to
-enable OpenSSL support in pgpool-II</p>
+enable OpenSSL support in pgpool-II.</p>
+
+<h2 id="install_pgpool">Installing pgpool-II</h2>
<dl>
<dt>configure</dt>
<dd>
@@ -230,76 +232,93 @@ make install
will install pgpool-II. (If you use Solaris or FreeBSD, replace make with gmake)
</p>
</dd>
+</dl>
+
+<h2 id="install_functions">Installing functions</h2>
+
+<h3>Installing pgpool_regclass (recommended) <span class="version">V3.0 -</span></h3>
+<p>
+If you are using PostgreSQL 8.0 or later, installing pgpool_regclass function on all PostgreSQL
+to be accessed by pgpool-II is strongly recommended, as it is used internally by pgpool-II.
+Without this, handling of duplicate table names in different schema
+might cause trouble (temporary tables aren't a problem).
+</p>
-<dt>Installing pgpool_regclass <span class="version">V3.0 -</span></dt>
- <dd>
- <p>
- If you are using PostgreSQL 8.0 or later, installing pgpool_regclass function on all PostgreSQL
- to be accessed by pgpool-II is strongly recommended, as it is used internally by pgpool-II.
- Without this, handling of duplicate table names in different schema
- might cause trouble (temporary tables aren't a problem).
- </p>
- <p>
<pre>
-cd pgpool-II-x.x.x/sql/pgpool-regclass
-make
-make install
+$ cd pgpool-II-x.x.x/sql/pgpool-regclass
+$ make
+$ make install
</pre>
- </p>
- <p>
-After this:
- <p>
+
+<p>After this:<p>
<pre>
-psql -f pgpool-regclass.sql template1
+$ psql -f pgpool-regclass.sql template1
</pre>
- </p>
- <p>
-or
- <p>
+
+<p>or<p>
+
<pre>
-psql template1
-CREATE EXTENSION pgpool_regclass;
+$ psql template1
+=# CREATE EXTENSION pgpool_regclass;
</pre>
</p>
- <p>
- Executing pgpool-regclass.sql or CREATE EXTENSION should be performed on every databases accessed
- with pgpool-II.
- You do not need to do this for a database created after the
- execution of "psql -f pgpool-regclass.sql template1" or CREATE EXTENSION, as this template database
- will be cloned to create new databases.
- </p>
- </dd>
+<p>
+Executing pgpool-regclass.sql or <code>CREATE EXTENSION</code> should be performed on every databases accessed
+with pgpool-II.
+You do not need to do this for a database created after the
+execution of "<code>psql -f pgpool-regclass.sql template1</code>" or <code>CREATE EXTENSION</code>,
+as this template database will be cloned to create new databases.
+</p>
+
+<h3>Creating insert_lock table <span class="version">V3.0 -</span></h3>
+<p>
+If you use insert_lock in replication mode, creating pgpool_catalog.insert_lock
+table for mutual exclusion is strongly recommended.
+Without this, insert_lock works so far. However in that case pgpool-II locks
+against the insert target table. This behavior is same as pgpool-II 2.2 and 2.3
+series. The table lock conflicts with VACUUM. So INSERT processing may be thereby
+kept waiting for a long time.
+</p>
-<dt>Creating insert_lock table <span class="version">V3.0 -</span></dt>
- <dd>
- <p>
- If you use insert_lock in replication mode, creating pgpool_catalog.insert_lock
- table for mutual exclusion is strongly recommended.
- Without this, insert_lock works so far. However in that case pgpool-II locks
- against the insert target table. This behavior is same as pgpool-II 2.2 and 2.3
- series. The table lock conflicts with VACUUM. So INSERT processing may be thereby
- kept waiting for a long time.
- </p>
<pre>
-cd pgpool-II-x.x.x/sql
-psql -f insert_lock.sql template1
+$ cd pgpool-II-x.x.x/sql
+$ psql -f insert_lock.sql template1
</pre>
- <p>
- Executing insert_lock.sql should be performed on every databases accessed
- with pgpool-II.
- You do not need to do this for a database created after the execution of
- "psql -f insert_lock.sql template1", as this template database will be
- cloned to create new databases.
- </p>
- </dd>
-</dl>
<p>
-Installing is done. If you are using Solaris or FreeBSD,
-you need to replace "make" with "gmake" in the above description
-because those operating systems requires GNU make.
+Executing insert_lock.sql should be performed on every databases accessed
+with pgpool-II.
+You do not need to do this for a database created after the execution of
+"<code>psql -f insert_lock.sql template1</code>", as this template database will be
+cloned to create new databases.
</p>
+<h3>Installing pgpool_recovery</h3>
+
+<p>If you use <a href="#online_recovery_in_stream_mode">online recovery</a>, some functions are needed:
+pgpool_recovery, pgpool_remote_start, pgpool_switch_xlog.</p>
+<p>And, pgpoolAdmin of the tool to control pgpool-II can stop, restart and reload the backend PostgreSQL nodes,
+and it needs the function named pgpool_pgctl.</p>
+<p>Here is the way to install there functions.</p>
+<pre>
+$ cd pgpool-II-x.x.x/sql/pgpool-regclass
+$ make
+$ make install
+$ psql -f pgpool-recovery.sql template1
+</pre>
+
+<h4>Configuring pgpool.pgctl <span class="version">V3.0 -</span></h4>
+
+<p>The function pgpool_pgctl executes the value of ppool.pgctl in postgresql.conf as the pg_ctl command.
+To use this function, you have to this custom parameter.</p>
+<pre>
+ex)
+$ cat >> /usr/local/pgsql/postgresql.conf
+pgpool.pg_ctl = '/usr/local/pgsql/bin/pg_ctl'
+
+$ pg_ctl reload -D /usr/local/pgsql/data
+</pre>
+
<p class="top_link"><a href="#Top">back to top</a></p>
<!-- ================================================================================ -->
@@ -4384,140 +4403,568 @@ down before a down notification packet is sent to other pgpool-IIs.
<!-- ================================================================================ -->
-<h1><a name="troubleshooting"></a>Troubleshooting</h1>
-<p>
-This section describes problems and their workarounds while you are using
-pgpool-II.
-</p>
+<h1 id="pcp_command">PCP Commands</h1>
-<dl>
+<h2>PCP commands list</h2>
+<p>PCP commands are UNIX commands which manipulate pgpool-II via the network.
-<dt id="health_check_failed">Health check failed</dt>
- <dd>
- <p>
- Pgpool-II's health checking feature detects DB nodes failure.
- </p>
+<table border>
+<tr><th><a href="#pcp_node_count">pcp_node_count</a></th>
+ <td>retrieves the number of nodes</td></tr>
+<tr><th><a href="#pcp_node_info">pcp_node_info</a></th>
+ <td>retrieves the node information</td></tr>
+<tr><th><a href="#pcp_watchdog_info">pcp_watchdog_info</a> <span class="version">V3.3 -</span></th>
+ <td>retrieves the watchdog information</td></tr>
+<tr><th><a href="#pcp_proc_count">pcp_proc_count</a></th>
+ <td>retrieves the process list</td></tr>
+<tr><th><a href="#pcp_proc_info">pcp_proc_info</a></th>
+ <td>retrieves the process information</td></tr>
+<tr><th><a href="#pcp_pool_status ">pcp_pool_status</a> <span class="version">V3.1 -</span></th>
+ <td>retrieves parameters in pgpool.conf</td></tr>
+<tr><th><a href="#pcp_systemdb_info">pcp_systemdb_info</a></th>
+ <td>retrieves the System DB information</td></tr>
+<tr><th><a href="#pcp_detach_node">pcp_detach_node</a></th>
+ <td>detaches a node from pgpool-II</td></tr>
+<tr><th><a href="#pcp_attach_node">pcp_attach_node</a></th>
+ <td>attaches a node to pgpool-II</td></tr>
+<tr><th><a href="#pcp_promote_node">pcp_promote_node</a> <span class="version">V3.1 -</span></th>
+ <td>promote a new master node to pgpool-II</td></tr>
+<tr><th><a href="#pcp_stop_pgpool">pcp_stop_pgpool</a></th>
+ <td>stops pgpool-II</td></tr>
+</table>
+
+
+<h2 id="pcp_comand_args">Common Command-line Arguments</h2>
+
+<p>There are five arguments common to all of the PCP commands. They
+give information about pgpool-II and authentication. Extra
+arguments may be needed for some commands.
<pre>
-2010-07-23 16:42:57 ERROR: pid 20031: health check failed. 1 th host foo at port 5432 is down
-2010-07-23 16:42:57 LOG: pid 20031: set 1 th backend down status
-2010-07-23 16:42:57 LOG: pid 20031: starting degeneration. shutdown host foo(5432)
-2010-07-23 16:42:58 LOG: pid 20031: failover_handler: set new master node: 0
-2010-07-23 16:42:58 LOG: pid 20031: failover done. shutdown host foo(5432)
+e.g.) $ pcp_node_count 10 localhost 9898 postgres hogehoge
</pre>
- <p>
- The log shows that the DB node 1 (host foo) goes down and disconnected (shutdown)
- from pgpool, and then that DB node 0 becomes new master.
- Check DB node 1 and remove the cause of failure. After that perform an online
- recovery against DB node 1 if possible.
- </p>
- </dd>
+<table border>
+<tr>
+<th>First argument</th>
+<td>timeout value in seconds. PCP disconnects if pgpool-II does not respond in this many seconds.</td>
+</tr>
+<tr><th>Second argument</th><td>pgpool-II's hostname</td></tr>
+<tr><th>Third argument</th><td>PCP port number</td></tr>
+<tr><th>Fourth argument</th><td>PCP user name</td></tr>
+<tr><th>Fifth argument</th><td>PCP password</td></tr>
+</table>
-<dt id="failed_to_read_kind_from_frontend">Failed to read kind from frontend</dt>
- <dd>
+<p>PCP user names and passwords must be declared in
+<code>pcp.conf</code> in <code>$prefix/etc</code>
+directory. <code>-F</code> option can be used when starting pgpool-II
+if <code>pcp.conf</code> is placed somewhere else. The password does
+not need to be in md5 format when passing it to the PCP commands.</p>
+
+
+<h2>PCP Commands to know status and configuration</h2>
+
+<p>All PCP commands display the results to the standard output.</p>
+
+
+<h3 id="pcp_node_count">pcp_node_count</h3>
+
+<dl class="flat">
+<dt>Format</dt>
+<dd>
+<code>pcp_node_count _timeout_ _host_ _port_ _userid_ _passwd_</code>
+</dd>
+<dt>Desc.</dt>
+<dd>
+Displays the total number of nodes defined in <code>pgpool.conf</code>. It does
+not distinguish between nodes status, ie attached/detached. ALL nodes are counted.
+</dd>
+</dl>
+
+<h3><a name="pcp_node_info"/></a>pcp_node_info</h3>
+
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_node_info _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>Desc.</dt>
+<dd>
+<p>Displays the information on the given node ID. Here is an output example:</p>
<pre>
-2010-07-26 18:43:24 LOG: pid 24161: ProcessFrontendResponse: failed to read kind from frontend. frontend abnormally exited
+$ pcp_node_info 10 localhost 9898 postgres hogehoge 0
+host1 5432 1 1073741823.500000
</pre>
- <p>
- This log indicates that the frontend program didn't disconnect properly from
- pgpool-II.
- The possible causes are: bugs of client applications, forced termination (kill)
- of a client application, or temporary network failure.
- This kind of events don't lead to a DB destruction or data consistency problem.
- It's only a warning about a protocol violation.
- It is advised that you check the applications and networks if the
- message keeps on occurring.
- </p>
- </dd>
-<dt id="kind_mismatch">Kind mismatch errors</dt>
- <dd>
- <p>
- It is possible that you get this error when pgpool-II operates in replication mode.
- </p>
+<p>The result is in the following order:</p>
+<ul>
+<li>1. hostname</li>
+<li>2. port number</li>
+<li>3. status</li>
+<li>4. load balance weight</li>
+</ul>
+
+<p>Status is represented by a digit from [0 to 3].</p>
+<ul>
+<li>0 - This state is only used during the initialization. PCP will never display it.</li>
+<li>1 - Node is up. No connections yet.</li>
+<li>2 - Node is up. Connections are pooled.</li>
+<li>3 - Node is down.</li>
+</ul>
+<p>The load balance weight is displayed in normalized format.</p>
+
+<p>The <code>--verbose</code> option can help understand the output. For example:</p>
+
<pre>
-2010-07-22 14:18:32 ERROR: pid 9966: kind mismatch among backends. Possible last query was: "FETCH ALL FROM c;" kind details are: 0[T] 1[E: cursor "c" does not exist]
+$ pcp_node_info --verbose 10 localhost 9898 postgres hogehoge 0
+Hostname: host1
+Port : 5432
+Status : 1
+Weight : 0.5
</pre>
- <p>
- Pgpool-II waits for responses from the DB nodes after sending an SQL command to them.
- This message indicates that not all DB nodes returned the same kind of response.
- You'll get the SQL statement which possibly caused the error after "Possible last query was:".
- Then the kind of response follows. If the response indicates an error, the
- error message from PostgreSQL is shown.
- Here you see "0[T]" displaying the DB node responses: "0[T]"
- (starting to send row description), and "1[E" indicates that DB node 1 returns an error
- with message "cursor "c" does not exist", while DB node 0 sends a row description.
- </p>
- <p>
- Caution: You will see this error when operating in master/slave mode as well.
- For example, even in the master/slave mode, SET command will be basically sent to all DB nodes
- to keep all the DB nodes in the same state.
- </p>
- <p>
- Check the databases and re-sync them using online recovery if you find
- that they are out of sync.
- </p>
- </dd>
-<dt id="difference_of_number">Pgpool detected difference of the number of inserted, updated or deleted tuples
- <dd>
- <p>
- In replication mode, pgpool-II detects a different number of
- INSERT/UPDATE/DELETE rows on affected nodes.
- </p>
+<p>Specifying an invalid node ID will result in an error with <a href="#exit_status">exit status 12</a>,
+and BackendError will be displayed.</p>
+</dd>
+</dl>
+
+<h3><a name="pcp_watchdog_info"/></a>pcp_watchdog_info <span class="version">V3.3 -</span></h3>
+
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_watchdog_info _timeout_ _host_ _port_ _userid_ _passwd_ [_watchdogid_]</code></dd>
+<dt>Desc.</dt>
+<p>Displays the watchdog status of the pgpool-II.
+_watchdogid_ is the index of other_pgpool_hostname parameter in pgpool.conf.</p>
+<p>If this is omitted, display the watchdog status of the pgpool-II specified by _host_:_port_.</p>
+
+<p>Here is an output example:</p>
+
<pre>
-2010-07-22 11:49:28 ERROR: pid 30710: pgpool detected difference of the number of inserted, updated or deleted tuples. Possible last query was: "update t1 set i = 1;"
-2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Degenerate backends: 1
-2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Affected tuples are: 0 1
+$ pcp_watchdog_info 10 localhost 9898 postgres hogehoge 0
+host1 9999 9000 2
+Here is an output example:
</pre>
- <p>
- In the example above, the returned number of updated rows by "update t1 set i = 1"
- was different among DB nodes.
- The next line indicates that DB 1 got degenerated (disconnected) as a consequence,
- and that the number of affected rows for DB node 0 was 0,
- while for DB node 1 that was 1.
- </p>
- <p>
- Stop the DB node which is suspected of having wrong data and do an online recovery.
- </p>
- </dd>
-</dl>
-<p class="top_link"><a href="#Top">back to top</a></p>
+<p>The result is in the following order:</p>
+<ul>
+<li>1. hostname</li>
+<li>2. port number for pgpool-II</li>
+<li>3. port number for watchdog</li>
+<li>4. watchdog Status</li>
+</ul>
+<p>Status is represented by a digit from [1 to 4].</p>
+<ul>
+<li>1 - watchdog is not started</li>
+<li>2 - Standby: not holding the virtual IP</li>
+<li>3 - Active: holding the virtual IP</li>
+<li>4 - Down</li>
+</ul>
+<p>The load balance weight is displayed in normalized format.</p>
-<!-- ================================================================================ -->
+<p>Specifying an invalid watchdog ID will result in an error with <a href="#exit_status">exit tatus 12</a>,
+and BackendError will be displayed.</p>
+</dl>
-<h1>Restrictions<a name="restriction"></a></h1>
+<h3 id="pcp_proc_count">pcp_proc_count</h3>
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_proc_count _timeout_ _host_ _port_ _userid_ _passwd_</code></dd>
+<dt>Desc.</dt>
+<dd>
+Displays the list of pgpool-II children process IDs. If there is more than
+one process, IDs will be delimited by a white space.
+</dd>
+</dl>
+
+<h3 id="pcp_proc_info">pcp_proc_info</h3>
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_proc_info _timeout_ _host_ _port_ _userid_ _passwd_ _processid_</code></dd>
+<dt>Desc.</dt>
<p>
-<h2>Functionality of PostgreSQL</h2>
-<p>
+Displays the information on the given pgpool-II child process ID. The
+output example is as follows:
+</p>
+<pre>
+$ pcp_proc_info 10 localhost 9898 postgres hogehoge 3815
+postgres_db postgres 1150769932 1150767351 3 0 1 1467 1
+postgres_db postgres 1150769932 1150767351 3 0 1 1468 1
+</pre>
+
+<p>The result is in the following order:</p>
<ul>
-<li>If you use pg_terminate_backend() to stop a backend, this will trigger
- a failover.
- The reason why this happens is that PostgreSQL sends exactly the same
- message for a terminated backend as for a full postmaster shutdown.
- There is no workaround as of today. Please do not use this function.
-</li>
+<li>1. connected database name</li>
+<li>2. connected user name</li>
+<li>3. process start-up timestamp</li>
+<li>4. connection created timestamp</li>
+<li>5. protocol major version</li>
+<li>6. protocol minor version</li>
+<li>7. connection-reuse counter</li>
+<li>8. PostgreSQL backend process id</li>
+<li>9. 1 if frontend conncted 0 if not</li>
</ul>
<p>
-<h2><a name="md5"></a>Authentication / Access Controls</h2>
+If there is no connection to the backends, nothing will be
+displayed. If there are multiple connections, one connection's
+information will be displayed on each line multiple
+times. Timestamps are displayed in EPOCH format.
+</p>
<p>
-<ul>
- <li>In the replication mode or master/slave mode, trust, clear text password,
- and pam methods are supported. md5 in also supported since pgpool-II 3.0.
- md5 is supported by using a authencitaion file ("pool_passwd").
- "pool_passwd" is default name of the authentication file.
- You can change the file name using <a href="#POOL_PASSWD">pool_passwd</a>.
- Here are the steps to enable md5 authentication:
- <ol>
- <li>Login as the database's operating system user and type
- "pg_md5 --md5auth --username=<your_username> <your_passwd>"
- user name and md5 encrypted password are registered into pool_passwd.
+The </code>--verbose</code> option can help understand the output. For example:
+</p>
+
+<pre>
+$ pcp_proc_info --verbose 10 localhost 9898 postgres hogehoge 3815
+Database : postgres_db
+Username : postgres
+Start time : 1150769932
+Creation time: 1150767351
+Major : 3
+Minor : 0
+Counter : 1
+PID : 1467
+Connected : 1
+Database : postgres_db
+Username : postgres
+Start time : 1150769932
+Creation time: 1150767351
+Major : 3
+Minor : 0
+Counter : 1
+PID : 1468
+Connected : 1
+</pre>
+
+<p>Specifying an invalid node ID will result in an error with <a href="#exit_status">exit status 12</a>,
+and BackendError will be displayed.</p>
+</dl>
+
+<h3 id="pcp_pool_status">pcp_pool_status <span class="version">V3.1 -</span></h3>
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_pool_status _timeout_ _host_ _port_ _userid_ _passwd_</code></dd>
+<dt>Desc.</dt>
+<dd>
+<p>Displays parameters in pgpool.conf. The output example is as follows:</p>
+<pre>
+$ pcp_pool_status 10 localhost 9898 postgres hogehoge
+name : listen_addresses
+value: localhost
+desc : host name(s) or IP address(es) to listen to
+
+name : port
+value: 9999
+desc : pgpool accepting port number
+
+name : socket_dir
+value: /tmp
+desc : pgpool socket directory
+
+name : pcp_port
+value: 9898
+desc : PCP port # to bind
+</pre>
+</dd>
+</dl>
+
+<h3 id="pcp_systemdb_info">pcp_systemdb_info</h3>
+
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_systemdb_info _timeout_ _host_ _port_ _userid_ _passwd_</code></dd>
+<dt>Desc.</dt>
+<dd>
+<p>Displays the System DB information. The output example is as follows:</p>
+<pre>
+$ pcp_systemdb_info 10 localhost 9898 postgres hogehoge
+localhost 5432 yamaguti '' pgpool_catalog pgpool 3
+yamaguti public accounts aid 4 aid bid abalance filler integer integer integer character(84) dist_def_accounts
+yamaguti public branches bid 3 bid bbalance filler integer integer character(84) dist_def_branches
+yamaguti public tellers bid 4 tid bid tbalance filler integer integer integer character(84) dist_def_tellers
+</pre>
+
+<p>First, the System DB information will be displayed on the first line.
+The result is in the following order:</p>
+<ul>
+<li>1. hostname</li>
+<li>2. port number</li>
+<li>3. user name</li>
+<li>4. password. '' for no password.</li>
+<li>5. schema name</li>
+<li>6. database name</li>
+<li>7. number of partioning rules defined</li>
+</ul>
+
+<p>
+Second, partitioning rules will be displayed on the following lines. If
+there are multiple definitions, one definition will be displayed on
+each line multiple times. The result is in the following order:
+</p>
+<ul>
+<li>1. targeted partitioning database name</li>
+<li>2. targeted partitioning schema name</li>
+<li>3. targeted partitioning table name</li>
+<li>4. partitioning key column name</li>
+<li>5. number of columns in the targeted table</li>
+<li>6. column names (displayed as many as said in 5.)</li>
+<li>7. column types (displayed as many as said in 5.)</li>
+<li>8. partitioning rule function name</li>
+</ul>
+<p>
+If the System DB is not defined (i.e. not in pgpool-II mode, and query
+cache is disabled), it results in error with <a href="#exit_status">exit status 12</a>, and
+BackendError will be displayed.</p>
+
+</dd>
+</dl>
+
+<h2>PCP Commands to control backend nodes, etc.</h2>
+
+<h3 id="pcp_detach_node">pcp_detach_node</h3>
+
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_detach_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>Desc.</dt>
+<dd>
+<p>
+Detaches the given node from pgpool-II.
+If -g is given, wait until all clients are disconnected (unless
+client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
+</p>
+</dd>
+</dl>
+
+
+<h3 id="pcp_attach_node">pcp_attach_node</h3>
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_attach_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>Desc.</dt>
+<dd><p>Attaches the given node to pgpool-II.</p></dd>
+</dl>
+
+<h3 id="pcp_promote_node">pcp_promote_node <span class="version">V3.1 -</span></h3>
+
+<dl class="flat">
+<dt>Format</dt>
+<dd><code>pcp_promote_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>Desc.</dt>
+<dd>
+<p>
+Promotes the given node as new master to pgpool-II. In master/slave streaming replication only.
+If -g is given, wait until all clients are disconnected (unless
+client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
+</p>
+</dd>
+</dl>
+
+<h3 id="pcp_stop_pgpool">pcp_stop_pgpool</h3>
+<dl class="flat">
+<dt>Format:</dt>
+<dd><code>pcp_stop_pgpool _timeout_ _host_ _port_ _userid_ _passwd_ _mode_</code></dd>
+<dt>Desc.</dt>
+<dd>
+<p>Terminate the pgpool-II process with the given shutdown mode. The available modes are as follows:</p>
+<ul>
+<li>s - smart mode</li>
+<li>f - fast mode</li>
+<li>i - immediate mode</li>
+</ul>
+<p>
+If the pgpool-II process does not exist, it results in error with <a href="#exit_status">exit status 8</a>,
+and ConnectionError will be displayed.
+</p>
+<p>
+* Currently, there is no difference between the fast and immediate
+mode. pgpool-II terminates all the processes whether there are clients
+connected to the backends or not.</p>
+</dd>
+</dl>
+
+<h3 id="pcp_recovery_node">pcp_recovery_node</h3>
+<dl class="flat">
+<dt>Formet</dt>
+<dd><code>pcp_recovery_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>Desc.</dt>
+<dd>Attaches the given backend node with recovery.</dd>
+</dl>
+
+<h2 id="exit_status">Exit Status</h2>
+
+<p>PCP commands exits with status 0 when everything goes well. If any
+error had occurred, it will exit with the following error status.
+
+<table border>
+<tr><th>UNKNOWNERR</th>
+ <td>1</td><td>Unknown Error (should not occur)</td></tr>
+<tr><th>EOFERR</th>
+ <td>2</td><td>EOF Error</td></tr>
+<tr><th>NOMEMERR</th>
+ <td>3</td><td>Memory shortage</td></tr>
+<tr><th>READERR</th>
+ <td>4</td><td>Error while reading from the server</td></tr>
+<tr><th>WRITEERR</th>
+ <td>5</td><td>Error while writing to the server</td></tr>
+<tr><th>TIMEOUTERR</th>
+ <td>6</td><td>Timeout</td></tr>
+<tr><th>INVALERR</th>
+ <td>7</td><td>Argument(s) to the PCP command was invalid</td></tr>
+<tr><th>CONNERR</th>
+ <td>8</td><td>Server connection error</td></tr>
+<tr><th>NOCONNERR</th>
+ <td>9</td><td>No connection exists</td></tr>
+<tr><th>SOCKERR</th>
+ <td>10</td><td>Socket error</td></tr>
+<tr><th>HOSTERR</th>
+ <td>11</td><td>Hostname resolution error</td></tr>
+<tr><th>BACKENDERR</th>
+ <td>12</td><td>PCP process error on the server (specifying an invalid ID, etc.)</td></tr>
+<tr><th>AUTHERR</th>
+ <td>13</td><td>Authorization failure</td></tr>
+</table>
+
+<p class="top_link"><a href="#Top">back to top</a></p>
+
+<!-- ================================================================================ -->
+
+<h1><a name="troubleshooting"></a>Troubleshooting</h1>
+<p>
+This section describes problems and their workarounds while you are using
+pgpool-II.
+</p>
+
+<dl>
+
+<dt id="health_check_failed">Health check failed</dt>
+ <dd>
+ <p>
+ Pgpool-II's health checking feature detects DB nodes failure.
+ </p>
+
+<pre>
+2010-07-23 16:42:57 ERROR: pid 20031: health check failed. 1 th host foo at port 5432 is down
+2010-07-23 16:42:57 LOG: pid 20031: set 1 th backend down status
+2010-07-23 16:42:57 LOG: pid 20031: starting degeneration. shutdown host foo(5432)
+2010-07-23 16:42:58 LOG: pid 20031: failover_handler: set new master node: 0
+2010-07-23 16:42:58 LOG: pid 20031: failover done. shutdown host foo(5432)
+</pre>
+
+ <p>
+ The log shows that the DB node 1 (host foo) goes down and disconnected (shutdown)
+ from pgpool, and then that DB node 0 becomes new master.
+ Check DB node 1 and remove the cause of failure. After that perform an online
+ recovery against DB node 1 if possible.
+ </p>
+ </dd>
+
+<dt id="failed_to_read_kind_from_frontend">Failed to read kind from frontend</dt>
+ <dd>
+<pre>
+2010-07-26 18:43:24 LOG: pid 24161: ProcessFrontendResponse: failed to read kind from frontend. frontend abnormally exited
+</pre>
+ <p>
+ This log indicates that the frontend program didn't disconnect properly from
+ pgpool-II.
+ The possible causes are: bugs of client applications, forced termination (kill)
+ of a client application, or temporary network failure.
+ This kind of events don't lead to a DB destruction or data consistency problem.
+ It's only a warning about a protocol violation.
+ It is advised that you check the applications and networks if the
+ message keeps on occurring.
+ </p>
+ </dd>
+
+<dt id="kind_mismatch">Kind mismatch errors</dt>
+ <dd>
+ <p>
+ It is possible that you get this error when pgpool-II operates in replication mode.
+ </p>
+<pre>
+2010-07-22 14:18:32 ERROR: pid 9966: kind mismatch among backends. Possible last query was: "FETCH ALL FROM c;" kind details are: 0[T] 1[E: cursor "c" does not exist]
+</pre>
+ <p>
+ Pgpool-II waits for responses from the DB nodes after sending an SQL command to them.
+ This message indicates that not all DB nodes returned the same kind of response.
+ You'll get the SQL statement which possibly caused the error after "Possible last query was:".
+ Then the kind of response follows. If the response indicates an error, the
+ error message from PostgreSQL is shown.
+ Here you see "0[T]" displaying the DB node responses: "0[T]"
+ (starting to send row description), and "1[E" indicates that DB node 1 returns an error
+ with message "cursor "c" does not exist", while DB node 0 sends a row description.
+ </p>
+ <p>
+ Caution: You will see this error when operating in master/slave mode as well.
+ For example, even in the master/slave mode, SET command will be basically sent to all DB nodes
+ to keep all the DB nodes in the same state.
+ </p>
+ <p>
+ Check the databases and re-sync them using online recovery if you find
+ that they are out of sync.
+ </p>
+ </dd>
+
+<dt id="difference_of_number">Pgpool detected difference of the number of inserted, updated or deleted tuples
+ <dd>
+ <p>
+ In replication mode, pgpool-II detects a different number of
+ INSERT/UPDATE/DELETE rows on affected nodes.
+ </p>
+<pre>
+2010-07-22 11:49:28 ERROR: pid 30710: pgpool detected difference of the number of inserted, updated or deleted tuples. Possible last query was: "update t1 set i = 1;"
+2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Degenerate backends: 1
+2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Affected tuples are: 0 1
+</pre>
+ <p>
+ In the example above, the returned number of updated rows by "update t1 set i = 1"
+ was different among DB nodes.
+ The next line indicates that DB 1 got degenerated (disconnected) as a consequence,
+ and that the number of affected rows for DB node 0 was 0,
+ while for DB node 1 that was 1.
+ </p>
+ <p>
+ Stop the DB node which is suspected of having wrong data and do an online recovery.
+ </p>
+ </dd>
+</dl>
+
+<p class="top_link"><a href="#Top">back to top</a></p>
+
+
+<!-- ================================================================================ -->
+
+<h1>Restrictions<a name="restriction"></a></h1>
+
+<p>
+<h2>Functionality of PostgreSQL</h2>
+<p>
+<ul>
+<li>If you use pg_terminate_backend() to stop a backend, this will trigger
+ a failover.
+ The reason why this happens is that PostgreSQL sends exactly the same
+ message for a terminated backend as for a full postmaster shutdown.
+ There is no workaround as of today. Please do not use this function.
+</li>
+</ul>
+
+<p>
+<h2><a name="md5"></a>Authentication / Access Controls</h2>
+
+<p>
+<ul>
+ <li>In the replication mode or master/slave mode, trust, clear text password,
+ and pam methods are supported. md5 in also supported since pgpool-II 3.0.
+ md5 is supported by using a authencitaion file ("pool_passwd").
+ "pool_passwd" is default name of the authentication file.
+ You can change the file name using <a href="#POOL_PASSWD">pool_passwd</a>.
+ Here are the steps to enable md5 authentication:
+ <ol>
+ <li>Login as the database's operating system user and type
+ "pg_md5 --md5auth --username=<your_username> <your_passwd>"
+ user name and md5 encrypted password are registered into pool_passwd.
If pool_passwd does not exist yet, pg_md5 command will
automatically create it for you.</li>
<li>The format of pool_passwd is "username:encrypted_passwd".</li>
@@ -4732,571 +5179,159 @@ SELECT * FROM t ORDER BY a; <-- INSERT above is not visible from this SELECT
END;
</pre>
-<h3 id="ng_view">Views / Rules (for parallel mode)</h3>
-
-<p>
-The same definition will be created on all the backends for views and rules.
-</p>
-
-<pre>
-SELECT * FROM a, b where a.i = b.i
-</pre>
-<p>
-<code>JOIN</code>s like above will be executed on each backend, and
-then merged with the results returned by each backend. Views and Rules
-that join across the nodes cannot be created.
-However, to JOIN tables that access data only in the same node, a VIEW can be made.
-This VIEW has to be registered in the pgpool_catalog.dist_def table. A col_name and
-a dist_def_func will have to be registered too. These are used when an insert is
-performed on the view.
-</p>
-
-<h3 id="ng_fuction">Functions / Triggers (for parallel mode)</h3>
-
-<p>The same definition will be created on all the backends for
-functions. Joining across the nodes, and accessing data on the other nodes cannot
-be performed inside the functions.</p>
-
-<h3>Extended Query Protocol (for parallel mode)</h3>
-
-<p>The extended query protocol used by JDBC drivers, etc. is not
-supported. The simple query protocol must be used. This means you cannot use
-prepared statements.</p>
-
-<h3 id="ng_natural_join">Natural Join (for parallel mode)</h3>
-
-<p>The Natural Join is not supported.
-"ON join condition" or "USING (join_column)" must be used.</p>
-
-<h3 id="ng_extended_protocol">USING CLAUSE (for parallel mode)</h3>
-
-<p>The USING CLAUSE is converted to an ON CLAUSE by the query rewrite process.
-Therefore, when "*" is used at target list, the joined column(s) appear twice.</p>
-<p>
-Here is an example:
-</p>
-<pre>
-=# SELECT * FROM t1 JOIN t2 USING(id);
- id | t | t
-----+-----+-------
- 1 | 1st | first
-(1 row)
-</pre>
-<p>
-In the rewrite process "USING" is translated into "ON". So the
-effective result is as follows:
-</p>
-<pre>
-=# SELECT * FROM t1 JOIN t2 ON t1.id = t2.id;
- id | t | id | t
-----+-----+----+-------
- 1 | 1st | 1 | first
-(1 row)
-</pre>
-
-<p>
-Notice that column "t" is duplicated.
-</p>
-
-<h3 id="ng_multibyte_chars">Multi-byte Characters (for all modes)</h3>
-
-<p>pgpool-II does not translate between different multi-byte
-characters. The encoding for the client, backend and System DB must be
-the same.</p>
-
-<h3 id="ng_multi_statement">Multi-statement Query (for all modes)</h3>
-<p>
-pgpool-II cannot process multi-statement queries.
-</p>
-
-<h3 id="ng_dead_lock">Deadlocks (for parallel mode)</h3>
-
-<p>Deadlocks across the backends cannot be detected. For example:
-</p>
-<pre>
-(tellers table is partitioned using the following rule)
- tid <= 10 --> node 0
- tid >= 10 --> node 1
-
-A) BEGIN;
-B) BEGIN;
-A) SELECT * FROM tellers WHERE tid = 11 FOR UPDATE;
-B) SELECT * FROM tellers WHERE tid = 1 FOR UPDATE;
-A) SELECT * FROM tellers WHERE tid = 1 FOR UPDATE;
-B) SELECT * FROM tellers WHERE tid = 11 FOR UPDATE;
-</pre>
-<p>
-In the case above, a single node cannot detect the deadlock, so
-pgpool-II will wait for the response indefinitely. This phenomenon
-can occur with any query that acquires row level locks.
-</p>
-<p>Also, if a deadlock occurs in one node, transaction states in each
-node will not be consistent. Therefore, pgpool-II terminates the
-process if a deadlock is detected.
-</p>
-<pre>
-pool_read_kind: kind does not match between master(84) slot[1] (69)
-</pre>
-
-<h3 id="ng_schema">Schemas (for parallel mode)</h3>
-
-<p>Objects in a schema other than public must be fully qualified like:
-</p>
-<pre>
-schema.object
-</pre>
-<p>
-pgpool-II cannot resolve the correct schema when the path is set as
-follows:
-</p>
-<pre>
-set search_path = xxx
-</pre>
-<p>
-and the schema name is omitted in a query.
-</p>
-
-<h3 id="ng_relname">table name - column name(for parallel mode)</h3>
-<p>
-Limitation object:Parallel mode
-</p>
-<p>
-A table or a column name cannot start by pool_.
-When rewriting queries, these names are used by internal processing.
-</p>
-
-<h2 id="caution_system_db">System DB</h2>
-
-<h3>Partitioning Rules</h3>
-
-<p>Only one partitioning key column can be defined in one
-partitioning rule. Conditions like 'x or y' are not supported.</p>
-
-<h2>Environment Requirements</h2>
-
-<h3>libpq</h3>
-
-<p><code>libpq</code> is linked while building pgpool-II. libpq
-version must be 3.0. Building pgpool-II with libpq version 2.0 will
-fail. Also, the System DB must be PostgreSQL 7.4 or later.</p>
-
-<h2 id="caution_query_cache">Query Cache</h2>
-
-<p>With <a href="#query_cache">on disk query cache, invalidation must be done manually.
-This does not apply to <a href="#memqcache">on memory query cache</a>. Cache invalidation is automatically done with on memory query cache.</p>
-
-<h2>Compatibility with pgpool</h2>
-
-<p class="top_link"><a href="#Top">back to top</a></p>
-
-<!-- ================================================================================ -->
-
-<h1>References<a name="reference"></a></h1>
-<h2>PCP Command Reference</h2>
-
-<h3 id="pcp_command">PCP Command List</h3>
-
-<p>PCP commands are UNIX commands which manipulate pgpool-II via the network.
-
-<table border>
-<tr><th><a href="#pcp_node_count">pcp_node_count</a></th>
- <td>retrieves the number of nodes</td></tr>
-<tr><th><a href="#pcp_node_info">pcp_node_info</a></th>
- <td>retrieves the node information</td></tr>
-<tr><th><a href="#pcp_watchdog_info">pcp_watchdog_info</a></th>
- <td>retrieves the watchdog information</td></tr>
-<tr><th><a href="#pcp_proc_count">pcp_proc_count</a></th>
- <td>retrieves the process list</td></tr>
-<tr><th><a href="#pcp_proc_info">pcp_proc_info</a></th>
- <td>retrieves the process information</td></tr>
-<tr><th><a href="#pcp_pool_status ">pcp_pool_status</a> <span class="version">V3.1 -</span></th>
- <td>retrieves parameters in pgpool.conf</td></tr>
-<tr><th><a href="#pcp_systemdb_info">pcp_systemdb_info</a></th>
- <td>retrieves the System DB information</td></tr>
-<tr><th><a href="#pcp_detach_node">pcp_detach_node</a></th>
- <td>detaches a node from pgpool-II</td></tr>
-<tr><th><a href="#pcp_attach_node">pcp_attach_node</a></th>
- <td>attaches a node to pgpool-II</td></tr>
-<tr><th><a href="#pcp_promote_node">pcp_promote_node</a> <span class="version">V3.1 -</span></th>
- <td>promote a new master node to pgpool-II</td></tr>
-<tr><th><a href="#pcp_stop_pgpool">pcp_stop_pgpool</a></th>
- <td>stops pgpool-II</td></tr>
-</table>
-
-
-<h2 id="pcp_comand_args">Common Command-line Arguments</h2>
-
-<p>There are five arguments common to all of the PCP commands. They
-give information about pgpool-II and authentication. Extra
-arguments may be needed for some commands.
-
-<pre>
-e.g.) $ pcp_node_count 10 localhost 9898 postgres hogehoge
-
-First argument - timeout value in seconds. PCP disconnects if
- pgpool-II does not respond in this many seconds.
-Second argument - pgpool-II's hostname
-Third argument - PCP port number
-Fourth argument - PCP user name
-Fifth argument - PCP password
-</pre>
-
-<p>PCP user names and passwords must be declared in
-<code>pcp.conf</code> in <code>$prefix/etc</code>
-directory. <code>-F</code> option can be used when starting pgpool-II
-if <code>pcp.conf</code> is placed somewhere else. The password does
-not need to be in md5 format when passing it to the PCP commands.</p>
-
-
-<h2>PCP Commands</h2>
-
-<p>All PCP commands display the results to the standard output.</p>
-
-
-<h3 id="pcp_node_count">pcp_node_count</h3>
-
-<pre>
-Format:
-pcp_node_count _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
-
-<p>
-Displays the total number of nodes defined in <code>pgpool.conf</code>. It does
-not distinguish between nodes status, ie attached/detached. ALL nodes are counted.
-</p>
-
-
-<h3><a name="pcp_node_info"/></a>pcp_node_info</h3>
-
-<pre>
-Format:
-pcp_node_info _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-</pre>
+<h3 id="ng_view">Views / Rules (for parallel mode)</h3>
<p>
-Displays the information on the given node ID. Here is an output example:
+The same definition will be created on all the backends for views and rules.
</p>
<pre>
-$ pcp_node_info 10 localhost 9898 postgres hogehoge 0
-host1 5432 1 1073741823.500000
-
-The result is in the following order:
-1. hostname
-2. port number
-3. status
-4. load balance weight
-
-Status is represented by a digit from [0 to 3].
-0 - This state is only used during the initialization. PCP will never display it.
-1 - Node is up. No connections yet.
-2 - Node is up. Connections are pooled.
-3 - Node is down.
+SELECT * FROM a, b where a.i = b.i
</pre>
<p>
-The load balance weight is displayed in normalized format.
-</p>
-
-<p>
-The --verbose option can help understand the output. For example:
+<code>JOIN</code>s like above will be executed on each backend, and
+then merged with the results returned by each backend. Views and Rules
+that join across the nodes cannot be created.
+However, to JOIN tables that access data only in the same node, a VIEW can be made.
+This VIEW has to be registered in the pgpool_catalog.dist_def table. A col_name and
+a dist_def_func will have to be registered too. These are used when an insert is
+performed on the view.
</p>
-<pre>
-$ pcp_node_info --verbose 10 localhost 9898 postgres hogehoge 0
-Hostname: host1
-Port : 5432
-Status : 1
-Weight : 0.5
-</pre>
-
-<p>Specifying an invalid node ID will result in an error with exit
-status 12, and BackendError will be displayed.</p>
+<h3 id="ng_fuction">Functions / Triggers (for parallel mode)</h3>
-<h3><a name="pcp_watchdog_info"/></a>pcp_watchdog_info</h3>
+<p>The same definition will be created on all the backends for
+functions. Joining across the nodes, and accessing data on the other nodes cannot
+be performed inside the functions.</p>
-<pre>
-Format:
-pcp_watchdog_info _timeout_ _host_ _port_ _userid_ _passwd_ [_watchdogid_]
-</pre>
+<h3>Extended Query Protocol (for parallel mode)</h3>
-<p>
-Displays the watchdog status of the pgpool-II.
-_watchdogid_ is the index of other_pgpool_hostname parameter in pgpool.conf.
-If this is omitted, display the watchdog status of the pgpool-II specified by _host_:_port_.
-Here is an output example:
-</p>
+<p>The extended query protocol used by JDBC drivers, etc. is not
+supported. The simple query protocol must be used. This means you cannot use
+prepared statements.</p>
-<pre>
-$ pcp_watchdog_info 10 localhost 9898 postgres hogehoge 0
-host1 9999 9000 2
+<h3 id="ng_natural_join">Natural Join (for parallel mode)</h3>
-The result is in the following order:
-1. hostname
-2. port number for pgpool-II
-3. port number for watchdog
-4. watchdog Status
-
-Status is represented by a digit from [1 to 4].
-1 - watchdog is not started
-2 - Standby: not holding the virtual IP
-3 - Active: holding the virtual IP
-4 - Down
-</pre>
-<p>
-The load balance weight is displayed in normalized format.
-</p>
+<p>The Natural Join is not supported.
+"ON join condition" or "USING (join_column)" must be used.</p>
-<p>Specifying an invalid watchdog ID will result in an error with exit
-status 12, and BackendError will be displayed.</p>
+<h3 id="ng_extended_protocol">USING CLAUSE (for parallel mode)</h3>
-<h3 id="pcp_proc_count">pcp_proc_count</h3>
-<p>
-<pre>
-Format:
-pcp_proc_count _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
+<p>The USING CLAUSE is converted to an ON CLAUSE by the query rewrite process.
+Therefore, when "*" is used at target list, the joined column(s) appear twice.</p>
<p>
-Displays the list of pgpool-II children process IDs. If there is more than
-one process, IDs will be delimited by a white space.
+Here is an example:
</p>
-
-<h3 id="pcp_proc_info">pcp_proc_info</h3>
-<p>
<pre>
-Format:
-pcp_proc_info _timeout_ _host_ _port_ _userid_ _passwd_ _processid_
+=# SELECT * FROM t1 JOIN t2 USING(id);
+ id | t | t
+----+-----+-------
+ 1 | 1st | first
+(1 row)
</pre>
<p>
-Displays the information on the given pgpool-II child process ID. The
-output example is as follows:
+In the rewrite process "USING" is translated into "ON". So the
+effective result is as follows:
</p>
<pre>
-$ pcp_proc_info 10 localhost 9898 postgres hogehoge 3815
-postgres_db postgres 1150769932 1150767351 3 0 1 1467 1
-postgres_db postgres 1150769932 1150767351 3 0 1 1468 1
-
-The result is in the following order:
-1. connected database name
-2. connected user name
-3. process start-up timestamp
-4. connection created timestamp
-5. protocol major version
-6. protocol minor version
-7. connection-reuse counter
-8. PostgreSQL backend process id
-9. 1 if frontend conncted 0 if not
+=# SELECT * FROM t1 JOIN t2 ON t1.id = t2.id;
+ id | t | id | t
+----+-----+----+-------
+ 1 | 1st | 1 | first
+(1 row)
</pre>
-<p>
-If there is no connection to the backends, nothing will be
-displayed. If there are multiple connections, one connection's
-information will be displayed on each line multiple
-times. Timestamps are displayed in EPOCH format.
-</p>
<p>
-The --verbose option can help understand the output. For example:
+Notice that column "t" is duplicated.
</p>
-<pre>
-$ pcp_proc_info --verbose 10 localhost 9898 postgres hogehoge 3815
-Database : postgres_db
-Username : postgres
-Start time : 1150769932
-Creation time: 1150767351
-Major : 3
-Minor : 0
-Counter : 1
-PID : 1467
-Connected : 1
-Database : postgres_db
-Username : postgres
-Start time : 1150769932
-Creation time: 1150767351
-Major : 3
-Minor : 0
-Counter : 1
-PID : 1468
-Connected : 1
-</pre>
+<h3 id="ng_multibyte_chars">Multi-byte Characters (for all modes)</h3>
-<p>Specifying an invalid node ID will result in an error with exit
-status 12, and BackendError will be displayed.</p>
+<p>pgpool-II does not translate between different multi-byte
+characters. The encoding for the client, backend and System DB must be
+the same.</p>
-<h3 id="pcp_pool_status">pcp_pool_status <span class="version">V3.1 -</span></h3>
-<pre>
-Format:
-pcp_pool_status _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
+<h3 id="ng_multi_statement">Multi-statement Query (for all modes)</h3>
<p>
-Displays parameters in pgpool.conf. The output example is as follows:
+pgpool-II cannot process multi-statement queries.
</p>
-<pre>
-$ pcp_pool_status 10 localhost 9898 postgres hogehoge
-name : listen_addresses
-value: localhost
-desc : host name(s) or IP address(es) to listen to
-
-name : port
-value: 9999
-desc : pgpool accepting port number
-
-name : socket_dir
-value: /tmp
-desc : pgpool socket directory
-name : pcp_port
-value: 9898
-desc : PCP port # to bind
-</pre>
+<h3 id="ng_dead_lock">Deadlocks (for parallel mode)</h3>
-<h3 id="pcp_systemdb_info">pcp_systemdb_info</h3>
-<p>
-<pre>
-Format:
-pcp_systemdb_info _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
-<p>
-Displays the System DB information. The output example is as follows:
+<p>Deadlocks across the backends cannot be detected. For example:
</p>
<pre>
-$ pcp_systemdb_info 10 localhost 9898 postgres hogehoge
-localhost 5432 yamaguti '' pgpool_catalog pgpool 3
-yamaguti public accounts aid 4 aid bid abalance filler integer integer integer character(84) dist_def_accounts
-yamaguti public branches bid 3 bid bbalance filler integer integer character(84) dist_def_branches
-yamaguti public tellers bid 4 tid bid tbalance filler integer integer integer character(84) dist_def_tellers
+(tellers table is partitioned using the following rule)
+ tid <= 10 --> node 0
+ tid >= 10 --> node 1
-First, the System DB information will be displayed on the first
-line. The result is in the following order:
-1. hostname
-2. port number
-3. user name
-4. password. '' for no password.
-5. schema name
-6. database name
-7. number of partioning rules defined
+A) BEGIN;
+B) BEGIN;
+A) SELECT * FROM tellers WHERE tid = 11 FOR UPDATE;
+B) SELECT * FROM tellers WHERE tid = 1 FOR UPDATE;
+A) SELECT * FROM tellers WHERE tid = 1 FOR UPDATE;
+B) SELECT * FROM tellers WHERE tid = 11 FOR UPDATE;
</pre>
<p>
-Second, partitioning rules will be displayed on the following lines. If
-there are multiple definitions, one definition will be displayed on
-each line multiple times. The result is in the following order:
+In the case above, a single node cannot detect the deadlock, so
+pgpool-II will wait for the response indefinitely. This phenomenon
+can occur with any query that acquires row level locks.
+</p>
+<p>Also, if a deadlock occurs in one node, transaction states in each
+node will not be consistent. Therefore, pgpool-II terminates the
+process if a deadlock is detected.
</p>
<pre>
-1. targeted partitioning database name
-2. targeted partitioning schema name
-3. targeted partitioning table name
-4. partitioning key column name
-5. number of columns in the targeted table
-6. column names (displayed as many as said in 5.)
-7. column types (displayed as many as said in 5.)
-8. partitioning rule function name
+pool_read_kind: kind does not match between master(84) slot[1] (69)
</pre>
-<p>
-If the System DB is not defined (i.e. not in pgpool-II mode, and query
-cache is disabled), it results in error with exit status 12, and
-BackendError will be displayed.</p>
+<h3 id="ng_schema">Schemas (for parallel mode)</h3>
-<h3 id="pcp_detach_node">pcp_detach_node</h3>
-<pre>
-Format:
-pcp_detach_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-</pre>
-<p>
-Detaches the given node from pgpool-II.
-If -g is given, wait until all clients are disconnected (unless
-client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
+<p>Objects in a schema other than public must be fully qualified like:
</p>
-
-
-<h3 id="pcp_attach_node">pcp_attach_node</h3>
-<p>
<pre>
-Format:
-pcp_attach_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-
-Attaches the given node to pgpool-II.
+schema.object
</pre>
-</p>
-
-<h3 id="pcp_promote_node">pcp_promote_node <span class="version">V3.1 -</span></h3>
<p>
-<pre>
-Format:
-pcp_promote_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-
-Promotes the given node as new master to pgpool-II. In master/slave streaming replication only.
-If -g is given, wait until all clients are disconnected (unless
-client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
-</pre>
+pgpool-II cannot resolve the correct schema when the path is set as
+follows:
</p>
-
-<h3 id="pcp_stop_pgpool">pcp_stop_pgpool</h3>
<pre>
-Format:
-pcp_stop_pgpool _timeout_ _host_ _port_ _userid_ _passwd_ _mode_
+set search_path = xxx
</pre>
-
<p>
-Terminate the pgpool-II process with the given shutdown mode. The available
-modes are as follows:
+and the schema name is omitted in a query.
</p>
-<pre>
-s - smart mode
-f - fast mode
-i - immediate mode
-</pre>
+<h3 id="ng_relname">table name - column name(for parallel mode)</h3>
<p>
-If the pgpool-II process does not exist, it results in error with exit
-status 8, and ConnectionError will be displayed.
+Limitation object:Parallel mode
</p>
<p>
-* Currently, there is no difference between the fast and immediate
-mode. pgpool-II terminates all the processes whether there are clients
-connected to the backends or not.</p>
+A table or a column name cannot start by pool_.
+When rewriting queries, these names are used by internal processing.
+</p>
-<h3 id="pcp_recovery_node">pcp_recovery_node</h3>
+<h2 id="caution_system_db">System DB</h2>
-<pre>
-æžåŒïŒ
-pcp_recovery_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
+<h3>Partitioning Rules</h3>
-Attaches the given backend node with recovery.
-</pre>
+<p>Only one partitioning key column can be defined in one
+partitioning rule. Conditions like 'x or y' are not supported.</p>
-<h2 id="exit_status">Exit Status</h2>
+<h2>Environment Requirements</h2>
-<p>PCP commands exits with status 0 when everything goes well. If any
-error had occurred, it will exit with the following error status.
+<h3>libpq</h3>
+
+<p><code>libpq</code> is linked while building pgpool-II. libpq
+version must be 3.0. Building pgpool-II with libpq version 2.0 will
+fail. Also, the System DB must be PostgreSQL 7.4 or later.</p>
+
+<h2 id="caution_query_cache">Query Cache</h2>
+
+<p>With <a href="#query_cache">on disk query cache, invalidation must be done manually.
+This does not apply to <a href="#memqcache">on memory query cache</a>. Cache invalidation is automatically done with on memory query cache.</p>
-<table border>
-<tr><th>UNKNOWNERR</th>
- <td>1</td><td>Unknown Error (should not occur)</td></tr>
-<tr><th>EOFERR</th>
- <td>2</td><td>EOF Error</td></tr>
-<tr><th>NOMEMERR</th>
- <td>3</td><td>Memory shortage</td></tr>
-<tr><th>READERR</th>
- <td>4</td><td>Error while reading from the server</td></tr>
-<tr><th>WRITEERR</th>
- <td>5</td><td>Error while writing to the server</td></tr>
-<tr><th>TIMEOUTERR</th>
- <td>6</td><td>Timeout</td></tr>
-<tr><th>INVALERR</th>
- <td>7</td><td>Argument(s) to the PCP command was invalid</td></tr>
-<tr><th>CONNERR</th>
- <td>8</td><td>Server connection error</td></tr>
-<tr><th>NOCONNERR</th>
- <td>9</td><td>No connection exists</td></tr>
-<tr><th>SOCKERR</th>
- <td>10</td><td>Socket error</td></tr>
-<tr><th>HOSTERR</th>
- <td>11</td><td>Hostname resolution error</td></tr>
-<tr><th>BACKENDERR</th>
- <td>12</td><td>PCP process error on the server (specifying an invalid ID, etc.)</td></tr>
-<tr><th>AUTHERR</th>
- <td>13</td><td>Authorization failure</td></tr>
-</table>
<p class="top_link"><a href="#Top">back to top</a></p>
diff --git a/doc/pgpool-ja.html b/doc/pgpool-ja.html
index fcf6f9ba9..c26d288e5 100644
--- a/doc/pgpool-ja.html
+++ b/doc/pgpool-ja.html
@@ -38,9 +38,9 @@ Last modified: Tue Jul 23 08:08:30 JST 2013
<li><a href="#backup">ããã¯ã¢ãã</a></li>
<li><a href="#deploy">pgpool-IIã®é
眮ã«ã€ããŠ</a></li>
<li><a href="#watchdog">watchdog</a></li>
+ <li><a href="#pcp_command">PCP ã³ãã³ã</a></li>
<li><a href="#troubleshooting">ãã©ãã«ã·ã¥ãŒãã£ã³ã°</a></li>
<li><a href="#restriction">å¶éäºé
</a></li>
- <li><a href="#reference">ãªãã¡ã¬ã³ã¹</a></li>
<li><a href="#internal">å
éšæ
å ±</a></li>
<li><a href="#release">ãªãªãŒã¹ããŒã</a></li>
</ul>
@@ -131,9 +131,9 @@ pgpool-IIã®æ©èœãå©çšã§ããŸãã
<h1>License<a name="license"></a></h1>
+<p>Copyright (c) 2003-2013 PgPool Global Development Group</p>
+<p><br></p>
<p>
-Copyright (c) 2003-2013 PgPool Global Development Group
-
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
@@ -150,7 +150,7 @@ is" without express or implied warranty.
<!-- ================================================================================ -->
-<h1>pgpool-IIã®çšŒåç°å¢<a name="platform"></a></h1>
+<h1>pgpool-II ã®çšŒåç°å¢<a name="platform"></a></h1>
<p>
pgpool-IIã¯ãLinuxãã¯ãããSolarisãFreeBSDãªã©ã®ã»ãšãã©ã®UNIXç°å¢ã§åäœããŸããWindowsã§ã¯åããŸããã
</p>
@@ -171,24 +171,24 @@ PostgreSQLã®ãã€ããŒããŒãžã§ã³ãéãå Žåã¯å€§æµã®å Žååé¡
<!-- ================================================================================ -->
-<h1>pgpool-IIã®ã€ã³ã¹ããŒã«<a name="install"></a></h1>
+<h1>pgpool-II ã®ã€ã³ã¹ããŒã«<a name="install"></a></h1>
<p>
-Linuxçšã®RPMããã±ãŒãžã¯ãCentOSãRedHat Enterprise LinuxãFedoraãDebiançšãªã©ãæäŸãããŠããŸãã
+Linux çšã® RPM ããã±ãŒãžã¯ãCentOSãRedHat Enterprise LinuxãFedoraãDebian çšãªã©ãæäŸãããŠããŸãã
該åœãªããžããªããã§ãã¯ããŠã¿ãŠãã ããã
</p>
<p>
-pgpool-II ã®ãœãŒã¹ã³ãŒãã¯<a href="http://pgpool.net/mediawiki/index.php/Downloads">pgpooléçºããŒãž</a> ãã
+pgpool-II ã®ãœãŒã¹ã³ãŒã㯠<a href="http://pgpool.net/mediawiki/index.php/Downloads">pgpool éçºããŒãž</a> ãã
ããŠã³ããŒãã§ããŸãã
</p>
-<p>
-pgpool-IIã®ãœãŒã¹ã³ãŒãããã®ã€ã³ã¹ããŒã«ã«ã¯ãgcc 2.9以äžãããã³GNU makeãå¿
èŠã§ãã
-ãŸããpgpool-IIã¯libpq(PostgreSQLä»å±ã®ã¯ã©ã€ã¢ã³ãã©ã€ãã©ãª)ã䜿çšããã®ã§ã
-ãã«ããè¡ããã·ã³äžã«libpqãã€ã³ã¹ããŒã«ãããŠããããšãå¿
èŠã§ãã
-ãŸããOpenSSLãµããŒããæå¹ã«ããå Žåã¯ãOpenSSLã©ã€ãã©ãªãšéçºçšã®ããããŒãã¡ã€ã«ãå¿
èŠã§ãã
-</p>
+<p>pgpool-II ã®ãœãŒã¹ã³ãŒãããã®ã€ã³ã¹ããŒã«ã«ã¯ãgcc 2.9 以äžãããã³ GNU make ãå¿
èŠã§ãã
+ãŸããpgpool-II 㯠libpqïŒPostgreSQL ä»å±ã®ã¯ã©ã€ã¢ã³ãã©ã€ãã©ãªïŒã䜿çšããã®ã§ã
+ãã«ããè¡ããã·ã³äžã« libpq ãã€ã³ã¹ããŒã«ãããŠããããšãå¿
èŠã§ãã</p>
+<p>ãŸããOpenSSL ãµããŒããæå¹ã«ããå Žåã¯ãOpenSSL ã©ã€ãã©ãªãšéçºçšã®ããããŒãã¡ã€ã«ãå¿
èŠã§ãã</p>
+
+<h2 id="install_pgpool">pgpool-II ã®ã€ã³ã¹ããŒã«</h2>
<dl>
<dt>configureã®å®è¡</dt>
@@ -243,80 +243,113 @@ make
make install
</pre>
</dd>
+</dl>
-<dt>pgpool_regclassã®ã€ã³ã¹ããŒã« <span class="version">V3.0 ã</span></dt>
- <dd>
- <p>
- PostgreSQL 8.0以éã䜿çšããŠããå Žåã¯ãpgpool-IIãå
éšã§äœ¿çšããC颿°pgpool_regclassãã€ã³ã¹ããŒã«ããŸãã
- ãã®é¢æ°ãã€ã³ã¹ããŒã«ãããŠããªããŠãpgpool-IIã¯åäœããŸãããéãã¹ããŒãã§åãããŒãã«åãå®çŸ©ããŠããŠã
- SQLæã®äžã§ã¹ããŒãåãçç¥ããŠããå Žåã«ãäžå
·åãçããããšããããŸã(äžæããŒãã«ãé€ã)ã
- ãããã£ãŠãå¯èœãªãã°pgpool_regclassãã€ã³ã¹ããŒã«ããããšããå§ãããŸãã
- </p>
- <p>
- ãã®ã€ã³ã¹ããŒã«ã¯ãpgpool-IIãã¢ã¯ã»ã¹ããäºå®ã®ãã¹ãŠã®PostgreSQLãµãŒãã§å®æœããŠãã ããã
- </p>
+<h2 id="install_functions">颿°ã®ç»é²</h2>
+
+<h3 id="pgpool_regclass">pgpool_regclass ã®ã€ã³ã¹ããŒã«ïŒæšå¥šïŒ <span class="version">V3.0 ã</span></h3>
+<p>PostgreSQL 8.0 以éã䜿çšããŠããå Žåã¯ãpgpool-II ãå
éšã§äœ¿çšãã C 颿°
+pgpool_regclass ãã€ã³ã¹ããŒã«ããŸãã</p>
+
+<h4>pgpool_regclass ãšã¯ïŒ</h4>
+<p>
+ãã®é¢æ°ãã€ã³ã¹ããŒã«ãããŠããªããŠã pgpool-II ã¯åäœããŸãããéãã¹ããŒãã§åãããŒãã«åãå®çŸ©ããŠããŠã
+SQL æã®äžã§ã¹ããŒãåãçç¥ããŠããå Žåã«ãäžå
·åãçããããšããããŸãïŒäžæããŒãã«ãé€ãïŒã
+ãããã£ãŠãå¯èœãªãã° pgpool_regclass ãã€ã³ã¹ããŒã«ããããšããå§ãããŸãã
+</p>
+
+<h4>颿°ã®ã€ã³ã¹ããŒã«</h4>
+<p>ãã®ã€ã³ã¹ããŒã«ã¯ãpgpool-II ãã¢ã¯ã»ã¹ããäºå®ã®ãã¹ãŠã® PostgreSQL ãµãŒãã§å®æœããŠãã ããã</p>
<pre>
-cd pgpool-II-x.x.x/sql/pgpool-regclass
-make
-make install
+$ cd pgpool-II-x.x.x/sql/pgpool-regclass
+$ make
+$ make install
</pre>
- <p>
-ãã®åŸã«ä»¥äžãã
- <p>
+
+<p>ãã®åŸã«ä»¥äžãã</p>
+
<pre>
-psql -f pgpool-regclass.sql template1
+$ psql -f pgpool-regclass.sql template1
</pre>
- </p>
- <p>
-ãŸãã¯
- <p>
+
+<p>ãŸãã¯</p>
+
<pre>
-psql template1
-CREATE EXTENSION pgpool_regclass;
+$ psql template1
+=# CREATE EXTENSION pgpool_regclass;
</pre>
- <p>
-ãå®è¡ããŸãã
- </p>
- <p>
- pgpool-regclass.sqlãŸãã¯CREATE EXTENSIONã®å®è¡ã¯ãpgpool-IIçµç±ã§å©çšããããŒã¿ããŒã¹æ¯ã«å¿
èŠã«ãªããŸãã
- ãã ããtemplate1ããŒã¿ããŒã¹ã«å¯ŸããŠ"psql -f pgpool-regclass.sql template1"ãŸãã¯CREATE EXTENSIONãå®è¡åŸã«äœæãããããŒã¿ããŒã¹ã§ã¯ãæ°ãã«pgpool-regclass.sqlãŸãã¯CREATE EXTENSIONãå®è¡ããå¿
èŠã¯ãããŸããã
- </p>
- </dd>
-<dt>insert_lockããŒãã«ã®äœæ <span class="version">V3.0 ã</span></dt>
-<dd>
- <p>
- ã¬ããªã±ãŒã·ã§ã³ã¢ãŒãã§insert_lockãå©çšãããå Žåã¯ãæä»å¶åŸ¡çšã®ããŒãã«
- pgpool_catalog.insert_lockãäœæããŸãã
- insert_lockããŒãã«ãååšããªããŠãä»ã®ãšããinsert_lockã¯åäœããŸããã
- ãã®å Žåã¯ãæ¿å
¥å¯Ÿè±¡ã®ããŒãã«ã«å¯ŸããŠããã¯ãè¡ãããŸãã
- ããã¯pgpool-II 2.2ãš2.3ã·ãªãŒãºã®åäœãšåãã§ããæ¿å
¥å¯Ÿè±¡ã®ããŒãã«ã«å¯Ÿããããã¯ã¯ã
- VACUUMãšç«¶åããŠINSERTåŠçãé·æéãåŸ
ããããå¯èœæ§ããããŸãã
- </p>
- <p>
- ãããã£ãŠãinsert_lockããŒãã«ãäœæããããšããå§ãããŸãã
- ããŒãã«ã®äœæã¯ãpgpool-IIãã¢ã¯ã»ã¹ããäºå®ã®ãã¹ãŠã®PostgreSQLãµãŒãã§å®æœããŠãã ããã
- </p>
+<p>ãå®è¡ããŸãã</p>
+
+<h4>åè</h4>
+<p>
+pgpool-regclass.sql ãŸã㯠<code>CREATE EXTENSION</code> ã®å®è¡ã¯ã
+pgpool-II çµç±ã§å©çšããããŒã¿ããŒã¹æ¯ã«å¿
èŠã«ãªããŸãã
+ãã ããtemplate1 ããŒã¿ããŒã¹ã«å¯Ÿã㊠"<code>psql -f pgpool-regclass.sql template1</code>" ãŸãã¯
+<code>CREATE EXTENSION</code> ãå®è¡åŸã«äœæãããããŒã¿ããŒã¹ã§ã¯ã
+æ°ãã« pgpool-regclass.sql ãŸã㯠<code>CREATE EXTENSION</code> ãå®è¡ããå¿
èŠã¯ãããŸããã
+</p>
+
+<h3 id="insert_lock_table">insert_lock ããŒãã«ã®äœæ <span class="version">V3.0 ã</span></h3>
+<h4>ã¬ããªã±ãŒã·ã§ã³ã¢ãŒãã§ã® insert_lock</h4>
+<p>
+ã¬ããªã±ãŒã·ã§ã³ã¢ãŒãã§ insert_lock ãå©çšãããå Žåã¯ãæä»å¶åŸ¡çšã®ããŒãã«
+pgpool_catalog.insert_lock ãäœæããŸãã
+</p>
+<p>
+insert_lock ããŒãã«ãååšããªããŠãä»ã®ãšãã insert_lock ã¯åäœããŸããã
+ãã®å Žåã¯ãæ¿å
¥å¯Ÿè±¡ã®ããŒãã«ã«å¯ŸããŠããã¯ãè¡ãããŸãã
+ãã㯠pgpool-II 2.2 ãš 2.3 ã·ãªãŒãºã®åäœãšåãã§ããæ¿å
¥å¯Ÿè±¡ã®ããŒãã«ã«å¯Ÿããããã¯ã¯ã
+VACUUM ãšç«¶åã㊠INSERT åŠçãé·æéãåŸ
ããããå¯èœæ§ããããŸãã
+</p>
+<p>
+ãããã£ãŠãinsert_lock ããŒãã«ãäœæããããšããå§ãããŸãã
+ããŒãã«ã®äœæã¯ãpgpool-II ãã¢ã¯ã»ã¹ããäºå®ã®ãã¹ãŠã® PostgreSQL ãµãŒãã§å®æœããŠãã ããã
+</p>
+
+<h4>ããŒãã«ã®äœæ</h4>
<pre>
-cd pgpool-II-x.x.x/sql
-psql -f insert_lock.sql template1
+$ cd pgpool-II-x.x.x/sql
+$ psql -f insert_lock.sql template1
</pre>
- <p>
- insert_lock.sqlã®å®è¡ã¯ãpgpool-IIçµç±ã§å©çšããããŒã¿ããŒã¹æ¯ã«å¿
èŠã«ãªããŸãã
- ãã ãã"psql -f insert_lock.sql template1"ãå®è¡åŸã«äœæãããããŒã¿ããŒã¹ã§ã¯
- èªåçã«insert_lock.sqlã®å
容ãåæ ãããŠããã®ã§ã
- æ°ãã«insert_lock.sqlãå®è¡ããå¿
èŠã¯ãããŸããã
- </p>
- </dd>
-</dl>
-
+<h4>åè</h4>
<p>
-以äžã§ã€ã³ã¹ããŒã«ãå®äºããŸã(GNU makeãå¿
èŠãªã®ã§ãSolarisãFreeBSDãªã©ã§ã¯
-makeãgmakeã«èªã¿æ¿ããŠãã ãã)ã
+insert_lock.sqlã®å®è¡ã¯ãpgpool-IIçµç±ã§å©çšããããŒã¿ããŒã¹æ¯ã«å¿
èŠã«ãªããŸãã
+ãã ãã"<code>psql -f insert_lock.sql template1</code>" ãå®è¡åŸã«äœæãããããŒã¿ããŒã¹ã§ã¯
+èªåçã« insert_lock.sql ã®å
容ãåæ ãããŠããã®ã§ãæ°ãã« insert_lock.sql ãå®è¡ããå¿
èŠã¯ãããŸããã
</p>
+<h3 id="pgpool_recovery">pgpool_recovery ã®ã€ã³ã¹ããŒã«</h3>
+
+<p>åŸè¿°ã® <a href="#online_recovery_in_stream_mode">ãªã³ã©ã€ã³ãªã«ããª</a> ã®æ©èœã䜿ãå Žåã«ã¯ã
+pgpool_recovery, pgpool_remote_start, pgpool_switch_xlog ãšãã颿°ãå¿
èŠã§ãã</p>
+<p>ãŸã管çããŒã«ã§ãã pgpoolAdmin ã®ç»é¢äžãããããã¯ãšã³ãããŒãã® PostgreSQL ã忢ã»åèµ·åã»
+èšå®åèªã¿èŸŒã¿ãè¡ãªãããšãã§ããŸãããããã«ã¯ pgpool_pgctl ãšãã颿°ã䜿ãããŸãã</p>
+<p>ãããã®æ©èœã䜿ãããå Žåã«ã¯ãäžèšã® pgpool_regclass ãšåæ§ã®æé ã§ãããã® C 颿°ãç»é²ããŸãã
+ãªãããã® 4 ã€ã®é¢æ°ã¯ããã¹ãŠã®ããŒã¿ããŒã¹ã«ã€ã³ã¹ããŒã«ãããŠããå¿
èŠã¯ãªããtemplate1 ã«ã ãã§
+æ§ããŸããã</p>
+<pre>
+$ cd pgpool-II-x.x.x/sql/pgpool-regclass
+$ make
+$ make install
+$ psql -f pgpool-recovery.sql template1
+</pre>
+
+<h4>pgpool_pgctl ã®èšå® <span class="version">V3.3 ã</span></h4>
+
+<p>pgpool_pgctl 颿°ã¯ãããã¯ãšã³ãããŒãã® PostgreSQL ã® ãpgpool.pgctlããšãã
+ã«ã¹ã¿ã ãã©ã¡ãŒã¿ã«æžãããã³ãã³ããå®è¡ããŸãã
+ãã®é¢æ°ã䜿ãã«ã¯ããã®ãã©ã¡ãŒã¿ã« pg_ctl ã³ãã³ãã®ãã¹ãæå®ããŸãã</p>
+<pre>
+ex)
+$ cat >> /usr/local/pgsql/postgresql.conf
+pgpool.pg_ctl = '/usr/local/pgsql/bin/pg_ctl'
+
+$ pg_ctl reload -D /usr/local/pgsql/data
+</pre>
+
<p class="top_link"><a href="#Top">â³ back to top</a></p>
<!-- ================================================================================ -->
@@ -437,7 +470,7 @@ pcp.confã¯ãpgpool-IIãåäœããããŠãŒã¶IDã§èªã¿åãå¯èœã«ãª
<!-- ================================================================================ -->
<h1 id="pgpool_conf">pgpool.confã®èšå®</h1>
-<h2 id="pgpool_conf_sample">ãµã³ãã«ãã¡ã€ã« <span class="version">2.3 ã</span></h2>
+<h2 id="pgpool_conf_sample">ãµã³ãã«ãã¡ã€ã« <span class="version">V2.3 ã</span></h2>
<p>
pgpool-IIãã€ã³ã¹ããŒã«ãããšãã€ã³ã¹ããŒã«å
ãã£ã¬ã¯ããª(ããã©ã«ãã§ã¯/usr/local)
/etc/pgpool.conf.sampleãã§ããã®ã§ãããã
@@ -3431,7 +3464,7 @@ PostgreSQLã®PITRã䜿ã£ãŠããå Žåã¯é©çšãããŸããã
<p>
pgpool ã§ã¯ãªã³ã©ã€ã³ãªã«ããªã 2 段éã«åããŠå®æœããŸãã
pgpool ã®ã¯ã©ã€ã¢ã³ãããã¯å®å
šãªããŒã¿ã®åæãåãããã«è¥å¹²ã®æ¥ç¶åŸ
ã¡ãçºçããŸãã
-ãªã«ããªæé ã§ä»¥äžã®éãã§ãã
+ãªã«ããªæé ã§ä»¥äžã®ãšããã§ãã
</p>
<ol>
@@ -4526,127 +4559,519 @@ pgpool-II ãçããŠã㊠PostgreSQL ãšç¹ãã£ãŠããå Žåã§ãã
<!-- ================================================================================ -->
-<h1><a name="troubleshooting"></a>ãã©ãã«ã·ã¥ãŒãã£ã³ã°</h1>
-<p>
-ãã®ç« ã§ã¯ãpgpool-IIãéçšäžã«çŽé¢ããããé害ãšããã®å¯Ÿçæ¹æ³ãã±ãŒã¹å¥ã«èª¬æããŸãã
-</p>
+<h1>PCP ã³ãã³ã<a name="pcp_command"></a></h1>
+
+<h2>PCP ã³ãã³ãäžèЧ</h2>
+<p>pgpool-II ãæäœãã UNIX ã³ãã³ããšããŠã以äžã®ãã®ããããŸãã</p>
+
+<table border>
+<tr><th colspan="2">æ
å ±ãååŸãã PCP ã³ãã³ã</th></tr>
+<tr><th><a href="#pcp_node_count">pcp_node_count</a></th>
+ <td>ããŒãæ°ãååŸãã</td></tr>
+<tr><th><a href="#pcp_node_info">pcp_node_info</a></th>
+ <td>ããŒãæ
å ±ãååŸãã</td></tr>
+<tr><th><a href="#pcp_watchdog_info">pcp_watchdog_info</a></th>
+ <td>watchdog æ
å ±ãååŸãã <span class="version">V3.3 ïœ</span></td></tr>
+<tr><th><a href="#pcp_proc_count">pcp_proc_count</a></th>
+ <td>ããã»ã¹äžèЧãååŸãã</td></tr>
+<tr><th><a href="#pcp_proc_info">pcp_proc_info</a></th>
+ <td>ããã»ã¹æ
å ±ãååŸãã</td></tr>
+<tr><th><a href="#pcp_pool_status">pcp_pool_status</a></th>
+ <td>pgpool.conf ã®ãã©ã¡ãŒã¿èšå®å€ãååŸãã <span class="version">V3.1 ã</span></td></tr>
+<tr><th><a href="#pcp_systemdb_info">pcp_systemdb_info</a></th>
+ <td>ã·ã¹ãã DB æ
å ±ãååŸãã</td></tr>
+<tr><th><a href="#pcp_detach_node">pcp_detach_node</a></th>
+
+<tr><th colspan="2">ããŒãçãæäœãã PCP ã³ãã³ã</th></tr>
+<tr><th><a href="#pcp_detach_node">pcp_detach_node</a></th>
+ <td>ããŒããåãé¢ã</td></tr>
+<tr><th><a href="#pcp_attach_node">pcp_attach_node</a></th>
+ <td>ããŒãã埩垰ããã</td></tr>
+<tr><th><a href="#pcp_promote_node">pcp_promote_node</a></th>
+ <td>ããŒãããã¹ã¿ãŒã«ææ Œããã <span class="version">V3.1 ã</span></td></tr>
+<tr><th><a href="#pcp_stop_pgpool">pcp_stop_pgpool</a></th>
+ <td>pgpool-IIã忢ããã</td></tr>
+<tr><th><a href="#pcp_recovery_node">pcp_recovery_node</a></th>
+ <td>ãã¹ã¿ããŒãã䜿ã£ãŠããŒãã®ããŒã¿ãååæãããŒãèµ·åããã</td></tr>
+</table>
+
+
+<h2 id="pcp_comand_args">å
±éåŒæ°</h2>
+<p>å
šãŠã®ã³ãã³ãã«ã¯å
±éããåŒæ°ããããŸããããã¯æ¥ç¶ããpgpool-IIã®æ
å ±ãèªèšŒæ
å ±ãªã©ã§ãã</p>
-<dl>
-<dt id="health_check_failed">health check failed</dt>
- <dd>
- <p>
- ãã«ã¹ãã§ãã¯ã§pgpool-IIãDBããŒãã®éå®³ãæ€åºããŸããã
- </p>
<pre>
-2010-07-23 16:42:57 ERROR: pid 20031: health check failed. 1 th host foo at port 5432 is down
-2010-07-23 16:42:57 LOG: pid 20031: set 1 th backend down status
-2010-07-23 16:42:57 LOG: pid 20031: starting degeneration. shutdown host foot(5432)
-2010-07-23 16:42:58 LOG: pid 20031: failover_handler: set new master node: 0
-2010-07-23 16:42:58 LOG: pid 20031: failover done. shutdown host foo(5432)
+ex)
+$ pcp_node_count [-d] 10 localhost 9898 postgres hogehoge
</pre>
- <p>
- ãã®ãã°ã¯ãDBããŒã1(ãã¹ãå foo)ãããŠã³ããŠåãé¢ããã
- æ°ããDBããŒã0ããã¹ã¿ãšããŠæ±ããåºããããšã瀺ããŠããŸãã
- DBããŒã1ããã§ãã¯ããç°åžžåå ãåãé€ããåŸã«ãå¯èœã§ããã°ãªã³ã©ã€ã³ãªã«ããªæ©èœã䜿ã£
- ãŠDBããŒã1ã埩垰ãããŠãã ããã
- </p>
- </dd>
-<dt id="failed_to_read_kind_from_frontend">failed to read kind from frontend</dt>
- <dd>
-<pre>
-2010-07-26 18:43:24 LOG: pid 24161: ProcessFrontendResponse: failed to read kind from frontend. frontend abnormally exited
+<table border>
+<tr>
+<th nowrap>第 1 åŒæ°</th><td>ã¿ã€ã ã¢ãŠãå€<br>
+ç§æ°ã§ã¿ã€ã ã¢ãŠãå€ãæå®ããŸãã
+ãã®æéå
ã« pgpool-II ããå¿çããªãå Žåã¯ã³ãã¯ã·ã§ã³ãåæããŠçµäºããŸãã
+ãªãããã®ãªãã·ã§ã³ã¯ 2.1 ããã¯ç¡èŠããããã«ãªã£ãŠããŸãã
+</td>
+</tr>
+<tr><th nowrap>第 2 åŒæ°</th><td>pgpool-II ã皌åããŠãããã¹ãå</td></tr>
+<tr><th nowrap>第 3 åŒæ°</th><td>PCP ããŒãçªå·</td></tr>
+<tr><th nowrap>第 4 åŒæ°</th><td>PCP ãŠãŒã¶å</td></tr>
+<tr><th nowrap>第 5 åŒæ°</th><td>PCP ãã¹ã¯ãŒã</td></tr>
+</table>
+
+<p>
+ãªãã·ã§ã³åŒæ°ãšããŠã<code>-d </code>ããããŸãã
+<code>-d</code> ãæå®ããããšãããã°æ
å ±ãåºåããŸãã
+</p>
+<p>
+PCPãŠãŒã¶åãšãã¹ã¯ãŒã㯠<code>./configure</code> æã« <code>--prefix</code> ã§æå®ãã
+'ã€ã³ã¹ããŒã«ãã£ã¬ã¯ããª/etc' ã«ãã pcp.conf å
ã«èšè¿°ãããŠãããã®ãæå®ããŸãã
+pcp.conf ãã¡ã€ã«ã®å Žæãããã©ã«ã以å€ã®å Žæã«ããå Žåã
+<code>pgpool</code> ã® <code>-F</code> ãªãã·ã§ã³ã§ãã®äœçœ®ãæå®ããããšãã§ããŸãã
+ãã¹ã¯ãŒãã¯ã³ãã³ãã«æž¡ãæç¹ã§md5åãããŠããå¿
èŠã¯ãããŸããã
+</p>
+
+
+<h2>æ
å ±ãååŸããã³ãã³ã矀</h2>
+<p>
+å
šãŠã®ã³ãã³ãã¯ãå®è¡ããçµæãæšæºåºåã«è¡šç€ºãããŸãã
+</p>
+
+
+<h3 id="pcp_node_count">pcp_node_count</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_node_count _timeout_ _host_ _port_ _userid_ _passwd_</code></dd>
+<dt>説æ</dt>
+<dd>pgpool-II ã® pgpool.conf ã§å®çŸ©ãããããŒãã®ç·æ°ã衚瀺ããŸãã
+ åãé¢ãããŠããããŒãã®åºå¥ã¯ããŸããã</dd>
+</dl>
+
+
+<h3><a name="pcp_node_info"></a>pcp_node_info</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_node_info _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
</pre>
- <p>
- pgpool-IIããèŠãŠã¯ã©ã€ã¢ã³ããçªç¶ã»ãã·ã§ã³ãåæããéã«ãã®ãããªãã°ãæ®ããŸãã
- åå ãšããŠã¯ãã¢ããªã±ãŒã·ã§ã³ã®ãã°ãã¢ããªã±ãŒã·ã§ã³ã匷å¶çµäºãããã
- ããããã¯ãŒã¯ã®äžæçãªé害ãèããããŸãã
- ãã®ãã°ãåºãŠããDBãå£ãããšãäžè²«æ§ããªããªããããªåé¡ã¯èµ·ããŸãããã
- ç¶ç¶ããŠãã®ãã°ãåºåãããããã§ããã°ãã¢ããªã±ãŒã·ã§ã³ããããã¯ãŒã¯ã®é害ã調æ»ããããšãããããããŸãã
- </p>
- </dd>
+<dt>説æ</dt>
+<dd>pgpool-II ã® pgpool.conf ã§å®çŸ©ãããããŒãã®æ
å ±ã衚瀺ããŸããåºåçµæã¯ä»¥äžã®äŸã®ãšããã§ãã
-<dt id="kind_mismatch">kind mismatchãšã©ãŒ</dt>
- <dd>
- <p>
- ã¬ããªã±ãŒã·ã§ã³ã¢ãŒãã§éçšããŠããå Žåã«åºãããšããããšã©ãŒã§ãã
- </p>
<pre>
-2010-07-22 14:18:32 ERROR: pid 9966: kind mismatch among backends. Possible last query was: "FETCH ALL FROM c;" kind details are: 0[T] 1[E: cursor "c" does not exist]
+$ pcp_node_info 10 localhost 9898 postgres hogehoge 0
+host1 5432 1 1073741823.500000
</pre>
- <p>
- pgpool-IIã¯ãSQLã³ãã³ããåDBããŒãã«éä¿¡ããããåDBããŒãããåãã¬ã¹ãã³ã¹ãè¿ã£ãŠããããšãæåŸ
ããŸãã
- ãã®ãšã©ãŒã¯ãç°ãªãã¬ã¹ãã³ã¹ãè¿ã£ãŠããããšã瀺ããŸãã
- Possible last query was:ã®ããšã«ããã®ãšã©ãŒãè¿ãåå ãšãªã£ãåãåããã®SQLæã衚瀺ãããŸãã
- ãã®ããšã§ãåDBããŒãããã®ã¬ã¹ãã³ã¹ã®çš®é¡ãšãã¬ã¹ãã³ã¹ããšã©ãŒã®å Žåã¯ã
- PostgreSQLã®ãšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŸãã
- ããã§ã¯ã"0[T]"ã«ããã0çªç®ã®DBããŒãã"T"(è¡æ
å ±ã®éå§)ãšããå¿çãè¿ããããšã
- äžæ¹"1[E"ã§ãDBããŒã1ããšã©ãŒãè¿ãããšããšããã®ãšã©ãŒã¡ãã»ãŒãžã¯
- ãcursor "c" does not existãã§ãã£ãããšãããããŸãã
- <p>
- 泚æ: ãã®ãšã©ãŒã¯ããã¹ã¿ãŒã¹ã¬ãŒãã¢ãŒãã§ãåºãããšããããŸãã
- ããšãã°ãSETã³ãã³ãã¯ãåã»ãã·ã§ã³ã®ç¶æ
ãåãã«ããããã«ãåºæ¬çã«ãã¹ãŠã®DBããŒãã«éä¿¡ãããããã§ãã
- </p>
- <p>
- ããŒã¿ããŒã¹ã調ã¹ãŠåå ãç¹å®ããããDBã®åæã厩ããŠããããã§ããã°ã
- ãªã³ã©ã€ã³ãªã«ããªã䜿ã£ãŠæ£ããããŒã¿ãšåæãããŠãã ããã
- </p>
- </dd>
-<dt id="difference_of_number">pgpool detected difference of the number of inserted, updated or deleted tuples</dt>
- <dd>
- <p>
- ã¬ããªã±ãŒã·ã§ã³ã¢ãŒãã«ãããŠãpgpool-IIããDBããŒãéã§INSERT/UPDATE/DELETEãè¿ãçµæè¡ã®éããæ€åºããŸããã
- </p>
+<p>çµæã¯ä»¥äžã®é ã®ãšããã§ãã</p>
+<ul>
+<li>1. ããŒãã®ãã¹ãå</li>
+<li>2. ããŒãã®ããŒãçªå·</li>
+<li>3. ã¹ããŒã¿ã¹</li>
+<li>4. ããŒããã©ã³ã¹ãŠã§ã€ã</li>
+</ul>
+
+<p>ã¹ããŒã¿ã¹ã¯ [0..3] ãŸã§ã®æ°åã§è¡šããããŸããåæ°åã®æå³ã¯ïŒ</p>
+<ul>
+<li>0 - åæåæã®ã¿ã«è¡šããããPCP ã³ãã³ãã§è¡šç€ºãããããšã¯ãªãã</li>
+<li>1 - ããŒã皌åäžãæ¥ç¶ç¡ã</li>
+<li>2 - ããŒã皌åäžãæ¥ç¶æã</li>
+<li>3 - ããŒãããŠã³</li>
+</ul>
+
+<p>ããŒããã©ã³ã¹ãŠã§ã€ã㯠Normalize ããããã©ãŒãããã§åºåãããŸãã</p>
+<p>å®çŸ©ãããŠããªãããŒã ID ãæå®ãããš BackendError ãšè¡šç€ºããã
+<a href="#exit_status">çµäºã³ãŒã 12</a> ã§çµäºããŸãã</p>
+</dd>
+</dl>
+
+<h3><a name="pcp_watchdog_info"></a>pcp_watchdog_info</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_watchdog_info _timeout_ _host_ _port_ _userid_ _passwd_ [_watchdogid_]</code></dd>
+
+<dt>説æ</dt>
+<dd>
+<p>pgpool-II ã® pgpool.conf ã® watchdog ã»ã¯ã·ã§ã³ã§å®çŸ©ããã pgpool-II ã® watchdog ã¹ããŒã¿ã¹ã衚瀺ããŸãã</p>
+<p>_watchdogid_ 㯠other_pgpool_hostname ãã©ã¡ãŒã¿ã®æ·»åã§ãã
+çç¥ãããå Žåã«ã¯ã_host_:_port_ ã§åäœããŠãã pgpool-II ã® watchdog ã¹ããŒã¿ã¹ã衚瀺ãããŸãã</p>
+<p>åºåçµæã¯ä»¥äžã®äŸã®ãšããã§ãã</p>
+
<pre>
-2010-07-22 11:49:28 ERROR: pid 30710: pgpool detected difference of the number of inserted, updated or deleted tuples. Possible last query was: "update t1 set i = 1;"
-2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Degenerate backends: 1
-2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Affected tuples are: 0 1
+$ pcp_watchdog_info 10 localhost 9898 postgres hogehoge 0
+host1 9999 9000 2
</pre>
- <p>
- ãã®äŸã§ã¯ãupdate t1 set i = 1ã«ãã£ãп޿°ãããè¡æ°ããDBããŒãã§ç°ãªã£ãŠããŸãã
- ãŸããæ¬¡ã®è¡ã§ã¯ãDBããŒã1ãåãé¢ããããšãæŽã«DBããŒã0ã§ã®çµæè¡æ°ã0ã ã£ãã®ã«å¯ŸããŠãDBããŒã1ã§ã¯ã1è¡ã ã£ãããšã衚ããŠããŸãã
- </p>
- <p>
- æ£ãããªãããŒã¿ãæã£ãŠãããšæãããDBããŒãã忢ãããªã³ã©ã€ã³ãªã«ããªã䜿ã£ãŠ
- æ£ããããŒã¿ãšåæãããŠãã ããã
- </p>
- </dd>
+
+<p>çµæã¯ä»¥äžã®é ã®ãšããã§ãã</p>
+<ul>
+<li>1. pgpool-II ã®ãã¹ãå</li>
+<li>2. pgpool-II ããŒãçªå·</li>
+<li>3. watchdog ããŒãçªå·</li>
+<li>4. watchdog ã¹ããŒã¿ã¹</li>
+</ul>
+
+<p>ã¹ããŒã¿ã¹ã¯ [1..4] ãŸã§ã®æ°åã§è¡šããããŸããåæ°åã®æå³ã¯ïŒ</p>
+<ul>
+<li>1 - åæåæã®ã¿ã«è¡šããããæå®ããã pgpool-II ãæªèµ·åã®å Žåã«è¡šç€ºãããã</li>
+<li>2 - ã¹ã¿ã³ãã€: ä»®æ³ IP ãä¿æããŠããªã</li>
+<li>3 - ã¢ã¯ãã£ã: ä»®æ³ IP ãä¿æããŠãã</li>
+<li>4 - ããŠã³</li>
+</ul>
+
+<p>å®çŸ©ãããŠããªã watchdog ID ãæå®ãããš BackendError ãšè¡šç€ºããã
+<a href="#exit_status">çµäºã³ãŒã 12</a> ã§çµäºããŸãã</p>
+</dd>
</dl>
-<p class="top_link"><a href="#Top">â³ back to top</a></p>
+<h3 id="pcp_proc_count">pcp_proc_count</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_proc_count _timeout_ _host_ _port_ _userid_ _passwd_</code></dd>
+<dt>説æ</dt>
+<dd>pgpool-II ã®åããã»ã¹ã®ããã»ã¹ ID ãäžèŠ§è¡šç€ºããŸããè€æ°ããå Žåã¯ç©ºçœæåã§åºåãããŸãã</dd>
+</dl>
-<!-- ================================================================================ -->
+<h3 id="pcp_proc_info">pcp_proc_info</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_proc_info _timeout_ _host_ _port_ _userid_ _passwd_ _processid_</code></dd>
+<dt>説æ</dt>
+<dd>
+<p>pgpool-II ã®åããã»ã¹æ
å ±ã衚瀺ããŸããåºåçµæã¯ä»¥äžã®äŸã®ãšããã§ãã</p>
+<pre>
+$ pcp_proc_info 10 localhost 9898 postgres hogehoge 3815
+postgres_db postgres 1150769932 1150767351 3 0 1 14067 1
+postgres_db postgres 1150769932 1150767351 3 0 1 14068 1
+</pre>
-<h1>å¶éäºé
<a name="restriction"></a></h1>
-<p>
-<h2>PostgreSQLã®æ©èœ</h2>
+<p>çµæã¯ä»¥äžã®é ã®ãšããã§ãã</p>
<ul>
- <li>pg_terminate_backend()ã§ããã¯ãšã³ããçµäºããããšãã§ã€ã«ãªãŒãããŠããŸããŸãã
- ããã¯ãPostgreSQLãpostmasterãã·ã£ããããŠã³ãããšããšåãã¡ãã»ãŒãžãpgpoolã«éãããã§ãã
- ä»ã®ãšããå¯Ÿå¿æ¹æ³ã¯ãªãã®ã§ããã®é¢æ°ã䜿ããªãããã«ããŠãã ããã
- </li>
+<li>1. æ¥ç¶ããŠããããŒã¿ããŒã¹å</li>
+<li>2. æ¥ç¶ããŠãããŠãŒã¶å</li>
+<li>3. ããã»ã¹ã¹ã¿ãŒãæå»</li>
+<li>4. ã³ãã¯ã·ã§ã³äœææå»</li>
+<li>5. ãããã³ã«ã¡ãžã£ãŒããŒãžã§ã³</li>
+<li>6. ãããã³ã«ãã€ããŒããŒãžã§ã³</li>
+<li>7. ã³ãã¯ã·ã§ã³äœ¿çšåæ°</li>
+<li>8. PostgreSQL ããã¯ãšã³ãããã»ã¹ID</li>
+<li>9. ããã³ããšã³ãããæ¥ç¶ãããå Žå㯠1ãããã§ãªããã° 0</li>
</ul>
-<h2><a name="md5"></a>èªèšŒã»ã¢ã¯ã»ã¹å¶åŸ¡æ¹åŒ</h2>
<p>
-<ul>
- <li>ã¬ããªã±ãŒã·ã§ã³ã¢ãŒããŸããã¹ã¿/ã¹ã¬ãŒãã¢ãŒãæã«ã¯trust, reject, clear
- text password, pam, èªèšŒæ¹åŒã ããå©çšã§ããŸãã
- cryptèªèšŒã¯å©çšã§ããŸããã
- md5èªèšŒã«é¢ããŠã¯ãPostgreSQLã«è©²åœãŠãŒã¶ãmd5èªèšŒä»ã§PostgreSQLã«ç»é²ãã
- 次ã«pgpoolã«ä»å±ããpg_md5ã³ãã³ãã䜿ã£ãŠãpool_passwdãšããèªèšŒãã¡ã€ã«ãäœæããããšã«ãã
- å©çšã§ããããã«ãªããŸãã
- pool_passwdã¯èªèšŒãã¡ã€ã«ã®ããã©ã«ãã®ãã¡ã€ã«åã§ãã
- ãã¡ã€ã«åã¯<a href="#POOL_PASSWD">pool_passwd</a>ã§å€æŽããããšãã§ããŸãã
- <ol>
- <li>DBãŠãŒã¶ã®ã¢ã«ãŠã³ãã§ãã°ã€ã³ãã"pg_md5 --md5auth ãã¹ã¯ãŒã"
- ãŸã㯠"pg_md5 --md5auth --username=ãŠãŒã¶å ãã¹ã¯ãŒã" ãå®è¡ããŸãã
- </li>
- <li>md5ã«ããæå·åããããŠãŒã¶åãšãã¹ã¯ãŒããpool_passwdã«ç»é²ãããŸãã
- pool_passwdããŸã ååšããªããã°ãpgpool.confãšåããã£ã¬ã¯ããªå
ã«äœæãããŸãã
- </li>
- <li>pool_passwdã®ãã©ãŒãããã¯ã"ãŠãŒã¶å:ãã¹ã¯ãŒã"ãšãªã£ãŠããŸãã
+ã³ãã¯ã·ã§ã³ãããã¯ãšã³ãã«å¯ŸããŠåŒµãããŠããªãå ŽåãããŒã¿ã¯è¡šç€ºãããŸããã
+ã³ãã¯ã·ã§ã³æ
å ±ãè€æ°ããå Žåãè€æ°è¡ã« 1 è¡ 1 ã³ãã¯ã·ã§ã³æ
å ±ã§è¡šç€ºãããŸãã
+æå»ã¯ EPOCH ã¿ã€ã ããã®ç§æ°ã§è¡šããããŸãã
+</p>
+<p>å®çŸ©ãããŠããªãããã»ã¹IDãæå®ãããšBackendErrorãšè¡šç€ºããã
+<a href="#exit_status">çµäºã³ãŒã 12</a>ã§çµäºããŸãã</p>
+</dd>
+</dl>
+
+<h3 id="pcp_pool_status">pcp_pool_status <span class="version">V3.1 ã</span></h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_pool_status _timeout_ _host_ _port_ _userid_ _passwd_</code></dd>
+<dt>説æ</dt>
+<dd>
+<p>pgpool.conf ã®ãã©ã¡ãŒã¿èšå®å€ãååŸããŸããåºåçµæã¯ä»¥äžã®ãšããã§ãã</p>
+<pre>
+$ pcp_pool_status 10 localhost 9898 postgres hogehoge
+name : listen_addresses
+value: localhost
+desc : host name(s) or IP address(es) to listen to
+
+name : port
+value: 9999
+desc : pgpool accepting port number
+
+name : socket_dir
+value: /tmp
+desc : pgpool socket directory
+
+name : pcp_port
+value: 9898
+desc : PCP port # to bind
+</pre>
+</dd>
+</dl>
+
+<h3 id="pcp_systemdb_info">pcp_systemdb_info</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_systemdb_info _timeout_ _host_ _port_ _userid_ _passwd_</code></dd>
+<dt>説æ</dt>
+<dd>
+<p>pgpool-II ã®ã·ã¹ãã DB æ
å ±ã衚瀺ããŸããåºåçµæã¯ä»¥äžã®ãšããã§ãã</p>
+<pre>
+$ pcp_systemdb_info 10 localhost 9898 postgres hogehoge
+localhost 5432 yamaguti '' pgpool_catalog pgpool 3
+yamaguti public accounts aid 4 aid bid abalance filler integer integer integer character(84) dist_def_accounts
+yamaguti public branches bid 3 bid bbalance filler integer integer character(84) dist_def_branches
+yamaguti public tellers bid 4 tid bid tbalance filler integer integer integer character(84) dist_def_tellers
+</pre>
+
+<p>ãŸã 1 è¡ç®ã«ã·ã¹ãã DB ã®æ
å ±ã衚瀺ãããŸããçµæã¯ä»¥äžã®é ã®ãšããã§ãã</p>
+<ul>
+<li>1. ãã¹ãå</li>
+<li>2. ããŒãçªå·</li>
+<li>3. ãŠãŒã¶å</li>
+<li>4. ãã¹ã¯ãŒãã空ã®å Žå㯠'' ã§è¡šç€ºãããŸãã</li>
+<li>5. ã¹ããŒãå</li>
+<li>6. ããŒã¿ããŒã¹å</li>
+<li>7. 忣å®çŸ©é¢æ°ã®æ°</li>
+</ul>
+
+<p>
+2 è¡ç®ä»¥éã¯åæ£å®çŸ©ã衚瀺ãããŸããè€æ°ã®å®çŸ©ãããå Žåã¯ã1 ã€ã®å®çŸ©ã«ã€ã 1 è¡è¡šç€ºãããŸãã
+çµæã¯ä»¥äžã®é ã®ãšããã§ãã
+</p>
+<ul>
+<li>1. åæ£å¯Ÿè±¡ã®ããŒã¿ããŒã¹å</li>
+<li>2. åæ£å¯Ÿè±¡ã®ã¹ããŒãå</li>
+<li>3. åæ£å¯Ÿè±¡ã®ããŒãã«å</li>
+<li>4. 忣ããŒã«ã©ã å</li>
+<li>5. åæ£å¯Ÿè±¡ããŒãã«äžã®ã«ã©ã æ°</li>
+<li>6. ã«ã©ã åãªã¹ãïŒ5. ã®ã«ã©ã æ°å衚瀺ãããŸãïŒ</li>
+<li>7. ã«ã©ã åãªã¹ãïŒ5. ã®ã«ã©ã æ°å衚瀺ãããŸãïŒ</li>
+<li>8. 忣å®çŸ©é¢æ°å</li>
+</ul>
+
+<p>
+ã·ã¹ãã DB ãå®çŸ©ãããŠããªãïŒpgpool-II ã¢ãŒãã§ãªãããã€ã¯ãšãªãã£ãã·ã¥ããªãã®ïŒå Žåã«å®è¡ãããšã
+BackendErrorãšè¡šç€ºããã<a href="#exit_status">çµäºã³ãŒã 12</a> ã§çµäºããŸãã
+</p>
+</dd>
+</dl>
+
+<h2>ããŒãçãæäœããã³ãã³ã矀</h2>
+
+<h3 id="pcp_detach_node">pcp_detach_node</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_detach_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>説æ</dt>
+<dd>
+<p>pgpool-II ã®ããŒããåãé¢ããŸãã</p>
+<p><code>-g</code> ãæå®ãããšããã¹ãŠã®ã¯ã©ã€ã¢ã³ããæ¥ç¶ãçµäºãããŸã§ããŒãã埩垰ããŸããã
+ïŒãã ãã<a href="#CLIENT_IDLE_LIMIT_IN_RECOVERY">client_idle_limit_in_recovery</a> ã -1
+ãããã¯ã<a href="#RECOVERY_TIMEOUT">recovery_timeout</a> ãèšå®ãããŠããå Žåãé€ãïŒ
+</p>
+</dd>
+</dl>
+
+<h3 id="pcp_attach_node">pcp_attach_node</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_attach_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>説æ</dt>
+<dd>pgpool-II ã®ããŒãã埩垰ãããŸãã</dd>
+</dl>
+
+<h3 id="pcp_promote_node">pcp_promote_node <span class="version">V3.1 ã</span></h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_promote_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>説æ</dt>
+<dd>
+<p>pgpool-II ã®ããŒãããã¹ã¿ãŒã«ææ ŒãããŸããããã¯ããã¹ã¿ãŒã¹ã¬ãŒãã¢ãŒãã§
+ã¹ããªãŒãã³ã°ã¬ããªã±ãŒã·ã§ã³æ§æã®å Žåã®ã¿äœ¿çšã§ããŸãã
+</p>
+<p><code>-g</code> ãæå®ãããšããã¹ãŠã®ã¯ã©ã€ã¢ã³ããæ¥ç¶ãçµäºãããŸã§ããŒãã埩垰ããŸããã
+ïŒãã ãã<a href="#CLIENT_IDLE_LIMIT_IN_RECOVERY">client_idle_limit_in_recovery</a> ã -1
+ãããã¯ã<a href="#RECOVERY_TIMEOUT">recovery_timeout</a> ãèšå®ãããŠããå Žåãé€ãïŒ
+</p>
+</dd>
+</dl>
+
+<h3 id="pcp_stop_pgpool">pcp_stop_pgpool</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_stop_pgpool _timeout_ _host_ _port_ _userid_ _passwd_ _mode_</code></dd>
+<dt>説æ</dt>
+<dd><p>pgpool-IIãæå®ãããã¢ãŒãã§ã·ã£ããããŠã³ããŸããæå®ã§ããã¢ãŒãã¯ä»¥äžã®ãšããã§ãã</p>
+<ul>
+<li>s - smart ã¢ãŒã</li>
+<li>f - fast ã¢ãŒã</li>
+<li>i - immediate ã¢ãŒã</li>
+</ul>
+
+<p>pgpool-II ãèµ·åããŠããªãå Žå㯠ConnectionError ãšè¡šç€ºããã
+<a href="#exit_status">çµäºã³ãŒã 8</a> ã§çµäºããŸãã</p>
+
+<p>
+â» çŸåšã¯ fast ã¢ãŒããš immediate ã·ã£ããããŠã³ã®åŠçã«åºå¥ã¯ãããŸããã
+åœä»€ãéã£ãæç¹ã§ã¯ã©ã€ã¢ã³ããããã»ããªãã«é¢ãããã·ã£ããããŠã³åŠçãå³åº§ã«è¡ããŸãã
+</p>
+</dd>
+</dl>
+
+<h3 id="pcp_recovery_node">pcp_recovery_node</h3>
+<dl class="flat">
+<dt>æžåŒ</dt>
+<dd><code>pcp_recovery_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_</code></dd>
+<dt>説æ</dt>
+<dd>
+pgpool-II ã®ããŒããããŒã¿ãååæãããäžã§åŸ©åž°ãããŸãã
+</dd>
+</dl>
+
+<h2 id="exit_status">çµäºã¹ããŒã¿ã¹</h2>
+<p>
+PCPã³ãã³ãã¯æ£åžžã«åŠçãçµäºããå Žåãã¹ããŒã¿ã¹'0'ã§çµäºããŸãããšã©ãŒãèµ·
+ããå Žåã¯ä»¥äžã®ã¹ããŒã¿ã¹ã«ããçµäºããŸãã
+</p>
+
+<table border>
+<tr><th>UNKNOWNERR</th>
+ <td>1</td><td>äžæãªãšã©ãŒ</td></tr>
+<tr><th>EOFER</th>
+ <td>2</td><td>EOFãšã©ãŒ</td></tr>
+<tr><th>NOMEMERR</th>
+ <td>3</td><td>ã¡ã¢ãªäžè¶³</td></tr>
+<tr><th>READERR</th>
+ <td>4</td><td>ãµãŒãããã®ããŒã¿èªã¿èŸŒã¿ãšã©ãŒ</td></tr>
+<tr><th>WRITEERR</th>
+ <td>5</td><td>ãµãŒããžã®ããŒã¿æžã蟌ã¿ãšã©ãŒ</td></tr>
+<tr><th>TIMEOUTERR</th>
+ <td>6</td><td>ã¿ã€ã ã¢ãŠã</td></tr>
+<tr><th>INVALERR</th>
+ <td>7</td><td>PCPã³ãã³ããžã®äžæ£ãªãªãã·ã§ã³</td></tr>
+<tr><th>CONNERR</th>
+ <td>8</td><td>ãµãŒãæ¥ç¶ãšã©ãŒ</td></tr>
+<tr><th>NOCONNERR</th>
+ <td>9</td><td>æ¥ç¶ãååšããªã</td></tr>
+<tr><th>SOCKERR</th>
+ <td>10</td><td>ãœã±ãããšã©ãŒ</td></tr>
+<tr><th>HOSTERR</th>
+ <td>11</td><td>ãã¹ãå解決ãšã©ãŒ</td></tr>
+<tr><th>BACKENDERR</th>
+ <td>12</td><td>ãµãŒãã§ã®PCPåŠçãšã©ãŒãååšããªãããã»ã¹IDã®æ
å ±ãååŸããããšããå Žåãªã©</td></tr>
+<tr><th>AUTHERR</th>
+ <td>13</td><td>èªèšŒãšã©ãŒ</td></tr>
+</table>
+
+<p class="top_link"><a href="#Top">â³ back to top</a></p>
+
+<!-- ================================================================================ -->
+
+<h1><a name="troubleshooting"></a>ãã©ãã«ã·ã¥ãŒãã£ã³ã°</h1>
+<p>
+ãã®ç« ã§ã¯ãpgpool-IIãéçšäžã«çŽé¢ããããé害ãšããã®å¯Ÿçæ¹æ³ãã±ãŒã¹å¥ã«èª¬æããŸãã
+</p>
+
+<dl>
+<dt id="health_check_failed">health check failed</dt>
+ <dd>
+ <p>
+ ãã«ã¹ãã§ãã¯ã§pgpool-IIãDBããŒãã®éå®³ãæ€åºããŸããã
+ </p>
+<pre>
+2010-07-23 16:42:57 ERROR: pid 20031: health check failed. 1 th host foo at port 5432 is down
+2010-07-23 16:42:57 LOG: pid 20031: set 1 th backend down status
+2010-07-23 16:42:57 LOG: pid 20031: starting degeneration. shutdown host foot(5432)
+2010-07-23 16:42:58 LOG: pid 20031: failover_handler: set new master node: 0
+2010-07-23 16:42:58 LOG: pid 20031: failover done. shutdown host foo(5432)
+</pre>
+ <p>
+ ãã®ãã°ã¯ãDBããŒã1(ãã¹ãå foo)ãããŠã³ããŠåãé¢ããã
+ æ°ããDBããŒã0ããã¹ã¿ãšããŠæ±ããåºããããšã瀺ããŠããŸãã
+ DBããŒã1ããã§ãã¯ããç°åžžåå ãåãé€ããåŸã«ãå¯èœã§ããã°ãªã³ã©ã€ã³ãªã«ããªæ©èœã䜿ã£
+ ãŠDBããŒã1ã埩垰ãããŠãã ããã
+ </p>
+ </dd>
+
+<dt id="failed_to_read_kind_from_frontend">failed to read kind from frontend</dt>
+ <dd>
+<pre>
+2010-07-26 18:43:24 LOG: pid 24161: ProcessFrontendResponse: failed to read kind from frontend. frontend abnormally exited
+</pre>
+ <p>
+ pgpool-IIããèŠãŠã¯ã©ã€ã¢ã³ããçªç¶ã»ãã·ã§ã³ãåæããéã«ãã®ãããªãã°ãæ®ããŸãã
+ åå ãšããŠã¯ãã¢ããªã±ãŒã·ã§ã³ã®ãã°ãã¢ããªã±ãŒã·ã§ã³ã匷å¶çµäºãããã
+ ããããã¯ãŒã¯ã®äžæçãªé害ãèããããŸãã
+ ãã®ãã°ãåºãŠããDBãå£ãããšãäžè²«æ§ããªããªããããªåé¡ã¯èµ·ããŸãããã
+ ç¶ç¶ããŠãã®ãã°ãåºåãããããã§ããã°ãã¢ããªã±ãŒã·ã§ã³ããããã¯ãŒã¯ã®é害ã調æ»ããããšãããããããŸãã
+ </p>
+ </dd>
+
+<dt id="kind_mismatch">kind mismatchãšã©ãŒ</dt>
+ <dd>
+ <p>
+ ã¬ããªã±ãŒã·ã§ã³ã¢ãŒãã§éçšããŠããå Žåã«åºãããšããããšã©ãŒã§ãã
+ </p>
+<pre>
+2010-07-22 14:18:32 ERROR: pid 9966: kind mismatch among backends. Possible last query was: "FETCH ALL FROM c;" kind details are: 0[T] 1[E: cursor "c" does not exist]
+</pre>
+ <p>
+ pgpool-IIã¯ãSQLã³ãã³ããåDBããŒãã«éä¿¡ããããåDBããŒãããåãã¬ã¹ãã³ã¹ãè¿ã£ãŠããããšãæåŸ
ããŸãã
+ ãã®ãšã©ãŒã¯ãç°ãªãã¬ã¹ãã³ã¹ãè¿ã£ãŠããããšã瀺ããŸãã
+ Possible last query was:ã®ããšã«ããã®ãšã©ãŒãè¿ãåå ãšãªã£ãåãåããã®SQLæã衚瀺ãããŸãã
+ ãã®ããšã§ãåDBããŒãããã®ã¬ã¹ãã³ã¹ã®çš®é¡ãšãã¬ã¹ãã³ã¹ããšã©ãŒã®å Žåã¯ã
+ PostgreSQLã®ãšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŸãã
+ ããã§ã¯ã"0[T]"ã«ããã0çªç®ã®DBããŒãã"T"(è¡æ
å ±ã®éå§)ãšããå¿çãè¿ããããšã
+ äžæ¹"1[E"ã§ãDBããŒã1ããšã©ãŒãè¿ãããšããšããã®ãšã©ãŒã¡ãã»ãŒãžã¯
+ ãcursor "c" does not existãã§ãã£ãããšãããããŸãã
+ <p>
+ 泚æ: ãã®ãšã©ãŒã¯ããã¹ã¿ãŒã¹ã¬ãŒãã¢ãŒãã§ãåºãããšããããŸãã
+ ããšãã°ãSETã³ãã³ãã¯ãåã»ãã·ã§ã³ã®ç¶æ
ãåãã«ããããã«ãåºæ¬çã«ãã¹ãŠã®DBããŒãã«éä¿¡ãããããã§ãã
+ </p>
+ <p>
+ ããŒã¿ããŒã¹ã調ã¹ãŠåå ãç¹å®ããããDBã®åæã厩ããŠããããã§ããã°ã
+ ãªã³ã©ã€ã³ãªã«ããªã䜿ã£ãŠæ£ããããŒã¿ãšåæãããŠãã ããã
+ </p>
+ </dd>
+
+<dt id="difference_of_number">pgpool detected difference of the number of inserted, updated or deleted tuples</dt>
+ <dd>
+ <p>
+ ã¬ããªã±ãŒã·ã§ã³ã¢ãŒãã«ãããŠãpgpool-IIããDBããŒãéã§INSERT/UPDATE/DELETEãè¿ãçµæè¡ã®éããæ€åºããŸããã
+ </p>
+<pre>
+2010-07-22 11:49:28 ERROR: pid 30710: pgpool detected difference of the number of inserted, updated or deleted tuples. Possible last query was: "update t1 set i = 1;"
+2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Degenerate backends: 1
+2010-07-22 11:49:28 LOG: pid 30710: ReadyForQuery: Affected tuples are: 0 1
+</pre>
+ <p>
+ ãã®äŸã§ã¯ãupdate t1 set i = 1ã«ãã£ãп޿°ãããè¡æ°ããDBããŒãã§ç°ãªã£ãŠããŸãã
+ ãŸããæ¬¡ã®è¡ã§ã¯ãDBããŒã1ãåãé¢ããããšãæŽã«DBããŒã0ã§ã®çµæè¡æ°ã0ã ã£ãã®ã«å¯ŸããŠãDBããŒã1ã§ã¯ã1è¡ã ã£ãããšã衚ããŠããŸãã
+ </p>
+ <p>
+ æ£ãããªãããŒã¿ãæã£ãŠãããšæãããDBããŒãã忢ãããªã³ã©ã€ã³ãªã«ããªã䜿ã£ãŠ
+ æ£ããããŒã¿ãšåæãããŠãã ããã
+ </p>
+ </dd>
+</dl>
+
+<p class="top_link"><a href="#Top">â³ back to top</a></p>
+
+<!-- ================================================================================ -->
+
+<h1>å¶éäºé
<a name="restriction"></a></h1>
+<p>
+<h2>PostgreSQLã®æ©èœ</h2>
+<ul>
+ <li>pg_terminate_backend()ã§ããã¯ãšã³ããçµäºããããšãã§ã€ã«ãªãŒãããŠããŸããŸãã
+ ããã¯ãPostgreSQLãpostmasterãã·ã£ããããŠã³ãããšããšåãã¡ãã»ãŒãžãpgpoolã«éãããã§ãã
+ ä»ã®ãšããå¯Ÿå¿æ¹æ³ã¯ãªãã®ã§ããã®é¢æ°ã䜿ããªãããã«ããŠãã ããã
+ </li>
+</ul>
+
+<h2><a name="md5"></a>èªèšŒã»ã¢ã¯ã»ã¹å¶åŸ¡æ¹åŒ</h2>
+<p>
+<ul>
+ <li>ã¬ããªã±ãŒã·ã§ã³ã¢ãŒããŸããã¹ã¿/ã¹ã¬ãŒãã¢ãŒãæã«ã¯trust, reject, clear
+ text password, pam, èªèšŒæ¹åŒã ããå©çšã§ããŸãã
+ cryptèªèšŒã¯å©çšã§ããŸããã
+ md5èªèšŒã«é¢ããŠã¯ãPostgreSQLã«è©²åœãŠãŒã¶ãmd5èªèšŒä»ã§PostgreSQLã«ç»é²ãã
+ 次ã«pgpoolã«ä»å±ããpg_md5ã³ãã³ãã䜿ã£ãŠãpool_passwdãšããèªèšŒãã¡ã€ã«ãäœæããããšã«ãã
+ å©çšã§ããããã«ãªããŸãã
+ pool_passwdã¯èªèšŒãã¡ã€ã«ã®ããã©ã«ãã®ãã¡ã€ã«åã§ãã
+ ãã¡ã€ã«åã¯<a href="#POOL_PASSWD">pool_passwd</a>ã§å€æŽããããšãã§ããŸãã
+ <ol>
+ <li>DBãŠãŒã¶ã®ã¢ã«ãŠã³ãã§ãã°ã€ã³ãã"pg_md5 --md5auth ãã¹ã¯ãŒã"
+ ãŸã㯠"pg_md5 --md5auth --username=ãŠãŒã¶å ãã¹ã¯ãŒã" ãå®è¡ããŸãã
+ </li>
+ <li>md5ã«ããæå·åããããŠãŒã¶åãšãã¹ã¯ãŒããpool_passwdã«ç»é²ãããŸãã
+ pool_passwdããŸã ååšããªããã°ãpgpool.confãšåããã£ã¬ã¯ããªå
ã«äœæãããŸãã
+ </li>
+ <li>pool_passwdã®ãã©ãŒãããã¯ã"ãŠãŒã¶å:ãã¹ã¯ãŒã"ãšãªã£ãŠããŸãã
</li>
<li>pool_hba.confã«md5èªèšŒã®ãšã³ããªãäœæããŸãã
pool_hba.confã«ã€ããŠã¯ã<a href="#hba">ã¯ã©ã€ã¢ã³ãèªèšŒ(HBA)ã®ããã®pool_hba.confèšå®æ¹æ³</a>
@@ -5046,364 +5471,6 @@ configure ã«å€±æããŸããå¿
ã libpq 3.0 以é(PostgreSQL 7.4以é) ã
<!-- ================================================================================ -->
-<h1>ãªãã¡ã¬ã³ã¹<a name="reference"></a></h1>
-<h2>PCPã³ãã³ããªãã¡ã¬ã³ã¹</h2>
-
-<h3 id="pcp_command">PCPã³ãã³ãäžèЧ</h3>
-<p>
-pgpool-IIãæäœããUNIXã³ãã³ããšããŠã以äžã®ãã®ããããŸãã
-</p>
-
-<table border>
-<tr><th><a href="#pcp_node_count">pcp_node_count</a></th>
- <td>ããŒãæ°ãååŸãã</td></tr>
-<tr><th><a href="#pcp_node_info">pcp_node_info</a></th>
- <td>ããŒãæ
å ±ãååŸãã</td></tr>
-<tr><th><a href="#pcp_watchdog_info">pcp_watchdog_info</a></th>
- <td>watchdog æ
å ±ãååŸãã <span class="version">V3.3 ïœ</span></td></tr>
-<tr><th><a href="#pcp_proc_count">pcp_proc_count</a></th>
- <td>ããã»ã¹äžèЧãååŸãã</td></tr>
-<tr><th><a href="#pcp_proc_info">pcp_proc_info</a></th>
- <td>ããã»ã¹æ
å ±ãååŸãã</td></tr>
-<tr><th><a href="#pcp_pool_status">pcp_pool_status</a></th>
- <td>pgpool.conf ã®ãã©ã¡ãŒã¿èšå®å€ãååŸãã <span class="version">V3.1 ã</span></td></tr>
-<tr><th><a href="#pcp_systemdb_info">pcp_systemdb_info</a></th>
- <td>ã·ã¹ãã DBæ
å ±ãååŸãã</td></tr>
-<tr><th><a href="#pcp_detach_node">pcp_detach_node</a></th>
- <td>ããŒããåãé¢ã</td></tr>
-<tr><th><a href="#pcp_attach_node">pcp_attach_node</a></th>
- <td>ããŒãã埩垰ããã</td></tr>
-<tr><th><a href="#pcp_promote_node">pcp_promote_node</a></th>
- <td>ããŒãããã¹ã¿ãŒã«ææ Œããã <span class="version">V3.1 ã</span></td></tr>
-<tr><th><a href="#pcp_stop_pgpool">pcp_stop_pgpool</a></th>
- <td>pgpool-IIã忢ããã</td></tr>
-<tr><th><a href="#pcp_recovery_node">pcp_recovery_node</a></th>
- <td>ãã¹ã¿ããŒãã䜿ã£ãŠããŒãã®ããŒã¿ãååæãããŒãèµ·åããã</td></tr>
-</table>
-
-
-<h2 id="pcp_comand_args">å
±éåŒæ°</h2>
-<p>
- å
šãŠã®ã³ãã³ãã«ã¯å
±éããåŒæ°ããããŸããããã¯æ¥ç¶ããpgpool-IIã®æ
å ±ãèªèšŒ
- æ
å ±ãªã©ã§ãã
-<pre>
-ex)
-$ pcp_node_count [-d] 10 localhost 9898 postgres hogehoge
-
-第äžåŒæ° - ã¿ã€ã ã¢ãŠãå€
- ç§æ°ã§ã¿ã€ã ã¢ãŠãå€ãæå®ããŸãããã®æéå
ã«pgpool-IIããå¿
- çããªãå Žåã¯ã³ãã¯ã·ã§ã³ãåæããŠçµäºããŸãããªãã
- ãã®ãªãã·ã§ã³ã¯ 2.1 ããã¯ç¡èŠããããã«ãªã£ãŠããŸãã
-第äºåŒæ° - pgpool-IIã皌åããŠãããã¹ãå
-第äžåŒæ° - PCPããŒãçªå·
-第ååŒæ° - PCPãŠãŒã¶å
-第äºåŒæ° - PCPãã¹ã¯ãŒã
-
-ãªãã·ã§ã³åŒæ°ãšããŠã-dããããŸãã-dãæå®ããããšãããã°æ
å ±ãåºåããŸãã
-</pre>
-<p>
-PCPãŠãŒã¶åãšãã¹ã¯ãŒã㯠./configure æã« --prefix ã§æå®ãã
-'ã€ã³ã¹ããŒã«ãã£ã¬ã¯ããª/etc' ã«ãã pcp.conf å
ã«èšè¿°ãããŠãããã®ãæå®ããŸãã
-pcp.conf ãã¡ã€ã«ã®å Žæãããã©ã«ã以å€ã®å Žæã«ããå Žåã
-pgpool ã®-F ãªãã·ã§ã³ã§ãã®äœçœ®ãæå®ããããšãã§ããŸãã
-ãã¹ã¯ãŒãã¯ã³ãã³ãã«æž¡ãæç¹ã§md5åãããŠããå¿
èŠã¯ãããŸããã
-</p>
-
-
-<h2>ã³ãã³ã矀</h2>
-<p>
-å
šãŠã®ã³ãã³ãã¯ãå®è¡ããçµæãæšæºåºåã«è¡šç€ºãããŸãã
-</p>
-
-
-<h3 id="pcp_node_count">pcp_node_count</h3>
-<pre>
-æžåŒïŒ
-pcp_node_count _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
-<p>
-pgpool-IIã® pgpool.conf ã§å®çŸ©ãããããŒãã®ç·æ°ã衚瀺ããŸããåãé¢ãããŠããããŒãã®åºå¥ã¯ããŸããã
-</p>
-
-
-<h3><a name="pcp_node_info"></a>pcp_node_info</h3>
-<pre>
-æžåŒïŒ
-pcp_node_info _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-</pre>
-
-<p>
-pgpool-IIã® pgpool.conf ã§å®çŸ©ãããããŒãã®æ
å ±ã衚瀺ããŸããåºåçµæã¯ä»¥äžã®äŸã®éãã§ãã
-</p>
-
-<pre>
-ex)
-$ pcp_node_info 10 localhost 9898 postgres hogehoge 0
-host1 5432 1 1073741823.500000
-
-çµæã¯ä»¥äžã®é ã®éãã§ãã
-1. ããŒãã®ãã¹ãå
-2. ããŒãã®ããŒãçªå·
-3. ã¹ããŒã¿ã¹
-4. ããŒããã©ã³ã¹ãŠã§ã€ã
-
-ã¹ããŒã¿ã¹ã¯[0..3]ãŸã§ã®æ°åã§è¡šããããŸããåæ°åã®æå³ã¯ïŒ
-0 - åæåæã®ã¿ã«è¡šããããPCPã³ãã³ãã§è¡šç€ºãããããšã¯ãªãã
-1 - ããŒã皌åäžãæ¥ç¶ç¡ã
-2 - ããŒã皌åäžãæ¥ç¶æã
-3 - ããŒãããŠã³
-</pre>
-
-<p>
-ããŒããã©ã³ã¹ãŠã§ã€ãã¯Normalizeããããã©ãŒãããã§åºåãããŸãã
-</p>
-<p>
-å®çŸ©ãããŠããªãããŒãIDãæå®ãããšBackendErrorãšè¡šç€ºãããçµäºã³ãŒã12ã§çµäºããŸãã
-</p>
-
-<h3><a name="pcp_watchdog_info"></a>pcp_watchdog_info</h3>
-<pre>
-æžåŒïŒ
-pcp_watchdog_info _timeout_ _host_ _port_ _userid_ _passwd_ [_watchdogid_]
-</pre>
-
-<p>
-pgpool-IIã® pgpool.conf ã® watchdog ã»ã¯ã·ã§ã³ã§å®çŸ©ããã pgpool-II ã® watchdog ã¹ããŒã¿ã¹ã衚瀺ããŸãã
-_watchdogid_ 㯠other_pgpool_hostname ãã©ã¡ãŒã¿ã®æ·»åã§ããçç¥ãããå Žåã«ã¯ã_host_:_port_ ã§åäœããŠãã
-pgpool-II ã® watchdog ã¹ããŒã¿ã¹ã衚瀺ãããŸããåºåçµæã¯ä»¥äžã®äŸã®éãã§ãã
-</p>
-
-<pre>
-ex)
-$ pcp_watchdog_info 10 localhost 9898 postgres hogehoge 0
-host1 9999 9000 2
-
-çµæã¯ä»¥äžã®é ã®éãã§ãã
-1. pgpool-II ã®ãã¹ãå
-2. pgpool-II ããŒãçªå·
-3. watchdog ããŒãçªå·
-4. watchdog ã¹ããŒã¿ã¹
-
-ã¹ããŒã¿ã¹ã¯[1..4]ãŸã§ã®æ°åã§è¡šããããŸããåæ°åã®æå³ã¯ïŒ
-1 - åæåæã®ã¿ã«è¡šããããæå®ããã pgpool-II ãæªèµ·åã®å Žåã«è¡šç€ºãããã
-2 - ã¹ã¿ã³ãã€: ä»®æ³ IP ãä¿æããŠããªã
-3 - ã¢ã¯ãã£ã: ä»®æ³ IP ãä¿æããŠãã
-4 - ããŠã³
-</pre>
-
-<p>
-å®çŸ©ãããŠããªã watchdog IDãæå®ãããšBackendErrorãšè¡šç€ºãããçµäºã³ãŒã12ã§çµäºããŸãã
-</p>
-
-<h3 id="pcp_proc_count">pcp_proc_count</h3>
-<p>
-<pre>
-æžåŒïŒ
-pcp_proc_count _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
-<p>
-pgpool-IIã®åããã»ã¹ã®ããã»ã¹IDãäžèŠ§è¡šç€ºããŸããè€æ°ããå Žåã¯ç©ºçœæåã§åºåãããŸãã
-</p>
-
-<h3 id="pcp_proc_info">pcp_proc_info</h3>
-<p>
-<pre>
-æžåŒïŒ
-pcp_proc_info _timeout_ _host_ _port_ _userid_ _passwd_ _processid_
-</pre>
-<p>
-pgpool-IIã®åããã»ã¹æ
å ±ã衚瀺ããŸããåºåçµæã¯ä»¥äžã®äŸã®éãã§ãã
-</p>
-<pre>
-ex)
-$ pcp_proc_info 10 localhost 9898 postgres hogehoge 3815
-postgres_db postgres 1150769932 1150767351 3 0 1 14067 1
-postgres_db postgres 1150769932 1150767351 3 0 1 14068 1
-
-çµæã¯ä»¥äžã®é ã®éãã§ãã
-1. æ¥ç¶ããŠããããŒã¿ããŒã¹å
-2. æ¥ç¶ããŠãããŠãŒã¶å
-3. ããã»ã¹ã¹ã¿ãŒãæå»
-4. ã³ãã¯ã·ã§ã³äœææå»
-5. ãããã³ã«ã¡ãžã£ãŒããŒãžã§ã³
-6. ãããã³ã«ãã€ããŒããŒãžã§ã³
-7. ã³ãã¯ã·ã§ã³äœ¿çšåæ°
-8. PostgreSQLããã¯ãšã³ãããã»ã¹ID
-9. ããã³ããšã³ãããæ¥ç¶ãããå Žåã¯1ãããã§ãªããã°0
-
-ã³ãã¯ã·ã§ã³ãããã¯ãšã³ãã«å¯ŸããŠåŒµãããŠããªãå ŽåãããŒã¿ã¯è¡šç€ºãããŸããã
-ã³ãã¯ã·ã§ã³æ
å ±ãè€æ°ããå Žåãè€æ°è¡ã«1è¡1ã³ãã¯ã·ã§ã³æ
å ±ã§è¡šç€ºãããŸãã
-æå»ã¯EPOCHã¿ã€ã ããã®ç§æ°ã§è¡šããããŸãã
-
-å®çŸ©ãããŠããªãããã»ã¹IDãæå®ãããšBackendErrorãšè¡šç€ºããã<a href="#exit_status">çµäºã³ãŒã12</a>ã§çµäºããŸãã
-</pre>
-
-<h3 id="pcp_pool_status">pcp_pool_status <span class="version">V3.1 ã</span></h3>
-<pre>
-æžåŒ:
-pcp_pool_status _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
-<p>pgpool.conf ã®ãã©ã¡ãŒã¿èšå®å€ãååŸããŸããåºåçµæã¯ä»¥äžã®éãã§ãã</p>
-<pre>
-$ pcp_pool_status 10 localhost 9898 postgres hogehoge
-name : listen_addresses
-value: localhost
-desc : host name(s) or IP address(es) to listen to
-
-name : port
-value: 9999
-desc : pgpool accepting port number
-
-name : socket_dir
-value: /tmp
-desc : pgpool socket directory
-
-name : pcp_port
-value: 9898
-desc : PCP port # to bind
-</pre>
-
-
-<h3 id="pcp_systemdb_info">pcp_systemdb_info</h3>
-<pre>
-æžåŒïŒ
-pcp_systemdb_info _timeout_ _host_ _port_ _userid_ _passwd_
-</pre>
-
-<p>pgpool-IIã®ã·ã¹ãã DBæ
å ±ã衚瀺ããŸããåºåçµæã¯ä»¥äžã®éãã§ãã</p>
-
-<pre>
-$ pcp_systemdb_info 10 localhost 9898 postgres hogehoge
-localhost 5432 yamaguti '' pgpool_catalog pgpool 3
-yamaguti public accounts aid 4 aid bid abalance filler integer integer integer character(84) dist_def_accounts
-yamaguti public branches bid 3 bid bbalance filler integer integer character(84) dist_def_branches
-yamaguti public tellers bid 4 tid bid tbalance filler integer integer integer character(84) dist_def_tellers
-
-ãŸãäžè¡ç®ã«ã·ã¹ãã DBã®æ
å ±ã衚瀺ãããŸããçµæã¯ä»¥äžã®é ã®éãã§ãã
-
-1. ãã¹ãå
-2. ããŒãçªå·
-3. ãŠãŒã¶å
-4. ãã¹ã¯ãŒãã空ã®å Žåã¯''ã§è¡šç€ºãããŸãã
-5. ã¹ããŒãå
-6. ããŒã¿ããŒã¹å
-7. 忣å®çŸ©é¢æ°ã®æ°
-
-äºè¡ç®ä»¥éã¯åæ£å®çŸ©ã衚瀺ãããŸããè€æ°ã®å®çŸ©ãããå Žåã¯ãäžã€ã®å®çŸ©ã«ã€ã
-äžè¡è¡šç€ºãããŸããçµæã¯ä»¥äžã®é ã®éãã§ãã
-
-1. åæ£å¯Ÿè±¡ã®ããŒã¿ããŒã¹å
-2. åæ£å¯Ÿè±¡ã®ã¹ããŒãå
-3. åæ£å¯Ÿè±¡ã®ããŒãã«å
-4. 忣ããŒã«ã©ã å
-5. åæ£å¯Ÿè±¡ããŒãã«äžã®ã«ã©ã æ°
-6. ã«ã©ã åãªã¹ã(5.ã®ã«ã©ã æ°å衚瀺ãããŸã)
-7. ã«ã©ã åãªã¹ã(5.ã®ã«ã©ã æ°å衚瀺ãããŸã)
-8. 忣å®çŸ©é¢æ°å
-
-ã·ã¹ãã DBãå®çŸ©ãããŠããªã(pgpool-IIã¢ãŒãã§ãªãããã€ã¯ãšãªãã£ãã·ã¥ããª
-ãã®)å Žåã«å®è¡ãããšãBackendErrorãšè¡šç€ºãããçµäºã³ãŒã12ã§çµäºããŸãã
-</pre>
-
-<h3 id="pcp_detach_node">pcp_detach_node</h3>
-<pre>
-æžåŒïŒ
-pcp_detach_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-
-pgpool-IIã®ããŒããåãé¢ããŸãã
--gãæå®ãããšããã¹ãŠã®ã¯ã©ã€ã¢ã³ããæ¥ç¶ãçµäºãããŸã§ããŒãã埩垰ããŸããã
-(ãã ããclient_idle_limit_in_recovery ã -1 ãããã¯ãrecovery_timeout ãèšå®ãããŠããå Žåãé€ã)
-</pre>
-
-<h3 id="pcp_attach_node">pcp_attach_node</h3>
-<pre>
-æžåŒïŒ
-pcp_attach_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-
-pgpool-IIã®ããŒãã埩垰ãããŸãã
-</pre>
-
-<h3 id="pcp_promote_node">pcp_promote_node <span class="version">V3.1 ã</span></h3>
-<pre>
-æžåŒ:
-pcp_promote_node [-g] _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-
-pgpool-IIã®ããŒãããã¹ã¿ãŒã«ææ ŒãããŸããããã¯ããã¹ã¿ãŒã¹ã¬ãŒãã¢ãŒãã§ã¹ããªãŒãã³ã°
-ã¬ããªã±ãŒã·ã§ã³æ§æã®å Žåã®ã¿äœ¿çšã§ããŸãã
--gãæå®ãããšããã¹ãŠã®ã¯ã©ã€ã¢ã³ããæ¥ç¶ãçµäºãããŸã§ããŒãããã¹ã¿ãŒã«ææ ŒããŸããã
-(ãã ããclient_idle_limit_in_recovery ã -1 ãããã¯ãrecovery_timeout ãèšå®ãããŠããå Žåãé€ã)
-</pre>
-</p>
-
-<h3 id="pcp_stop_pgpool">pcp_stop_pgpool</h3>
-<pre>
-æžåŒïŒ
-pcp_stop_pgpool _timeout_ _host_ _port_ _userid_ _passwd_ _mode_
-
-pgpool-IIãæå®ãããã¢ãŒãã§ã·ã£ããããŠã³ããŸããæå®ã§ããã¢ãŒãã¯ä»¥äžã®é
-ãã§ãã
-
-s - smart ã¢ãŒã
-f - fast ã¢ãŒã
-i - immediate ã¢ãŒã
-
-pgpool-IIãèµ·åããŠããªãå Žåã¯ConnectionErrorãšè¡šç€ºãããçµäºã³ãŒã8ã§çµäºã
-ãŸãã
-
-â» çŸåšã¯ fast ã¢ãŒããš immediate ã·ã£ããããŠã³ã®åŠçã«åºå¥ã¯ãã
- ãŸãããåœä»€ãéã£ãæç¹ã§ã¯ã©ã€ã¢ã³ããããã»ããªãã«é¢ããã
- ã·ã£ããããŠã³åŠçãå³åº§ã«è¡ããŸãã
-</pre>
-</p>
-
-<h3 id="pcp_recovery_node">pcp_recovery_node</h3>
-<pre>
-æžåŒïŒ
-pcp_recovery_node _timeout_ _host_ _port_ _userid_ _passwd_ _nodeid_
-
-pgpool-IIã®ããŒããããŒã¿ãååæãããäžã§åŸ©åž°ãããŸãã
-</pre>
-</p>
-
-<h2 id="exit_status">çµäºã¹ããŒã¿ã¹</h2>
-<p>
-PCPã³ãã³ãã¯æ£åžžã«åŠçãçµäºããå Žåãã¹ããŒã¿ã¹'0'ã§çµäºããŸãããšã©ãŒãèµ·
-ããå Žåã¯ä»¥äžã®ã¹ããŒã¿ã¹ã«ããçµäºããŸãã
-</p>
-
-<table border>
-<tr><th>UNKNOWNERR</th>
- <td>1</td><td>äžæãªãšã©ãŒ</td></tr>
-<tr><th>EOFER</th>
- <td>2</td><td>EOFãšã©ãŒ</td></tr>
-<tr><th>NOMEMERR</th>
- <td>3</td><td>ã¡ã¢ãªäžè¶³</td></tr>
-<tr><th>READERR</th>
- <td>4</td><td>ãµãŒãããã®ããŒã¿èªã¿èŸŒã¿ãšã©ãŒ</td></tr>
-<tr><th>WRITEERR</th>
- <td>5</td><td>ãµãŒããžã®ããŒã¿æžã蟌ã¿ãšã©ãŒ</td></tr>
-<tr><th>TIMEOUTERR</th>
- <td>6</td><td>ã¿ã€ã ã¢ãŠã</td></tr>
-<tr><th>INVALERR</th>
- <td>7</td><td>PCPã³ãã³ããžã®äžæ£ãªãªãã·ã§ã³</td></tr>
-<tr><th>CONNERR</th>
- <td>8</td><td>ãµãŒãæ¥ç¶ãšã©ãŒ</td></tr>
-<tr><th>NOCONNERR</th>
- <td>9</td><td>æ¥ç¶ãååšããªã</td></tr>
-<tr><th>SOCKERR</th>
- <td>10</td><td>ãœã±ãããšã©ãŒ</td></tr>
-<tr><th>HOSTERR</th>
- <td>11</td><td>ãã¹ãå解決ãšã©ãŒ</td></tr>
-<tr><th>BACKENDERR</th>
- <td>12</td><td>ãµãŒãã§ã®PCPåŠçãšã©ãŒãååšããªãããã»ã¹IDã®æ
å ±ãååŸããããšããå Žåãªã©</td></tr>
-<tr><th>AUTHERR</th>
- <td>13</td><td>èªèšŒãšã©ãŒ</td></tr>
-</table>
-
-<p class="top_link"><a href="#Top">â³ back to top</a></p>
-
-<!-- ================================================================================ -->
-
<h1>å
éšæ
å ±<a name="internal"></a></h1>
<p>
pgpool-IIããŒãžã§ã³ 2.0 以éã§ã¯ã1.x ããŒãžã§ã³ãšæ¯ã¹å€§å¹
ãªæ¹è¯ãå ããããŠããŸãã
@@ -5485,7 +5552,7 @@ L ç¶æ
ãšããŠå®çŸ©ããŸãã
<li> SELECTã®æçµå®è¡ã¹ããŒã¿ã¹ã®ååŸ</li>
</ol>
<p>
-SELECTã®æçµå®è¡ã¹ããŒã¿ã¹ãšåŠçãããå Žæãšã®é¢ä¿ã¯ã以äžã®éãã§ãã
+SELECTã®æçµå®è¡ã¹ããŒã¿ã¹ãšåŠçãããå Žæãšã®é¢ä¿ã¯ã以äžã®ãšããã§ãã
</p>
<table border>
@@ -9342,7 +9409,7 @@ md5èªèšŒã§é·ããŠãŒã¶åãåŠçããéã®ãã°ãä¿®æ£ããŸãã
</p><ul>
<li>ã¹ããªãŒãã³ã°ã¬ããªã±ãŒã·ã§ã³ã«ãããŠã<a href="#DELAY_THRESHOLD">delay_threshold</a> ã
0ãŸãã¯ãã«ã¹ãã§ãã¯ãç¡å¹ãªãã°ãé
å»¶ãã§ãã¯ã¯å®æœãããŸããã
- ããã¯pgpool-IIããã¥ã¢ã«éãã®åäœã§ããããããŸã§ã¯ãã«ã¹ãã§ãã¯ãç¡å¹ã®å Žåã
+ ããã¯pgpool-IIããã¥ã¢ã«ãšããã®åäœã§ããããããŸã§ã¯ãã«ã¹ãã§ãã¯ãç¡å¹ã®å Žåã
é
å»¶ãã§ãã¯ã宿œãããŠããŸãã(Guillaume Lelarge)
</li></ul>
<p></p>
diff --git a/doc/pgpool.css b/doc/pgpool.css
index 327e4b8ae..8b69048ae 100644
--- a/doc/pgpool.css
+++ b/doc/pgpool.css
@@ -241,3 +241,24 @@ h1 .version {
font-weight: bold;
color: red;
}
+dl.flat dt {
+ clear: both;
+ float: left;
+ width: 40px;
+ line-height: 150%;
+}
+dl.flat dd {
+ padding-left: 50px;
+ line-height: 150%;
+}
+dl.flat dd * {
+ margin-left: 0px;
+}
+li dl dt {
+ font-weight: normal;
+ display: list-item;
+ list-style: square outside;
+}
+li dl dd {
+ margin-bottom: 10px;
+}
[parent: 64e85f8ab643]