diff options
author | Nozomi Anzai | 2014-10-08 06:34:15 +0000 |
---|---|---|
committer | Nozomi Anzai | 2014-10-08 06:34:15 +0000 |
commit | 34a8967ff373926f541193189898060ade72170d (patch) | |
tree | 6b1a73aa41e38cadf0220d1a593e08b116eb6e68 | |
parent | 03642948609e6287354cb881d04b39cdd2b69593 (diff) |
Adopt pgpool-II 3.4
Added parameters are:
- listen_backlog_multiplier
- connect_timeout
- allow_sql_comments
- check_unlogged_table
- database_redirect_preference_list
- app_name_redirect_preference_list
-rw-r--r-- | common.php | 14 | ||||
-rw-r--r-- | definePgpoolConfParam.php | 33 | ||||
-rw-r--r-- | lang/en.lang.php | 7 | ||||
-rw-r--r-- | lang/ja.lang.php | 5 | ||||
-rw-r--r-- | nodeStatus.php | 2 | ||||
-rw-r--r-- | status.php | 2 | ||||
-rw-r--r-- | templates/help/en/pgconfig.tpl | 2194 | ||||
-rw-r--r-- | templates/help/ja/pgconfig.tpl | 2249 | ||||
-rw-r--r-- | templates/pgconfig.tpl | 61 |
9 files changed, 124 insertions, 4443 deletions
@@ -30,7 +30,7 @@ error_reporting(E_ALL); function versions() { - return array('3.3', '3.2', '3.1', '3.0', + return array('3.4', '3.3', '3.2', '3.1', '3.0', '2.3', '2.2', '2.1', '2.0'); } @@ -562,6 +562,16 @@ function paramExists($param) switch ($param) { /* Add */ + // params added in 3.4 + case 'listen_backlog_multiplier': + case 'connect_timeout': + case 'allow_sql_comments': + case 'check_unlogged_table': + case 'database_redirect_preference_list': + case 'app_name_redirect_preference_list': + $add_version = 3.4; + break; + // params added in 3.3 case 'clear_memqcache_on_escalation': case 'heartbeat_destination': @@ -697,7 +707,7 @@ function isSuperUser($user_name) $result = pg_query($conn, "SELECT usesuper FROM pg_user WHERE usename = '{$user_name}'"); - if (!pg_result_status($result) == PGSQL_TUPLES_OK) { + if (!pg_result_status($result) == PGSQL_TUPLES_OK) { @pg_close($conn); return NULL; } diff --git a/definePgpoolConfParam.php b/definePgpoolConfParam.php index 2be6763..9cdea39 100644 --- a/definePgpoolConfParam.php +++ b/definePgpoolConfParam.php @@ -1,5 +1,4 @@ <?php - /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** @@ -69,6 +68,12 @@ $pgpoolConfigParam[$key]['type'] = 'C'; $pgpoolConfigParam[$key]['default'] = '/tmp'; $pgpoolConfigParam[$key]['regexp'] = $dirreg; +$key = 'listen_backlog_multiplier'; +$pgpoolConfigParam[$key]['type'] = 'N'; +$pgpoolConfigParam[$key]['default'] = 2; +$pgpoolConfigParam[$key]['max'] = NUM_MAX; +$pgpoolConfigParam[$key]['min'] = 1; + # - pgpool Communication Manager Connection Settings - $key = 'pcp_port'; @@ -336,6 +341,20 @@ $pgpoolConfigParam[$key]['type'] = 'C'; $pgpoolConfigParam[$key]['default'] = ''; $pgpoolConfigParam[$key]['regexp'] = $anyelse; +$key = 'database_redirect_preference_list'; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = ''; +$pgpoolConfigParam[$key]['regexp'] = $anyelse; + +$key = 'app_name_redirect_preference_list'; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = ''; +$pgpoolConfigParam[$key]['regexp'] = $anyelse; + +$key = 'allow_sql_comments'; +$pgpoolConfigParam[$key]['type'] = 'B'; +$pgpoolConfigParam[$key]['default'] = 'off'; + #------------------------------------------------------------------------------ # MASTER/SLAVE MODE #------------------------------------------------------------------------------ @@ -467,6 +486,12 @@ $pgpoolConfigParam[$key]['default'] = 1; $pgpoolConfigParam[$key]['min'] = 0; $pgpoolConfigParam[$key]['max'] = NUM_MAX; +$key = 'connect_timeout'; +$pgpoolConfigParam[$key]['type'] = 'N'; +$pgpoolConfigParam[$key]['default'] = 10000; +$pgpoolConfigParam[$key]['min'] = 0; +$pgpoolConfigParam[$key]['max'] = NUM_MAX; + #------------------------------------------------------------------------------ # FAILOVER AND FAILBACK #----------------------------------------------------------------------------- @@ -706,7 +731,7 @@ $pgpoolConfigWdOtherParam[$key]['min'] = 1024; $pgpoolConfigWdOtherParam[$key]['max'] = NUM_MAX; #------------------------------------------------------------------------------ -# ON MEMORY QUERY CACHE +# IN MEMORY QUERY CACHE #------------------------------------------------------------------------------ $key = 'memory_cache_enabled'; @@ -798,6 +823,10 @@ $key = 'check_temp_table'; $pgpoolConfigParam[$key]['type'] = 'B'; $pgpoolConfigParam[$key]['default'] = 'on'; +$key = 'check_unlogged_table'; +$pgpoolConfigParam[$key]['type'] = 'B'; +$pgpoolConfigParam[$key]['default'] = 'on'; + #------------------------------------------------------------------------------ # Deleted #------------------------------------------------------------------------------ diff --git a/lang/en.lang.php b/lang/en.lang.php index 3c4912c..4124a38 100644 --- a/lang/en.lang.php +++ b/lang/en.lang.php @@ -27,6 +27,8 @@ $message = array( 'lang' => 'en', 'strLang' => 'English', + 'descAllow_sql_comments' => 'If on, ignore SQL comments when judging if load balance or query cache is possible', + 'descApp_name_redirect_preference_list' => '"application name:node id" pairs to specify the node id when the application is used', 'descArping_path' => 'The path of a command to send an ARP request after the virtual IP is switched', 'descArping_cmd' => 'The ommand to send an ARP request after the virtual IP is switched', 'descAuthentication_timeout' => 'Timeout in seconds to complete client authentication', @@ -39,6 +41,7 @@ $message = array( 'descDelegate_IP' => 'The virtual IP address (VIP) of pgpool-II ', 'descBlack_function_list' => 'Comma separated functions which write to database', 'descBlack_memqcache_table_list' => 'Comma separated list of table names not to be cached', + 'descCheck_temp_table' => 'If on, enable temporary table check in SELECT statements', 'descChild_life_time' => 'Life of an idle child process in seconds', 'descChild_max_connections' => 'If child_max_connections connections were received, child exits', 'descClear_memqcache_on_escalation' => 'If on, watchdog clears all the query cache in the shared memory when pgpool-II escaltes to active', @@ -47,7 +50,8 @@ $message = array( 'from a client in on line recovery', 'descConnection_cache' => 'If true, cache connections to PostgreSQL', 'descConnection_life_time' => 'Life time for each idle connection in seconds', - 'descCheck_temp_table' => 'If on, enable temporary table check in SELECT statements', + 'desCconnect_timeout' => 'Timeout value in milliseconds before giving up connecting to backend using connect() system call', + 'descDatabase_redirect_preference_list' => '"database name:node id" pairs to specify the node id when connecting to the database', 'descDelay_threshold' => 'If the standby server delays more than delay_threshold, '. 'any query goes to the primary only', 'descDebug_level' => 'Debug message verbosity level', @@ -79,6 +83,7 @@ $message = array( 'descInsert_lock' => ' If you replicate a table having SERIAL data type column, '. 'sometimes the serial value does not match between servers', 'descListen_addresses' => 'Specifies the addresses to listen on for TCP/IP connections', + 'descListen_backlog_multiplier' => 'The number of preforked pgpool-II server processes', 'descLoad_balance_mode' => 'Perform load balancing for SELECT', 'descLobj_lock_table' => 'Specifies table name lock used when rewriting lo_create in replication mode', 'descLog_destination' => 'Where to log', diff --git a/lang/ja.lang.php b/lang/ja.lang.php index 972de53..31f1b5e 100644 --- a/lang/ja.lang.php +++ b/lang/ja.lang.php @@ -27,6 +27,8 @@ $message = array( 'lang' => 'ja', 'strLang' => '日本語', + 'descAllow_sql_comments' => '負荷分散やクエリキャッシュができるかどうかの判定の際に、SQLコメントを無視するかどうか', + 'descApp_name_redirect_preference_list' => 'アプリケーション名によって負荷分散をしたいノード番号を、"アプリケーション名:ノード番号"で指定', 'descArping_path' => 'IP アドレス切り替え後に ARP リクエストを送信するコマンドのパス', 'descArping_cmd' => 'IP アドレス切り替え後に ARP リクエストを送信するコマンド', 'descAuthentication_timeout' => 'クライアント認証のタイムアウト時間(秒)', @@ -46,6 +48,8 @@ $message = array( 'descClient_idle_limit_in_recovery' => 'リカバリ中のクライアントからのクエリの最大待ち時間(秒)', 'descConnection_cache' => 'コネクションキャッシュ機能の有無', 'descConnection_life_time' => 'コネクションプール中のコネクションの有効期間(秒)', + 'desCconnect_timeout' => 'connect()システムコールを使ってバックエンドに接続する際のタイムアウト値を指定(ミリ秒)', + 'descDatabase_redirect_preference_list' => 'データベース名によって負荷分散をしたいノード番号を、"データベース名:ノード番号"で指定', 'descDebug_level' => 'デバッグメッセージの詳細レベル(0は無効)', 'descDelay_threshold' => '許容するスタンバイサーバの遅延(バイト)', 'descDelegate_IP' => '仮想 IP アドレス', @@ -71,6 +75,7 @@ $message = array( 'descIgnore_leading_white_space' => 'load balance時のSQL文行頭の空白を無視', 'descInsert_lock' => 'INSERT時に自動的にトランザクションの開始,テーブルロック,トランザクションの終了', 'descListen_addresses' => 'TCP/IPコネクションを受け付けるアドレス', + 'descListen_backlog_multiplier' => 'フロントエンドからpgpool-IIへの接続待ち行列の長さ', 'descLoad_balance_mode' => 'レプリケーションモード時にSELECT文を各ノードにロードバランス', 'descLobj_lock_table' => 'ラージオブジェクトのレプリケーションでロック管理に使うためのテーブル名', 'descLog_connections' => '受信した接続のログを出力', diff --git a/nodeStatus.php b/nodeStatus.php index d85c8b2..3a3e7fd 100644 --- a/nodeStatus.php +++ b/nodeStatus.php @@ -127,7 +127,7 @@ $tpl->assign('msgStopPgpool', $message['msgStopPgpool']); $tpl->assign('nodeCount', $nodeCount); $tpl->assign('has_not_loaded_node', $has_not_loaded_node); $tpl->assign('pgpoolIsRunning', $is_pgpool_running); -$tpl->assign('is_superuser', isSuperUser($_SESSION[SESSION_LOGIN_USER])) +$tpl->assign('is_superuser', isSuperUser($_SESSION[SESSION_LOGIN_USER])); // Set params $configValue = readConfigParams('recovery_1st_stage'); @@ -19,7 +19,7 @@ * is" without express or implied warranty. * * @author Ryuma Ando <[email protected]> - * @copyright 2003-2013 PgPool Global Development Group + * @copyright 2003-2014 PgPool Global Development Group * @version SVN: $Id$ */ diff --git a/templates/help/en/pgconfig.tpl b/templates/help/en/pgconfig.tpl index 280e0e3..98cba28 100644 --- a/templates/help/en/pgconfig.tpl +++ b/templates/help/en/pgconfig.tpl @@ -17,34 +17,13 @@ <h2>{$message.strHelp|escape}({$message.strPgConfSetting|escape})</h2> -<div id="submenu"> - <h3>Table of Contents</h3> - <ul> - <li><a href="#connections">Connections</a></li> - <li><a href="#pools">Pools</a></li> - <li><a href="#backends">Backends</a></li> - <li><a href="#logs">Logs</a></li> - <li><a href="#file_locations">File Locations</a></li> - <li><a href="#connection_pooling">Connection Pooling</a></li> - <li><a href="#replication">Replication</a></li> - <li><a href="#load_balancing_mode">Load Balancing Mode</a></li> - <li><a href="#master_slave_mode">Master/Slave Mode</a></li> - <li><a href="#parallel_mode">Parallel Mode and Query Cache</a></li> - <li><a href="#health-check">Health Check</a></li> - <li><a href="#failover">Failover and Failback</a></li> - <li><a href="#online-recovery">Online Recovery</a></li> - {if paramExists('use_watchdog')} - <li><a href="#watchdog">Watchdog</a></li> - {/if} - {if hasMemqcache()} - <li><a href="#memqcache">On Memory Query Cache</a></li> - {/if} - <li><a href="#others">Others</a></li> - </ul> -</div> - <h3>{$message.strSummary|escape}</h3> The content of pgpool.conf that is the configuration file of pgpool set can be displayed and be changed. +<p> +Official documentation:<br> +<a href="http://www.pgpool.net/docs/latest/pgpool-en.html" target="_blank"> +http://www.pgpool.net/docs/latest/pgpool-en.html</a> +</p> <h3>{$message.strFeature|escape}</h3> Please input the value that wants to change and push the update button. @@ -57,2169 +36,6 @@ Please push the update button when input ends. <h4>Deletion of backend host</h4> Please push the delete button at the right of the host setting when you want to delete the back end host who has registered. <br /> -<h3><a name="connections">Connections</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr><th class="category" colspan="2">pgpool Connection Settings</th></tr> - - <tr> - <th id="LISTEN_ADDRESSES"><label>{$message.descListen_addresses|escape}</label> - <p>listen_addresses (string) *</th> - <td> - <p>Specifies the hostname or IP address, on which pgpool-II will accept - TCP/IP connections. <code>'*'</code> accepts - all incoming connections. <code>''</code> disables TCP/IP - connections. - </p> - <p> - Default is <code>'localhost'</code>. - Connections via UNIX domain socket are always accepted. - </p> - </td> - </tr> - - <tr> - <th id="PORT"><label>{$message.descPort|escape}</label> - <p>port (integer) *</th> - <td> - <p> - The port number used by pgpool-II to listen for connections. Default is 9999. - </p> - </td> - </tr> - - <tr> - <th id="SOCKET_DIR"><label>{$message.descSocket_dir|escape}</label> - <p>socket_dir (string) *</th> - <td> - <p>The directory where the UNIX domain socket accepting connections for - pgpool-II will be created. Default is <code>'/tmp'</code>. - Be aware that this socket might be deleted by a cron job. - We recommend to set this value to <code>'/var/run'</code> or such directory. - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">pgpool Communication Manager Connection Settings</th></tr> - - <tr> - <th id="PCP_PORT"><label>{$message.descPcp_port|escape}</label> - <p>pcp_port (integer) *</th> - <td> - <p> - The port number where PCP process accepts connections. Default is 9898. - </p> - </td> - </tr> - - <tr> - <th id="PCP_SOCKET_DIR"><label>{$message.descPcp_socket_dir|escape}</label> - <p>pcp_socket_dir (string) *</th> - <td> - <p>The directory path of the UNIX domain socket accepting - connections for the PCP process. Default is <code>'/tmp'</code>. - Be aware that the socket might be deleted by cron. - We recommend to set this value to <code>'/var/run'</code> or such directory. - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Authentication</th></tr> - <tr> - <th id="ENABLE_POOL_HBA"><label>{$message.descEnable_pool_hba|escape}</label> - <p>enable_pool_hba (bool)</th> - <td> - <p> - If true, use pool_hba.conf for client authentication. - </p> - </td> - </tr> - - <tr> - <th id="POOL_PASSWD"><label>{$message.descPool_passwd|escape}</label> - <p>pool_passwd (string) *</th> - <td> - <p> - Specify the file name of pool_passwd for md5 authentication. - Default value is "pool_passwd". "" disables to read pool_passwd. - </p> - </td> - </tr> - - <tr> - <th id="AUTHENTICATION_TIMEOUT"><label>{$message.descAuthentication_timeout|escape}</label> - <p>authentication_timeout (integer)</th> - <td> - <p>Specify the timeout for pgpool authentication. 0 disables the time out. - Default value is 60. - </p> - </td> - </tr> - - {if paramExists('ssl')} - <tr><th class="category" colspan="2">SSL Connections</th></tr> - - <tr> - <th id="SSL"><label>{$message.descSsl|escape}</label> - <p>ssl (bool) *</th> - <td> - <p> - If true, enable SSL support for both the frontend and backend connections. - Note that <code>ssl_key</code> and <code>ssl_cert</code> - must also be set in order for SSL to work with frontend connections. - </p> - <p> - SSL is off by default. Note that OpenSSL support must also have been configured at compilation time. - </p> - </td> - </tr> - - <tr> - <th><label>{$message.descSsl_key|escape}</label> - <p id="SSL_KEY">ssl_key (string) *</th> - <td> - <p> - The path to the private key file to use for incoming frontend connections. - </p> - <p> - There is no default value for this option, and if left unset SSL will - be disabled for incoming frontend connections. - </p> - </td> - </tr> - - <tr> - <th><label>{$message.descSsl_cert|escape}</label> - <p id="SSL_CERT">ssl_cert (string) *</th> - <td> - <p> - The path to the public x509 certificate file to use for incoming - frontend connections. - </p> - <p> - There is no default value for this option, and if left unset SSL will - be disabled for incoming frontend connections. - </p> - </td> - </tr> - - <tr> - <th id="SSL_CA_CERT"><label>{$message.descSsl_ca_cert|escape}</label> - <p>ssl_ca_cert (string) *</th> - <td> - </td> - </tr> - - <tr> - <th id="SSL_CA_CERT_DIR"><label>{$message.descSsl_ca_cert_dir|escape}</label> - <p>ssl_ca_cert_dir (string) *</th> - <td> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="pools">Pools</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr><th class="category" colspan="2">Pool size</th></tr> - - <tr> - <th id="NUM_INIT_CHILDREN"><label>{$message.descNum_init_children|escape}</label> - <p>num_init_children (integer) *</th> - <td> - <p>The number of preforked pgpool-II server processes. Default is 32. - num_init_children is also the concurrent connections limit to pgpool-II from clients. - If more than num_init_children clients try to connect to pgpool-II, - they are blocked (not rejected) until a connection to any pgpool-II process is closed. - Up to 2 * num_init_children can be queued. - Number of connections to each PostgreSQL is roughly max_pool*num_init_children</p> - - <p>Some hints in addition to above:</p> - <ul> - <li>Canceling a query creates another - connection to the backend; thus, a query cannot be canceled if - all the connections are in use. If you want to ensure that queries can - be canceled, set this value to twice the expected connections.</li> - - <li>PostgreSQL allows concurrent connections for non superusers up - to max_connections - superuser_reserved_connections.</li> - </ul> - - <p>In summary, max_pool, num_init_children, max_connections, - superuser_reserved_connections must satisfy the following formula: - </p> - - <table> - <thead><tr><td colspan="2"></td></tr></thead> - <tr><th>no query canceling needed</th> - <td>max_pool*num_init_children <= (max_connections - superuser_reserved_connections)</td> - </tr> - <tr><th>query canceling needed</th> - <td>max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connections</td> - </tr> - <tfoot><tr><td colspan="2"></td></tr></tfoot> - </table> - - <p> - This parameter can only be set at server start. - </p> - </td> - </tr> - - <tr> - <th id="MAX_POOL"><label>{$message.descMax_pool|escape}</label> - <p>max_pool (integer) *</th> - <td> - <p>The maximum number of cached connections in pgpool-II children processes. - pgpool-II reuses the cached connection if an incoming connection is - connecting to the same database with the same username. - If not, pgpool-II creates a new connection to the backend. - If the number of cached connections exceeds max_pool, - the oldest connection will be discarded, and uses that slot for the new connection. - </p> - <p> - Default value is 4. Please be aware that the number of - connections from pgpool-II processes to the backends may reach - <code><a href="#NUM_INIT_CHILDREN">num_init_children</a></code> * - <code><a href="#MAX_POOL">max_pool</a></code>. - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Life time</th></tr> - - <tr> - <th id="CHILD_LIFE_TIME"><label>{$message.descChild_life_time|escape}</label> - <p>child_life_time (integer)</th> - <td> - <p>A pgpool-II child process' life time in seconds. - When a child is idle for that many seconds, it is terminated and a new child is created. - This parameter is a measure to prevent memory leaks and other unexpected errors. - Default value is 300 (5 minutes). - 0 disables this feature. Note that this doesn't apply for processes - that have not accepted any connection yet. - </p> - </td> - </tr> - - <tr> - <th id="CHILD_MAX_CONNECTIONS"><label>{$message.descChild_max_connections|escape}</label> - <p>child_max_connections (integer)</th> - <td> - <p>A pgpool-II child process will be terminated after this many connections from clients. - This parameter is useful on a server - if it is so busy that <a href=#CHILD_LIFE_TIME">child_life_time</a> and - <a href="#CONNECTION_LIFE_TIME">connection_life_time</a> are never triggered. - Thus this is also usefull to prevent PostgreSQL servers from getting too big. - </p> - </td> - </tr> - - <tr> - <th id="CONNECTION_LIFE_TIME"><label>{$message.descConnection_life_time|escape}</label> - <p>connection_life_time (integer)</th> - <td> - <p>Cached connections expiration time in seconds. An expired - cached connection will be disconnected. Default is 0, which - means the cached connections will not be disconnected.</p> - </td> - </tr> - - <tr> - <th id="CLIENT_IDLE_LIMIT"><label>{$message.descClient_idle_limit|escape}</label> - <p>client_idle_limit (integer)</th> - <td> - <p> Similar to client_idle_limit but only takes effect in the second - stage of recovery. A client being idle for client_idle_limit_in_recovery - seconds since its last query will get disconnected. - This is useful for preventing the pgpool recovery from being - disturbed by a lazy client or if the TCP/IP connection between the client - and pgpool is accidentally down (a cut cable for instance). - If set to -1, disconnect the client immediately. - The default value for client_idle_limit_in_recovery is 0, - which means the feature is turned off. - </p> - <p> - If your clients are very busy, pgpool-II cannot enter the second stage of - recovery whatever value of client_idle_limit_in_recovery you may choose. - In this case, you can set client_idle_limit_in_recovery to - 1 - so that pgpool-II immediately disconnects such busy clients before entering the second stage. - </p> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="backends">Backends</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - <td></td> - </tr> - </thead> - <tbody> - <tr> - <th id="BACKEND_HOSTNAME"><label>{$message.descBackend_hostname|escape}</label> - <p>backend_hostname (string)</th> - <td> - <p>Specifies where to connect with the PostgreSQL backend. - It is used by pgpool-II to communicate with the server. - </p> - <p> - For TCP/IP communication, this parameter can take a hostname or an IP address. - If this begins with a slash, it specifies Unix-domain communication - rather than TCP/IP; the value is the name of the directory - in which the socket file is stored. The default behavior when backend_hostname - is empty (<code>''</code>) is to connect to a Unix-domain socket in <code>/tmp</code>. - </p> - <p> - Multiple backends can be specified by adding a number at the end - of the parameter name (e.g.<code>backend_hostname0</code>). - This number is referred to as "DB node ID", and it starts from 0. - The backend which was given the DB node ID of 0 will be called "Master DB". - When multiple backends are defined, the service can be continued - even if the Master DB is down (not true in some modes). - In this case, the youngest DB node ID alive will be the new Master DB.</p> - <p> - Please note that the DB node which has id 0 has no special meaming - if operated in streaming replication mode. - Rather, you should care about if the DB node is the "primary node" or not. - </p> - <p>If you plan to use only one PostgreSQL server, specify it by - <code>backend_hostname0</code>.</p> - </td> - </tr> - - <tr> - <th id="BACKEND_PORT"><label>{$message.descBackend_port|escape}</label> - <p>backend_port (integer)</th> - <td> - <p>Specifies the port number of the backends. - Multiple backends can be specified by adding a number at the end of the parameter name - (e.g. <code>backend_port0</code>). - If you plan to use only one PostgreSQL server, specify it by <code>backend_port0</code>.</p> - </td> - </tr> - - <tr> - <th id="BACKEND_WEIGHT"><label>{$message.descBackend_weight|escape}</label> - <p>backend_weight (integer)</th> - <td> - <p>Specifies the load balance ratio for the backends. Multiple - backends can be specified by adding a number at the end of the - parameter name (e.g. <code>backend_weight0</code>). If you plan - to use only one PostgreSQL server, specify it by - <code>backend_weight0</code>. In the raw mode, set to 1.</p> - <p> - New backend weights can be added in this parameter by reloading a configuration file. - </p> - <p> - From pgpool-II 2.2.6/2.3 or later, you can change this value by re-loading the configuration file. - This will take effect only for new established client sessions. - This is useful if you want to prevent any query sent to slaves to perform - some administrative work in master/slave mode. - </p> - </td> - </tr> - - <tr> - <th id="BACKEND_DATA_DIRECTORY"><label>{$message.descBackend_data_directory|escape}</label> - <p>backend_data_directory (string) *</th> - <td> - <p>Specifies the database cluster directory of the backends. - Multiple backends can be specified by adding a number - at the end of the parameter name - (e.g. <code>backend_data_directory0</code>). - If you don't plan to use online recovery, you do not need to specify this parameter. - </p> - </td> - </tr> - - {if paramExists('backend_flag')} - <tr> - <th id="BACKEND_FLAG"><label>{$message.descBackend_flag|escape}</label> - <p>backend_flag (string) *</th> - <td> - <p>Controls various backend behavior. - Multiple backends can be specified by adding a number at the end of the parameter name - (e.g. <code>backend_flag0</code>). - </p> - <p> - Currently followings are allowed. - Multiple falgs can be specified by using "|". - </p> - - <table> - <thead><tr><td colspan="2"></td></tr></thead> - <tr><th class="nodec">ALLOW_TO_FAILOVER</th> - <td>Allow to failover or detaching backend. This is the default. - <p>You cannot specify with DISALLOW_TO_FAILOVER at a same time.</p> - </td></tr> - <tr><th class="nodec">DISALLOW_TO_FAILOVER</th> - <td>Disallow to failover or detaching backend. - This is usefull when you protect backend by using HA(High Availability) softwares - such as Heartbeat or Pacemaker. - <p>You cannot specify with ALLOW_TO_FAILOVER at a same time.</p> - </td></tr> - <tfoot><tr><td colspan="2"></td></tr></tfoot> - </table> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="logs">Logs</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - {if paramExists('log_destination')} - <tr><th class="category" colspan="2">Where to log</th></tr> - - <tr> - <th id="LOG_DESTINATION"><label>{$message.descLog_destination|escape}</label> - <p>log_destination (string) *</th> - <td> - <p>PgPool II supports several methods for logging server messages, - including stderr and syslog. The default is to log to stderr. - </p> - <p>Note: you will need to alter the configuration of your system's syslog daemon - in order to make use of the syslog option for log_destination. - PgPool can log to syslog facilities LOCAL0 through LOCAL7 - (see <a href="#SYSLOG_FACILITY">syslog_facility</a>), - but the default syslog configuration on most platforms will discard all such messages. - You will need to add something like - </p> -<pre> -local0.* /var/log/pgpool.log -</pre> - <p>to the syslog daemon's configuration file to make it work.</p> - </td> - </tr> - {/if} - - <tr><th class="category" colspan="2">What to log</th></tr> - - <tr> - <th id="PRINT_TIMESTAMP"><label>{$message.descPrint_timestamp|escape}</label> - <p>print_timestamp (string) *</th> - <td> - <p>Add timestamps to the logs when set to true. Default is true.</p> - </td> - </tr> - - <tr> - <th id="LOG_CONNECTIONS"><label>{$message.descLog_connections|escape}</label> - <p>log_connections (bool)</th> - <td> - <p>If true, all incoming connections will be printed to the log.</p> - </td> - </tr> - - <tr> - <th id="LOG_HOSTNAME"><label>{$message.descLog_hostname|escape}</label> - <p>log_hostname (bool)</th> - <td> - <p> - If true, ps command status will show the client's hostname instead - of an IP address. Also, if <a href="#LOG_CONNECTIONS">log_connections</a> is enabled, - hostname will be logged. - </p> - </td> - </tr> - - <tr> - <th id="LOG_STATEMENT"><label>{$message.descLog_statement|escape}</label> - <p>log_statement (bool)</th> - <td> - <p>Produces SQL log messages when true. This is similar to the - log_statement parameter in PostgreSQL. It produces logs even if the - debug option was not passed to pgpool-II at startup. - </p> - </td> - </tr> - - {if paramExists('log_per_node_statement')} - <tr> - <th id~"LOG_PER_NODE_STATEMENT"><label>{$message.descLog_per_node_statement|escape}</label> - <p>log_per_node_statement (bool)</th> - <td> - <p>Similar to <a href="#LOG_PER_NODE_STATEMENT">log_statement</a>, - except that it prints logs for each DB node separately. - It can be useful to make sure that replication is working, for example. - </p> - </td> - </tr> - {/if} - - {if paramExists('log_standby_delay')} - <tr> - <th id="LOG_STANDBY_DELAY"><label>{$message.descLog_standby_delay|escape}</label> - <p>log_standby_delay (string)</th> - <td> - <p> - Specifies how to log the replication delay. - If 'none' is specified, no log is written. - If 'always', log the delay every time health checking is performed. - If 'if_over_threshold' is specified, the log is written when the delay - exceeds <a href="#DELAY_THRESHOLD">delay_threshold</a>. - The default value for log_standby_delay is 'none'. - You need to reload pgpool.conf if you change this directive. - </p> - </td> - </tr> - {/if} - - {if paramExists('syslog_facility')} - <tr><th class="category" colspan="2">Syslog specific</th></tr> - - <tr> - <th><label>{$message.descSyslog_facility|escape}</label> - <p id="SYSLOG_FACILITY">syslog_facility (string) *</th> - <td> - <p>When logging to syslog is enabled, this parameter determines the syslog "facility" to be used. - You can choose from LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7; - the default is LOCAL0. See also the documentation of your system's syslog daemon. - </p> - </td> - </tr> - - <tr> - <th id="SYSLOG_IDENT"><label>{$message.descSyslog_ident|escape}</label> - <p>syslog_ident (string) *</th> - <td> - <p>When logging to syslog is enabled, this parameter determines the program name - used to identify PgPool messages in syslog logs. The default is pgpool. - </p> - </td> - </tr> - {/if} - - {if paramExists('debug_level')} - <tr><th class="category" colspan="2">Debug</th></tr> - - <tr> - <th id="DEBUG_LEVEL"><label>{$message.descDebug_level|escape}</label> - <p>debug_level (integer)</th> - <td> - <p> - Debug message verbosity level. 0 means no message, greater than 1 - means more verbose message. Default value is 0. - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="file_locations">File Locations</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="LOGDIR"><label>{$message.descLogdir|escape}</label> - <p>logdir (string) *</th> - <td> - <p>pgpool_status is written into this directory.</p> - </td> - </tr> - - {if paramExists('pid_file_name')} - <tr> - <th id="PID_FILE_NAME"><label>{$message.descPid_file_name|escape}</label> - <p>pid_file_name (string) *</th> - <td> - <p>Full path to a file which contains pgpool's process id. - Default is "/var/run/pgpool/pgpool.pid". - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="connection_pooling">Connection Pooling</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="CONNECTION_CACHE"><label>{$message.descConnection_cache|escape}</label> - <p>connection_cache (bool) *</th> - <td>Caches connections to backends when set to true. Default is true.</td> - </tr> - - <tr> - <th id="RESET_QUERY_LIST"><label>{$message.descReset_query_list|escape}</label> - <p>reset_query_list (string)</th> - <td> - <p>Specifies the SQL commands sent to reset the connection - to the backend when exiting a session. Multiple commands can be - specified by delimiting each by ";". - Default is the following, but can be changed to suit your system. -<pre> -reset_query_list = 'ABORT; DISCARD ALL' -</pre> - <p> - Commands differ in each PostgreSQL versions. Here are the recommended settings. - </p> - - <table> - <thead><tr><th>PostgreSQL version</th><th>reset_query_list value</th></tr></thead> - <tr><th>7.1 or before</th><td>ABORT</td></tr> - <tr><th>7.2 to 8.2</th><td>ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT</td></tr> - <tr><th>8.3 or later</th><td>ABORT; DISCARD ALL</td></tr> - <tfoot><tr><td colspan="2"></td></tr></tfoot> - </table> - <p>"ABORT" is not issued when not in a transaction block for 7.4 or later.</p> - </td> - </tr> - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="replication">Replication</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - - <tr> - <th id="REPLICATION_MODE"><label>{$message.descReplication_mode|escape}</label> - <p>replication_mode (bool) *</th> - <td> - <p>Setting to true enables replication mode. Default is false.</p> - </td> - </tr> - - <tr> - <th id="REPLICATE_SELECT"><label>{$message.descReplicate_select|escape}</label> - <p>replicate_select (bool)</th> - <td> - <p>When set to true, pgpool-II replicates SELECTs in replication mode. If false, - pgpool-II only sends them to the Master DB. Default is false. - </p> - <p> - If a SELECT query is inside an explicit transaction block, replicate_select and - <a href="#LOAD_BALANCE_MODE">load_balance_mode</a> will have an effect on how replication works. - Details are shown below. - </p> - - <table> - <thead><tr><td colspan="9"></td></tr></thead> - - <tr> - <th class="nodec">SELECT is inside a transaction block</th> - <td>Y</td><td>Y</td><td>Y</td><td>N</td><td>N</td><td>N</td><td>Y</td><td>N</td> - </tr> - - <tr> - <th class="nodec">replicate_select is true</th> - <td>Y</td><td>Y</td><td>N</td><td>N</td><td>Y</td><td>Y</td><td>N</td><td>N</td> - </tr> - - <tr> - <th class="nodec">load_balance_mode is true</th> - <td>Y</td><td>N</td><td>N</td><td>N</td><td>Y</td><td>N</td><td>Y</td><td>Y</td> - </tr> - - <tr> - <th class="nodec">results(R:replication, M: send only to master, L: load balance)</th> - <td>R</td><td>R</td><td>M</td><td>M</td><td>R</td><td>R</td><td>M</td><td>L</td> - </tr> - - <tfoot><tr><td colspan="9"></td></tr></tfoot> - </table> - </td> - </tr> - - <tr> - <th><label>{$message.descInsert_lock|escape}</label> - <p>insert_lock (bool)</th> - <td> - <p>If replicating a table with SERIAL data type, the SERIAL column value may differ between the backends. - This problem is avoidable by locking the table explicitly - (although, transactions' parallelism will be severely degraded). - To achieve this, however, the following change must be made: - </p> -<pre> -INSERT INTO ... -</pre> - <p> - to - </p> -<pre> -BEGIN; -LOCK TABLE ... -INSERT INTO ... -COMMIT; -</pre> - <p>When <code>insert_lock</code> is true, pgpool-II automatically adds - the above queries each time an INSERT is executed - (if already in transaction, it simply adds LOCK TABLE ....). - </p> - <p>pgpool-II 2.2 or later, it automatically detects whether the table - has a SERIAL columns or not, so it will never lock the table if it does not use SERIAL columns. - </p> - <p>Default value is false.</p> - </td> - </tr> - - {if paramExists('lobj_lock_table')} - <tr> - <th id="LOBJ_LOCK_TABLE"><label>{$message.descLobj_lock_table|escape}</label> - <p>lobj_lock_table (string)</th> - <td> - <p> - This parameter specifies a table name used for large object replication control. - If it is specified, pgpool will lock the table specified by - lobj_lock_table and generate a large object id by looking into - pg_largeobject system catalog and then call lo_create to create the large object. - This procedure guarantees that pgpool will get the same large object id in all DB - nodes in replication mode. - </p> - <p> - The table specified by lobj_lock_table must be created beforehand. If - you create the table in template1, any database created afterward will have it. - </p> - <p> - If lobj_lock_table has empty string(''), the feature is disabled - (thus large object replication will not work). The default value for - lobj_lock_table is ''. - </p> - </td> - </tr> - {/if} - - <tr><th class="category" colspan="2">Degenerate handling</th></tr> - - <tr> - <th id="REPLICATION_STOP_ON_MISMATCH"><label>{$message.descReplication_stop_on_mismatch|escape}</label> - <p>replication_stop_on_mismatch (bool)</th> - <td> - <p>When set to true, if all backends don't return the same packet kind, - the backends that differ from most frequent result set are degenerated. - </p> - <p> - A typical use case is a SELECT statement being part of a transaction, - <a href="#REPLICATE_SELECT">replicate_select</a> set to true, - and SELECT returning a different number of rows among backends. - Non-SELECT statements might trigger this though. - For example, a backend succeeded in an UPDATE, while others failed. - Note that pgpool does NOT examine the content of records returned by SELECT. - </p> - <p> - If set to false, the session is terminated and the backends are not degenerated. - Default is false.</p> - </td> - </tr> - - {if paramExists('failover_if_affected_tuples_mismatch')} - <tr> - <th id="FAILOVER_IF_AFFECTED_TUPLES_MISMATCH"><label>{$message.descFailover_if_affected_tuples_mismatch|escape}</label> - <p>failover_if_affected_tuples_mismatch (bool)</th> - <td> - <p>When set to true, if backends don't return the same number of affected - tuples during an INSERT/UPDATE/DELETE, - the backends that differ from most frequent result set are degenerated. - If the frequencies are same, the group which includes master DB node - (a DB node having the youngest node id) is remained and other groups are degenerated. - </p> - <p> - If set to false, the session is terminated and the backends are not - degenerated. Default is false.</p> - </td> - </tr> - {/if} - - {if paramExists('fail_over_on_backend_error')} - <tr> - <th id="FAIL_OVER_ON_BACKEND_ERROR"><label>{$message.descFail_over_on_backend_error|escape}</label> - <p>fail_over_on_backend_error</th> - <td> - <p> - If true, and an error occurs when reading/writing to the backend communication, - pgpool-II will trigger the fail over procedure. - If set to false, pgpool will report an error and disconnect the session. - If you set this parameter to off, it is recommended that you turn on health checking. - Please note that even if this parameter is set to off, however, pgpool will also do the fail over when - pgpool detects the administrative shutdown of postmaster. - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="load_balancing_mode" id="load_balancing_mode">Load Balancing Mode</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="LOAD_BALANCE_MODE"><label>{$message.descLoad_balance_mode|escape}</label> - <p>load_balance_mode (bool) *</th> - <td> - <p>When set to true, SELECT queries will be - distributed to each backend for load balancing. Default is false.</p> - </td> - </tr> - - <tr> - <th id="IGNORE_LEADING_WHITE_SPACE"><label>{$message.descIgnore_leading_white_space|escape}</label> - <p>ignore_leading_white_space (bool)</th> - <td> - <p>pgpool-II ignores white spaces at the beginning of SQL - queries while in the load balance mode. It is useful if used with - APIs like DBI/DBD:Pg which adds white spaces against the user's will. - </p> - </td> - </tr> - - {if paramExists('white_function_list')} - <tr> - <th id="WHITE_FUNCTION_LIST"><label>{$message.descWhite_function_list|escape}</label> - <p>white_function_list (string)</th> - <td> - <p> - Specify a comma separated list of function names that <strong>do not</strong> - update the database. SELECTs using functions not specified in this list are - neither load balanced, nor replicated if in replication mode. - In master slave mode, such SELECTs are sent to master (primary) only. - </p> - <p>You can use regular expression into the list to match function name, - for example if you have prefixed all your read only function with 'get_' or 'select_' - </p> -<pre> -white_function_list = 'get_.*,select_.*' -</pre> - </td> - </tr> - - <tr> - <th id="BLACK_FUNCTION_LIST"><label>{$message.descBlack_function_list|escape}</label> - <p>black_function_list (string)</th> - <td> - <p> - Specify a comma separated list of function names that <strong>do</strong> - update the database. SELECTs using functions specified in this list are neither - load balanced, nor replicated if in replication mode. - In master slave mode, such SELECTs are sent to master(primary) only. - </p> - <p>You can use regular expression into the list to match function name, - for example if you have prefixed all your updating functions with 'set_', 'update_', 'delete_' or 'insert_': - </p> -<pre> -black_function_list = 'nextval,setval,set_.*,update_.*,delete_.*,insert_.*' -</pre> - <p> - Only one of these two lists can be filled in a configuration. - </p> - <p> - Prior to pgpool-II 3.0, nextval() and setval() were known to do - writes to the database. You can emulate this by using white_function_list and - black_function_list: - </p> -<pre> -white_function_list = '' -black_function_list = 'nextval,setval,lastval,currval' -</pre> - <p> - Please note that we have lastval and currval in addition to nextval and setval. - Though lastval() and currval() are not writing functions, - it is wise to add lastval() and currval() to avoid errors - in the case when these functions are accidentaly load balanced to other DB node. - Because adding to black_function_list will prevent load balancing. - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="master_slave_mode" id="master_slave_mode">Master/Slave Mode</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="MASTER_SLAVE_MODE"><label>{$message.descMaster_slave_mode|escape}</label> - <p>master_slave_mode *</th> - <td> - <p> - If true, use to couple pgpool-II with another master/slave - replication software (like Slony-I and Streaming replication), which is responsible - for doing the actual data replication. - </p> - </td> - </td> - </tr> - - {if paramExists('sr_check_period')} - <tr><th class="category" colspan="2">Streaming</th></tr> - - <tr> - <th id="SR_CHECK_PERIOD"><label>{$message.descSr_check_period|escape}</label> - <p>sr_check_period (integer) *</th> - <td> - <p> - This parameter specifies the interval between the streaming replication - delay checks in seconds. Default is 0, which means the check is disabled. - </p> - </td> - </tr> - - <tr> - <th id="SR_CHECK_USER"><label>{$message.descSr_check_user|escape}</label> - <p>sr_check_user (string) *</th> - <td> - <p> - The user name to perform streaming replication check. This user must - exist in all the PostgreSQL backends. - Otherwise, the check causes an error. - Note that sr_check_user and sr_check_password are used even sr_check_period is 0. - To identify the primary server, pgpool-II sends function call request to each backend. - sr_check_user and sr_check_password are used for this session. - </p> - </td> - </tr> - - <tr> - <th id="SR_CHECK_PASSWORD"><label>{$message.descSr_check_password|escape}</label> - <p>sr_check_password (string) *</th> - <td> - <p> - The password of the user to perform streaming replication check. - If no password is required, specify empty string(''). - </p> - </td> - </tr> - {/if} - - {if paramExists('delay_threshold')} - <tr> - <th id="DELAY_THRESHOLD"><label>{$message.descDelay_threshold|escape}</label> - <p>delay_threshold (integer)</th> - <td> - <p> - Specifies how to log the replication delay. - If 'none' is specified, no log is written. - If 'always', log the delay every time health checking is performed. - If 'if_over_threshold' is specified, the log is written when the delay - exceeds <a href="#DELAY_THRESHOLD">delay_threshold</a>. - The default value for log_standby_delay is 'none'. - You need to reload pgpool.conf if you change this directive. - </p> - </td> - </tr> - {/if} - - {if paramExists('follow_master_command')} - <tr><th class="category" colspan="2">Special commands</th></tr> - <tr> - <th id="FOLLOW_MASTER_COMMAND"><label>{$message.descFollow_master_command|escape}</label> - <p>follow_master_command (string) *</th> - <td> - <p> - This parameter specifies a command to run in master/slave streaming replication mode - only after a master failover. - pgpool-II replaces the following special characters with backend specific information. - </p> - - <table> - <thead><tr><th>Special character</th><th>Description</th></tr></thead> - <tr><td>%d</td><td>Backend ID of a detached node.</td></tr> - <tr><td>%h</td><td>Hostname of a detached node.</td></tr> - <tr><td>%p</td><td>Port number of a detached node.</td></tr> - <tr><td>%D</td><td>Database cluster directory of a detached node.</td></tr> - <tr><td>%M</td><td>Old master node ID.</td></tr> - <tr><td>%m</td><td>New master node ID.</td></tr> - <tr><td>%H</td><td>Hostname of the new master node.</td></tr> - <tr><td>%P</td><td>Old primary node ID.</td></tr> - <tr><td>%%</td><td>'%' character</td></tr> - <tfoot><tr><td colspan="2"></td></tr></tfoot> - </table> - - <p> - You need to reload pgpool.conf if you change follow_master_command. - </p> - <p> - If follow_master_command is not empty, when a master failover is - completed in master/slave streaming replication, - pgpool degenerate all nodes excepted the new master and starts new child processes - to be ready again to accept connections from clients. - After this, pgpool run the command set into the 'follow_master_command' for each - degenerated nodes. Typically the command should be used to recover the slave from the new master - by call the <a href="#pcp_recovery_node">pcp_recovery_node</a> command for example. - </p> - </td> - </tr> - {/if} - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - - -<h3><a name="parallel_mode" id="parallel_mode">Parallel Mode and Query Cache</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="PARALLEL_MODE"><label>{$message.descParallel_mode|escape}</label> - <p>parallel_mode *</th> - <td> - <p> - If true, activate parallel execution of queries. - Tables can be split, and data distributed to each node. - Moreover, the replication and the load balancing features can be used at the same time. - </p> - </td> - </tr> - - {if paramExists('enable_query_cache')} - <tr> - <th id="ENABLE_QUERY_CACHE"><label>{$message.descEnable_query_cache|escape}</label> - <p>enable_query_cache *</th> - <td> - <p> - If true, the Query cache can be used in all modes in pgpool-II. - The query cache allow to reuse the SELECT result to boost the performance. - </p> - </td> - </tr> - {/if} - - <tr> - <th id="PGPOOL2_HOSTNAME"><label>{$message.descPgpool2_hostname|escape}</label> - <p>pgpool2_hostname (string) *</th> - <td> - <p>Where pgpool works.</p> - </td> - </tr> - - <tr><th class="category" colspan="2">System DB info</th></tr> - - <tr> - <th id="SYSTEM_DB_HOSTNAME"><label>{$message.descSystem_db_hostname|escape}</label> - <p>system_db_hostname (string) *</th> - <td> - <p>The hostname where the System DB is. - Specifying the empty string ('') means the System DB is on the same host as - pgpool-II, and will be accessed via a UNIX domain socket. - Default is 'localhost'.</p> - </td> - </tr> - - <tr> - <th id="SYSTEM_DB_PORT"><label>{$message.descSystem_db_port|escape}</label> - <p>system_db_port (integer) *</th> - <td> - <p>The port number for the System DB. Default is 5432.</p> - </td> - </tr> - - <tr> - <th id="SYSTEM_DB_DBNAME"><label>{$message.descSystem_db_dbname|escape}</label> - <p>system_db_dbname (string) *</th> - <td> - <p>The partitioning rules and other information will be defined - in the database specified here. - Default is 'pgpool'. - </td> - </tr> - - <tr> - <th id="SYSTEM_DB_SCHEMA"><label>{$message.descSystem_db_schema|escape}</label> - <p>system_db_schema (string) *</th> - <td> - <p>The partitioning rules and other information will be defined - in the schema specified here. Default value is: - <code>'pgpool_catalog'</code>.</p> - </td> - </tr> - - <tr> - <th id="SYSTEM_DB_USER"><label>{$message.descSystem_db_user|escape}</label> - <p>system_db_user (string) *</th> - <td> - <p>The username to connect to the System DB. Default is 'pgpool'.</p> - </td> - </tr> - - <tr> - <th id="SYSTEM_DB_PASSWORD"><label>{$message.descSystem_db_password|escape}</label> - <p>system_db_password (string) *</th> - <td> - <p>The password for the System DB. If no password is necessary, - set the empty string ('').</p> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="health-check">Health Check</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="HEALTH_CHECK_TIMEOUT"><label>{$message.descHealth_check_timeout|escape}</label> - <p>health_check_timeout (integer)</th> - <td> - <p>pgpool-II periodically tries to connect to the backends - to detect any error on the servers or networks. - This error check procedure is called "health check". - If an error is detected, pgpool-II tries to perform failover or degeneration. - </p> - <p> - This parameter serves to prevent the health check from waiting for a long - time in a case such as un unplugged network cable. - The timeout value is in seconds. Default value is 20. - 0 disables timeout (waits until TCP/IP timeout). - </p> - <p> - This health check requires one extra connection to each backend, - so <code>max_connections</code> in the - <code>postgresql.conf</code> needs to be incremented as needed. - </p> - </td> - </tr> - - <tr> - <th id="HEALTH_CHECK_PERIOD"><label>{$message.descHealth_check_period|escape}</label> - <p>health_check_period (integer)</th> - <td> - <p>This parameter specifies the interval between the health - checks in seconds. Default is 0, which means health check is disabled. - </p> - </td> - </tr> - - <tr> - <th id="HEALTH_CHECK_USER"><label>{$message.descHealth_check_user|escape}</label> - <p>health_check_user (string)</th> - <td> - <p>The user name to perform health check. - This user must exist in all the PostgreSQL backends. - Otherwise, health check causes an error. - </p> - </td> - </tr> - - {if paramExists('health_check_password')} - <tr> - <th id="HEALTH_CHECK_PASSWORD"><label>{$message.descHealth_check_password|escape}</label> - <p>health_check_password (string)</th> - <td> - <p>The password of the user to perform health check.</p> - </td> - </tr> - {/if} - - {if paramExists('health_check_max_retries')} - <tr> - <th id="HEALTH_CHECK_MAX_RETRIES"><label>{$message.descHealth_check_max_retries|escape}</label> - <p>health_check_max_retries (integer)</th> - <td> - <p>The maximum number of times to retry a failed health check - before giving up and initiating failover. - This setting can be useful in spotty networks, when it is expected that health - checks will fail occasionally even when the master is fine. - Default is 0, which means do not retry. - It is advised that you disable <a href="#FAIL_OVER_ON_BACKEND_ERROR">fail_over_on_backend_error</a> - if you want to enable health_check_max_retries</dt>. - </p> - </td> - </tr> - {/if} - - {if paramExists('health_check_retry_delay')} - <tr> - <th id="HEALTH_CHECK_RETRY_DELAY"><label>{$message.descHealth_check_retry_delay|escape}</label> - <p>health_check_retry_delay (integer)</th> - <td> - <p> - The amount of time (in seconds) to sleep between failed health check - retries (not used unless health_check_max_retries is > 0). - If 0, then retries are immediate (no delay). - </p> - </td> - </tr> - {/if} - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="failover" id="failover">Failover and Failback</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="FAILOVER_COMMAND"><label>{$message.descFailover_command|escape}</label> - <p>failover_command</th> - <td> - <p> - This parameter specifies a command to run when a node is detached. - pgpool-II replaces the following special characters with backend specific - information. - </p> - - <table> - <thead><tr><th>Special character</th><th>Description</th></tr></thead> - <tr><td>%d</td><td>Backend ID of a detached node.</td></tr> - <tr><td>%h</td><td>Hostname of a detached node.</td></tr> - <tr><td>%p</td><td>Port number of a detached node.</td></tr> - <tr><td>%D</td><td>Database cluster directory of a detached node.</td></tr> - <tr><td>%M</td><td>Old master node ID.</td></tr> - <tr><td>%m</td><td>New master node ID.</td></tr> - <tr><td>%H</td><td>Hostname of the new master node.</td></tr> - <tr><td>%P</td><td>Old primary node ID.</td></tr> - <tr><td>%%</td><td>'%' character</td></tr> - <tfoot><tr><td colspan="2"></td></tr></tfoot> - </table> - - <p> - When a failover is performed, pgpool kills all its child processes, which - will in turn terminate all active sessions to pgpool. Then pgpool invokes - the failover_command and waits for its completion. - After this, pgpool starts new child processes and is ready again to accept - connections from clients. - </p> - </td> - </tr> - - <tr> - <th id="FAILBACK_COMMAND"><label>{$message.descFailback_command|escape}</label> - <p>failback_command</th> - <td> - <p> - This parameter specifies a command to run when a node is attached. - pgpool-II replaces special the following characters with backend specific - information. - </p> - - <table> - <thead><tr><th>Special character</th><th>Description</th></tr></thead> - <tr><td>%d</td><td>Backend ID of an attached node.</td></tr> - <tr><td>%h</td><td>Hostname of an attached node.</td></tr> - <tr><td>%p</td><td>Port number of an attached node.</td></tr> - <tr><td>%D</td><td>Database cluster path of an attached node.</td></tr> - <tr><td>%M</td><td>Old master node</td></tr> - <tr><td>%m</td><td>New master node</td></tr> - <tr><td>%H</td><td>Hostname of the new master node.</td></tr> - <tr><td>%P</td><td>Old primary node ID.</td></tr> - <tr><td>%%</td><td>'%' character</td></tr> - <tfoot><tr><td colspan="2"></td></tr></tfoot> - </table> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - - -<h3><a name="online-recovery">Online Recovery</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="RECOVERY_USER"><label>{$message.descRecovery_user|escape}</label> - <p>recovery_user (string)</th> - <td> - <p> - This parameter specifies a PostgreSQL username for online recovery. - Default is 'nobody'. - </p> - </td> - </tr> - - <tr> - <th id~"RECOVERY_PASSWORD"><label>{$message.descRecovery_password|escape}</label> - <p>recovery_password (string)</th> - <td> - <p> - This parameter specifies a PostgreSQL password for online recovery. - </p> - </td> - </tr> - - <tr> - <th id="RECOVERY_1ST_STAGE"><label>{$message.descRecovery_1st_stage_command|escape}</label> - <p>recovery_1st_stage_command (string)</th> - <td> - <p> - This parameter specifies a command to be run by master(primary) PostgreSQL server - at the first stage of online recovery. - The command file must be put in the database cluster directory for security reasons. - For example, if recovery_1st_stage_command = 'sync-command', - then pgpool-II executes $PGDATA/sync-command. - </p> - <p> - recovery_1st_stage_command will receive 3 parameters as follows: - </p> - <ol> - <li>path to master(primary) database cluster</li> - <li>PostgreSQL host name to be recovered</li> - <li>path to database cluster to be recovered</li> - </ol> - <p> - Note that pgpool-II <b>accepts</b> connections and queries while - recovery_1st_stage command is executed. You can retrieve and update data during this stage. - </p> - </td> - </tr> - - <tr> - <th id="RECOVERY_2ND_STAGE"><label>{$message.descRecovery_2nd_stage_command|escape}</label> - <p>recovery_2nd_stage_command (string)</th> - <td> - <p> - This parameter specifies a command to be run by master(primary) PostgreSQL server - at the second stage of online recovery. - The command file must be put in the database cluster directory for security reasons. - For example, if recovery_2nd_stage_command = 'sync-command', then - pgpool-II executes $PGDATA/sync-command. - </p> - <p> - recovery_2nd_stage_command will receive 3 parameters as follows: - </p> - <ol> - <li>path to master(primary) database cluster</li> - <li>PostgreSQL host name to be recovered</li> - <li>path to database cluster to be recovered</li> - </ol> - </p> - <p> - Note that pgpool-II <b>does not accept</b> connections and queries while - recovery_2nd_stage_command is running. - Thus if a client stays connected for a long time, - the recovery command won't be executed. pgpool-II waits - until all clients have closed their connections. The command is only executed - when no client is connected to pgpool-II anymore. - </p> - </td> - </tr> - - <tr> - <th id="RECOVERY_TIMEOUT"><label>{$message.descRecovery_timeout|escape}</label> - <p>recovery_timeout (integer)</th> - <td> - <p> - pgpool does not accept new connections during the second stage. If a client - connects to pgpool during recovery processing, it will have to wait for the end of the recovery. - </p> - <p> - This parameter specifies recovery timeout in sec. If this timeout is reached, - pgpool cancels online recovery and accepts connections. 0 means no wait. - </p> - </td> - </tr> - - {if paramExists('client_idle_limit_in_recovery')} - <tr> - <th id="CLIENT_IDLE_LIMIT_IN_RECOVERY"><label>{$message.descClient_idle_limit_in_recovery|escape}</label> - <p>client_idle_limit_in_recovery (integer)</th> - <td> - <p> Similar to client_idle_limit but only takes effect in the second - stage of recovery. A client being idle for client_idle_limit_in_recovery - seconds since its last query will get disconnected. - This is useful for preventing the pgpool recovery from being - disturbed by a lazy client or if the TCP/IP connection between the client - and pgpool is accidentally down (a cut cable for instance). - If set to -1, disconnect the client immediately. - The default value for client_idle_limit_in_recovery is 0, - which means the feature is turned off. - </p> - <p> - If your clients are very busy, pgpool-II cannot enter the second stage of - recovery whatever value of client_idle_limit_in_recovery you may choose. - In this case, you can set client_idle_limit_in_recovery to -1 - so that pgpool-II immediately disconnects such busy clients before entering the second stage. - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - - -{if paramExists('use_watchdog')} -<h3><a name="watchdog" id="watchdog">Watchdog</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="4">Enabling</th></tr> - - <tr> - <th id="USE_WATCHDOG"><label>{$message.descUse_watchdog|escape}</label> - <p>use_watchdog (bool) *</th> - <td> - <p>If on, activates watchdog. Default is off. </p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Connection to up stream servers</th></tr> - - <tr> - <th id="TRUSTED_SERVERS"><label>{$message.descTrusted_servers|escape}</label> - <p>trusted_servers (string) *</th> - <td> - <p> - The list of trusted servers to check the up stream connections. - Each server is required to respond to ping. - Specify a comma separated list of servers such as "hostA,hostB,hostC". - </p> - </td> - </tr> - - <tr> - <th id="PING_PATH"><label>{$message.descPing_path|escape}</label> - <p>ping_path (string) *</th> - <td> - <p>This parameter specifies a path of ping command for monitoring connection to the upper servers. - Set the only path such as "/bin". </p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Watchdog communication Settings</th></tr> - - <tr> - <th id="WD_HOSTNAME"><label>{$message.descWd_hostname|escape}</label> - <p>wd_hostname (string) *</th> - <td> - <p>Specifies the hostname or IP address for mutual monitoring of watchdog processes. </p> - </td> - </tr> - - <tr> - <th id="WD_PORT"><label>{$message.descWd_port|escape}</label> - <p>wd_port (integer) *</th> - <td> - <p>Specifies the port number for mutual monitoring of watchdog processes. </p> - </td> - </tr> - - {if paramExists('wd_authkey')} - <tr> - <th id="WD_AUTHKEY"><label>{$message.descWd_authkey|escape}</label> - <p>wd_authkey (string) *</th> - <td> - <p>Specifies the authentication key used in watchdog communication. - All the pgpool-II must have the same key. Packets from watchdog of wrong key will be rejects. - This authentication is applied also for heatrbeat singals if lifecheck method is heartbeat mode.</p> - <p>If this is empty (default), watchdog doesn't conduct authenticate. </p> - </td> - </tr> - {/if} - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Virtual IP address</th></tr> - - <tr> - <th id="DELEGATE_IP"><label>{$message.descDelegate_IP|escape}</label> - <p>delegate_IP (string) *</th> - <td> - <p>Specifies the virtual IP address (VIP) of pgpool-II that is connected from client servers - (application servers etc.). - When a pgpool is switched from standby to active, the pgpool takes over this VIP. </p> - </td> - </tr> - - <tr> - <th id="IFCONFIG_PATH"><label>{$message.descIfconfig_path|escape}</label> - <p>ifconfig_path (string) *</th> - <td> - <p>This parameter specifies a path of a command to switch the IP address. - Set the only path such as "/sbin". </p> - </td> - </tr> - - <tr> - <th id="IF_UP_CMD"><label>{$message.descIf_up_cmd|escape}</label> - <p>if_up_cmd (string) *</th> - <td> - <p>This parameter specifies a command to bring up the virtual IP. - Set the command and parameters such as "<code>ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0</code>". - $_IP_$ is replaced by the IP address specified in <a href="#DELEGATE_IP">delegate_IP</a>. </p> - </td> - </tr> - - <tr> - <th id="IF_DOWN_CMD"><label>{$message.descIf_down_cmd|escape}</label> - <p>if_down_cmd (string) *</th> - <td> - <p>This parameter specifies a command to bring down the virtual IP. - Set the command and parameters such as "<code>ifconfig eth0:0 down</code>". </p> - </td> - </tr> - - <tr> - <th id="ARPING_PATH"><label>{$message.descArping_path|escape}</label> - <p>arping_path (string) *</th> - <td> - <p>This parameter specifies a path of a command to send an ARP request after the virtual IP is switched. - Set the only path such as "/usr/sbin". </p> - </td> - </tr> - - <tr> - <th id="ARPING_CMD"><label>{$message.descArping_cmd|escape}</label> - <p>arping_cmd (string) *</th> - <td> - <p>This parameter specifies a command to send an ARP request after the virtual IP is switched. - Set the command and parameters such as "<code>arping -U $_IP_$ -w 1</code>". - $_IP_$ is replaced by the IP address specified in <a href="DELEGATE_IP">delegate_IP</a>. </p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - {if paramExists('clear_memqcache_on_escalation')} - <tr><th class="category" colspan="2">Behaivor on escalation Setting</th></tr> - - <tr> - <th id="CLEAR_MEMQCACHE_ON_ESCALATION"><label>{$message.descClear_memqcache_on_escalation|escape}</label> - <p>clear_memqcache_on_escalation (bool) *</th> - <td> - <p>If this is on, watchdog clears all the query cache in the shared memory - when pgpool-II escaltes to active. - This prevents the new active pgpool-II from using old query caches inconsistence to the old active. - Default is on.</p> - </td> - </tr> - - <tr> - <th id="WD_ESCALATION_COMMAND"><label>{$message.descWd_escalation_command|escape}</label> - <p>wd_escalation_command (string) *</th> - <td> - <p>pgpool-II がアクティブに昇格した時に、ここで指定したコマンドが実行されます。 - コマンドは、仮想 IP が立ち上がる直前のタイミングで実行されます。 </p> - </td> - </tr> - {/if} - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Lifecheck Setting (common)</th></tr> - - {if paramExists('wd_lifecheck_method')} - <tr> - <th id="WD_LIFECHECK_METHOD"><label>{$message.descWd_lifecheck_method|escape}</label> - <p>wd_lifecheck_method (string) *</th> - <td> - <p>Specifies the method of life check. This is either of 'heartbeat' (default) or 'query'. </p> - <dl> - <dt>heartbeat</dt> - <dd> - Watchdog sends heartbeat singals (UDP packets) periodically to other pgpool-II. - Watchdog also receives the signals from other pgpool-II. - If there are no signal for a certain period, watchdog regards is as failure of the pgpool-II. - </dd> - <dt>query</dt> - <dd>watchdog sends monitoring queries to other pgpool-II and checks the response.</dd> - </dl> - </td> - </tr> - {/if} - - <tr> - <th id="WD_INTERVAL"><label>{$message.descWd_interval|escape}</label> - <p>wd_interval (integer) *</th> - <td> - <p>This parameter specifies the interval between life checks of pgpool-II in second. - (A number greater than or equal to 1) </p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - {if paramExists('wd_lifecheck_method')} - <tr><th class="category" colspan="2">Lifecheck Setting (heartbeat mode)</th></tr> - - <tr> - <th id="WD_HEARTBEAT_PORT"><label>{$message.descWd_heartbeat_port|escape}</label> - <p>wd_heartbeat_port (integer) *</th> - <td> - <p>Specifies the port number to receive heartbeat signals.</p> - </td> - </tr> - - <tr> - <th id="WD_HEARTBEAT_KEEPALIVE"><label>{$message.descWd_heartbeat_keepalive|escape}</label> - <p>wd_heartbeat_keepalive (integer) *</th> - <td> - <p>Specifies the interval time in seconds of sending heartbeat signals. Default is 2.</p> - </td> - </tr> - - <tr> - <th id="WD_HEARTBEAT_DEADTIME"><label>{$message.descWd_heartbeat_deadtime|escape}</label> - <p>wd_heartbeat_deadtime (integer) *</th> - <td> - <p>If there are no heartbeat signal for the period specified by this option, - watchdog regards it as failure of the remote pgpool-II.</p> - </td> - </tr> - - <tr> - <th id="HEARTBEAT_DESTINATION"><label>{$message.descHeartbeat_destination|escape}</label> - <p>heartbeat_destination (string) *</th> - <td> - <p>Specifies the destination of heartbeat signals by IP address or hostname. - You can use multiple destination. - The number at the end of the parameter name is referred as "destination number", - and it starts from 0. - This works only heartbeat mode.</p> - </td> - </tr> - - <tr> - <th id="HEARTBEAT_DESTINATION_PORT"><label>{$message.descHeartbeat_destination_port|escape}</label> - <p>heartbeat_destination (string) *</th> - <td> - <p>Specifies the port number of destination of heartbeat signals - which is specified by <a href="HEARTBEAT_DESTINATION">heartbeat_destinationX</a>. - This is usually the same value as <a href="WD_HEARTBEAT_PORT">wd_heartbeat_port</a> - You must use another value if the port number is unusable on a certain host or - there are more than two pgpool-IIs in a host. - The number at the end of the parameter name is referred as "destination number", - and it starts from 0. - This works only heartbeat mode.</p> - </td> - </tr> - - <tr> - <th id="HEARTBEAT_DEVICE"><label>{$message.descHeartbeat_device|escape}</label> - <p>heartbeat_device (string) *</th> - <td> - <p>Specifies the network device name for sending heartbeat signals to - destination specified by <a href="HEARTBEAT_DESTINATION">heartbeat_destinationX</a>. - You can use the same device for different distinations. - The number at the end of the parameter name is referred as "destination number", - and it starts from 0. - This works only heartbeat mode. - In addition, this works only when pgpool-II has root privilege and are running on Linux, - because this uses SO_BINDTODEVICE socket option.</p> - </td> - </tr> - {/if} - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Lifecheck Setting (query mode)</th></tr> - - <tr> - <th id="WD_LIFE_POINT"><label>{$message.descWd_life_point|escape}</label> - <p>wd_life_point (string) *</th> - <td> - <p>The times to retry a failed life check of pgpool-II. (A number greater than or equal to 1) </p> - </td> - </tr> - - <tr> - <th id="WD_LIFECHECK_QUERY"><label>{$message.descWd_lifecheck_query|escape}</label> - <p>wd_lifecheck_query (string) *</th> - <td> - <p>Actual query to check pgpool-II. Default is "SELECT 1".</p> - </td> - </tr> - - {if paramExists('wd_lifecheck_dbname')} - <tr> - <th id="WD_LIFECHECK_DBNAME"><label>{$message.descWd_lifecheck_dbname|escape}</label> - <p>wd_lifecheck_dbnam(string) *</th> - <td> - <p>The database name connected for checking pgpool-II. Default is "template1"</p> - </td> - </tr> - - <tr> - <th id="WD_LIFECHECK_USER"><label>{$message.descWd_lifecheck_user|escape}</label> - <p>wd_lifecheck_user(string) *</th> - <td> - <p>The user name to check pgpool-II. This user must exist in all the PostgreSQL backends. - Default is "nobody" .</p> - </td> - </tr> - - <tr> - <th id="WD_LIFECHECK_PASSWORD"><label>{$message.descWd_lifecheck_password|escape}</label> - <p>wd_lifecheck_query (string) *</th> - <td> - <p>The password of the user to check pgpool-II. Default is "".</p> - </td> - </tr> - {/if} - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Servers to monitor</th></tr> - - <tr> - <th id="OTHER_PGPOOL_HOSTNAME"><label>{$message.descOther_pgpool_hostname|escape}</label> - <p>other_pgpool_hostname (string)</th> - <td> - <p>Specifies the hostname pgpool-II server to be monitored. - The number at the end of the parameter name is referred as "server id", and it starts from 0. </p> - </td> - </tr> - - <tr> - <th id="OTHER_PGPOOL_PORT"><label>{$message.descOther_pgpool_port|escape}</label> - <p>other_pgpool_port (integer)</th> - <td> - <p>Specifies the port number for pgpool on pgpool-II server to be monitored. - The number at the end of the parameter name is referred as "server id", and it starts from 0. - </p> - </td> - </tr> - - <tr> - <th id="OTHER_WD_PORT"><label>{$message.descOther_wd_port|escape}</label> - <p>other_wd_port (integer)</th> - <td> - <p>Specifies the port number for watchdog on pgpool-II server to be monitored. - The number at the end of the parameter name is referred as "server id", and it starts from 0. - </p> - </td> - </tr> - - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> -{/if} - - -{if hasMemqcache()} -<h3><a name="memqcache" id="memqcache">On Memory Query Cache</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="MEMORY_CACHE_ENABLED"><label>{$message.descMemory_cache_enabled|escape}</label> - <p>memory_cache_enabled (bool)</th> - <td> - <p> - To enable the memory cache functionality, set this to on (default is off). - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_METHOD"><label>{$message.descMemqcache_method|escape}</label> - <p>memqcache_method (string) *</th> - <td> - <p> - You can choose a cache strage: shared memory or <a href="http://memcached.org">memcached</a> - (you can't use the both). - Query cache with shared memory is fast and easy because you don't have to install and config memcached, - but restricted the max size of cache by the one of shared memory. - Query cache with memcached needs a overhead to access network, but you can set the size as you like. - </p> - <p> - Memory cache behavior can be specified by memqcache_method directive. - Either "shmem"(shared memory) or "memcached". Default is shmem. - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Memcached specific</th></tr> - - <tr> - <th id="MEMQCACHE_MEMCACHED_HOST"><label>{$message.descMemqcache_memcached_host|escape}</label> - <p>memqcache_memcached_host (string) *</th> - <td> - <p> - Specify the host name or the IP adddress in which memcached works. - If it is the same one as pgpool-II, set 'localhost'. - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_MEMCACHED_PORT"><label>{$message.descMemqcache_memcached_port|escape}</label> - <p>memqcache_memcached_port (integer) *</th> - <td> - <p> - Specify the port number of memcached. Default is 11211. - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Shared memory specific</th></tr> - - <tr> - <th id="MEMQCACHE_TOTAL_SIZE"><label>{$message.descMemqcache_total_size|escape}</label> - <p>memqcache_total_size (integer) *</th> - <td> - <p> - Specify the size of shared memory as cache strage in bytes. - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_MAX_NUM_CACHE"><label>{$message.descMemqcache_max_num_cache|escape}</label> - <p>memqcache_max_num_cache (integer) *</th> - <td> - <p> - Specify the number of cache entries. - This is used to define the size of cache management space - (you need this in addition to <a href="#MEMQCACHE_TOTAL_SIZE">memqcache_total_size</a>). - The management space size can be calculated by: - <a href="#MEMQCACHE_MAX_NUM_CACHE">memqcache_max_num_cache</a> * 48 bytes. - Too small number will cause an error while registering cache. - On the other hand too large number is just a waste of space. - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_CACHE_BLOCK_SIZE"><label>{$message.descMemqcache_cache_block_size|escape}</label> - <p>memqcache_cache_block_size (integer) *</th> - <td> - <p> - If cache storage is shared memory, pgpool uses the memory devided by memqcache_cache_block_size. - SELECT result is packed into the block. - However because the SELECT result cannot be placed in several blocks, it cannot be cached if it is larger - than memqcache_cache_block_size. - memqcache_cache_block_size must be greater or equal to 512. - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Common</th></tr> - - <tr> - <th id="MEMQCACHE_EXPIRE"><label>{$message.descMemqcache_expire|escape}</label> - <p>memqcache_expire (integer) *</th> - <td> - <p> - If the size of a SELECT result is larger than memqcache_maxcache bytes, - </p> - <p> - To avoid this problem, you have to set memqcache_maxcache larger. - But if you use shared memory as the cache strage, - it must be lower than <a href="#MEMQCACHE_CACHE_BLOCK_SIZE">memqcache_cache_block_size</a>. - If memqcached, it must be lower than the size of slab (default is 1 MB). - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_MAXCACHE"><label>{$message.descMemqcache_maxcache|escape}</label> - <p>memqcache_maxcache (integer) *</th> - <td> - <p> - If the size of a SELECT result is larger than memqcache_maxcache bytes. - </p> - <p> - To avoid this problem, you have to set memqcache_maxcache larger. - But if you use shared memory as the cache strage, - it must be lower than <a href="#MEMQCACHE_CACHE_BLOCK_SIZE">memqcache_cache_block_size</a>. - If memqcached, it must be lower than the size of slab (default is 1 MB). - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_AUTO_CACHE_INVALIDATION"><label>{$message.descMemqcache_auto_cache_invalidation|escape}</label> - <p>memqcache_auto_cache_invalidation (bool) *</th> - <td> - <p> - If on, automatically deletes cache realted to the updated tables. - If off, does not delete caches. Default is on. - This parameter and <a href="#MEMQCACHE_EXPIRE">memqcache_expire</a>. are orthogonal. - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_OIDDIR"><label>{$message.descMemqcache_oiddir|escape}</label> - <p>memqcache_oiddir (string) *</th> - <td> - <p> - Full path to the directory where oids of tables used by SELECTs are stored. - Under memqcache_oiddir there are directories named database oids, - and under each of them there are files named table oids used by SELECTs. - In the file pointers to query cache are stored. - They are used as keys to delete caches. - </p> - <p> - Directories and files under memqcache_oiddir are deleted whenever pgpool-II restarts. - </p> - </td> - </tr> - - <tr> - <th id="WHITE_MEMQCACHE_TABLE_LIST"><label>{$message.descWhite_memqcache_table_list|escape}</label> - <p>white_memqcache_table_list (string)</th> - <td> - <p> - Specify a comma separated list of table names whose SELECT results are to be cached even if - they are VIEWs or unlogged tables. You can use regular expression (to which added automatically ^ and $). - </p> - <p> - TABLEs and VIEWs in both of white_memqcache_table_list and - <a href="#BLACK_MEMQCACHE_TABLE_LIST">black_memqcache_table_list</a> are cached. - </p> - </td> - </tr> - - <tr> - <th id="BLACK_MEMQCACHE_TABLE_LIST"><label>{$message.descBlack_memqcache_table_list|escape}</label> - <p>black_memqcache_table_list(string)</th> - <td> - <p> - Specify a comma separated list of table names whose SELECT results are <strong>NOT</strong> to be cached. - You can use regular expression (to which added automatically ^ and $). - </p> - </td> - </tr> - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> -{/if} - - -{if paramExists('relcache_expire')} -<h3><a name="others">Others</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="RELCACHE_EXPIRE"><label>{$message.descRelcache_expire|escape}</label> - <p>relcache_expire (integer)</th> - <td> - <p> - Life time of relation cache in seconds. 0 means no cache - expiration(the default). - The relation cache is used for cache the query result against PostgreSQL - system catalog to obtain various information including table structures - or if it's a temporary table or not. The cache is maintained in a pgpool - child local memory and being kept as long as it survives. - </p> - <p> - If someone modify the table by using ALTER TABLE or some such, the relcache - is not consistent anymore. - </p> - <p> - For this purpose, relcache_expiration controls the life time of the cache. - </p> - </td> - </tr> - - {if paramExists('relcache_size')} - <tr> - <th id="RELCACHE_SIZE"><label>{$message.descRelcache_size|escape}</label> - <p>relcache_size (integer)</th> - <td> - <p>Size of relation cache in seconds. Default is 256. - If you see following message frequently, increase the number. </p> -<pre> -"pool_search_relcache: cache replacement happend" -</pre> - </td> - </tr> - {/if} - - {if paramExists('check_temp_table')} - <th id="CHECK_TEMP_TABLE"><label>{$message.descCheck_temp_table|escape}</label> - <p>check_temp_table (bool)</th> - <td> - <p>If on, enable temporary table check in SELECT statements. - This initiates queries against system catalog of primary/master thus increases load of primary/master. - If you are absolutely sure that your system never uses temporary tables and - you want to save access to primary/master, you could turn this off. Default is on.</p> - </td> - </tr> - {/if} - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> -{/if} - </div> <hr class="hidden" /> <div id="footer"> diff --git a/templates/help/ja/pgconfig.tpl b/templates/help/ja/pgconfig.tpl index 3ca126b..36bee78 100644 --- a/templates/help/ja/pgconfig.tpl +++ b/templates/help/ja/pgconfig.tpl @@ -17,34 +17,13 @@ <h2>{$message.strHelp|escape}({$message.strPgConfSetting|escape})</h2> -<div id="submenu"> - <h3>Table of Contents</h3> - <ul> - <li><a href="#connections">Connections</a></li> - <li><a href="#pools">Pools</a></li> - <li><a href="#backends">Backends</a></li> - <li><a href="#logs">Logs</a></li> - <li><a href="#file_locations">File Locations</a></li> - <li><a href="#connection_pooling">Connection Pooling</a></li> - <li><a href="#replication">Replication</a></li> - <li><a href="#load_balancing_mode">Load Balancing Mode</a></li> - <li><a href="#master_slave_mode">Master/Slave Mode</a></li> - <li><a href="#parallel_mode">Parallel Mode and Query Cache</a></li> - <li><a href="#health-check">Health Check</a></li> - <li><a href="#failover">Failover and Failback</a></li> - <li><a href="#online-recovery">Online Recovery</a></li> - {if paramExists('use_watchdog')} - <li><a href="#watchdog">Watchdog</a></li> - {/if} - {if hasMemqcache()} - <li><a href="#memqcache">On Memory Query Cache</a></li> - {/if} - <li><a href="#others">Others</a></li> - </ul> -</div> - <h3>{$message.strSummary|escape}</h3> <p>pgpoolの設定ファイルであるpgpool.confの設定内容を表示・変更することができます</p> +<p> +公式ドキュメント:<br> +<a href="http://www.pgpool.net/docs/latest/pgpool-ja.html" target="_blank"> +http://www.pgpool.net/docs/latest/pgpool-ja.html</a> +</p> <h3>{$message.strFeature|escape}</h3> <p>変更したい値を入力して更新ボタンを押してください。</p> @@ -65,2224 +44,6 @@ <p>登録してあるバックエンドホストを削除したい場合には、そのホスト設定の右側にある 削除ボタンを押してください。</p> - -<h3><a name="connections">Connections</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr><th class="category" colspan="2">pgpool Connection Settings</th></tr> - - <tr> - <th id="LISTEN_ADDRESSES"><label>{$message.descListen_addresses|escape}</label> - <p>listen_addresses (string) *</th> - <td> - <p> - pgpool-II が TCP/IP コネクションを受け付けるアドレスをホスト名またはIPアドレスで指定します。 - 「*」を指定するとすべての IP インタフェースからのコネクションを受け付けます。 - 「''」を指定すると TCP/IP コネクションを受け付けません。 - </p> - <p>デフォルト値は「localhost」です。 - UNIX ドメインソケット経由のコネクションは常に受け付けます。 - </p> - </td> - </tr> - - <tr> - <th id="PORT"><label>{$message.descPort|escape}</label> - <p>port (integer) *</th> - <td> - <p> - pgpool-IIがコネクションを受け付けるポート番号です。 - </p> - <p> - デフォルト値は 9999 です。 - </p> - </td> - </tr> - - <tr> - <th id="SOCKET_DIR"><label>{$message.descSocket_dir|escape}</label> - <p>socket_dir (string) *</th> - <td> - <p> - pgpool-IIがコネクションを受け付けるUNIXドメインソケットを置くディレクトリです。 - このソケットは、cronによって削除されることがあるので注意してください。 - <code>'/var/run'</code>などのディレクトリに変更することをお勧めします。 - </p> - <p> - デフォルト値は'/tmp'です。 - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">pgpool Communication Manager Connection Settings</th></tr> - - <tr> - <th id="PCP_PORT"><label>{$message.descPcp_port|escape}</label> - <p>pcp_port (integer) *</th> - <td> - <p> - pcpが使用するポート番号です。 - </p> - </td> - </tr> - - <tr> - <th id="PCP_SOCKET_DIR"><label>{$message.descPcp_socket_dir|escape}</label> - <p>pcp_socket_dir (string) *</th> - <td> - <p> - pcpがコネクションを受け付けるUNIXドメインソケットを置くディレクトリです。 - デフォルト値は'/tmp'です。 - このソケットは、cronによって削除されることがあるので注意してください。 - <code>'/var/run'</code>などのディレクトリに変更することをお勧めします。 - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Authentication</th></tr> - <tr> - <th id="ENABLE_POOL_HBA"><label>{$message.descEnable_pool_hba|escape}</label> - <p>enable_pool_hba (bool)</th> - <td> - <p>true ならば、pool_hba.conf に従ってクライアント認証を行います。</p> - <p>デフォルト値は false です。</p> - </td> - </tr> - - <tr> - <th id="POOL_PASSWD"><label>{$message.descPool_passwd|escape}</label> - <p>pool_passwd (string) *</th> - <td> - <p>md5 認証で用いる認証ファイルのファイル名を指定します。</p> - <p>デフォルト値は "pool_passwd" です。</p> - <p>空文字列("")を指定すると 認証ファイルの読込は無効になります。 </p> - </td> - </tr> - - <tr> - <th id="AUTHENTICATION_TIMEOUT"><label>{$message.descAuthentication_timeout|escape}</label> - <p>authentication_timeout (integer)</th> - <td> - <p> - 認証処理のタイムアウト時間を秒単位で指定します。0 を指定するとタイムアウトを無効にします。 - authentication_timeout のデフォルト値は 60 です。 - </p> - </td> - </tr> - - {if paramExists('ssl')} - <tr><th class="category" colspan="2">SSL Connections</th></tr> - - <tr> - <th id="SSL"><label>{$message.descSsl|escape}</label> - <p>ssl (bool) *</th> - <td> - <p> - true ならば pgpool-II とフロントエンド、pgpool-II とバックエンドの間の SSL 接続が可能になります。 - なお、pgpool-II とフロントエンドの接続に SSL が利用できるためには、 - <code>ssl_key</code> と <code>ssl_cert</code> が設定されてなければなりません。 - </p> - <p> - デフォルトでは SSL サポートはオフになっています。 - </p> - </td> - </tr> - - <tr> - <th><label>{$message.descSsl_key|escape}</label> - <p id="SSL_KEY">ssl_key (string) *</th> - <td> - <p> - フロントエンドとの接続に使用するプライベートキーファイルのフルパスを指定します。 - </p> - <p> - ssl_key のデフォルト値はありません。 - ssl_key の設定がない場合は、フロントエンドとの接続で SSL が使用されなくなります。 - </p> - </td> - </tr> - - <tr> - <th><label>{$message.descSsl_cert|escape}</label> - <p id="SSL_CERT">ssl_cert (string) *</th> - <td> - <p> - フロントエンドとの接続に使用する公開x509証明書のフルパスを指定します。 - </p> - <p> - ssl_cert のデフォルト値はありません。 - ssl_cert の設定がない場合は、フロントエンドとの接続で SSL が使用されなくなります。 - </p> - </td> - </tr> - - <tr> - <th id="SSL_CA_CERT"><label>{$message.descSsl_ca_cert|escape}</label> - <p>ssl_ca_cert (string) *</th> - <td> - </td> - </tr> - - <tr> - <th id="SSL_CA_CERT_DIR"><label>{$message.descSsl_ca_cert_dir|escape}</label> - <p>ssl_ca_cert_dir (string) *</th> - <td> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="pools">Pools</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr><th class="category" colspan="2">Pool size</th></tr> - - <tr> - <th id="NUM_INIT_CHILDREN"><label>{$message.descNum_init_children|escape}</label> - <p>num_init_children (integer) *</th> - <td> - <p> - prefork する pgpool-II のサーバプロセスの数です。デフォルト値は 32 になっています。 - これが、pgpool-II に対してクライアントが同時に接続できる上限の数になります。 - これを超えた場合は、そのクライアントは、pgpool-II のどれからのプロセスへのフロントエンドの接続が終了するまで - 待たされます(PostgreSQL と違ってエラーになりません)。 - 待たされる数の上限は、2 * num_init_children です。 - </p> - <p> - 基本的に後述の max_pool * num_init_children 分だけ PostgreSQL へのコネクションが張られますが、 - 他に以下の考慮が必要です。 - </p> - <ul> - <li>問い合わせのキャンセルを行うと通常のコネクションとは別に新たなコネクションが張られます。 - したがって、すべてのコネクションが使用中の場合は問い合わせのキャンセルができなくなってしまうので、 - ご注意下さい。 - 問い合わせのキャンセルを必ず保証したい場合は、想定されるコネクション数の倍の値を - 設定することをおすすめします。 - </li> - <li>一般ユーザで PostgreSQL に接続できるのは、 - max_connections - superuser_reserved_connections 分だけです。 - </li> - </ul> - <p> - 以上をまとめると、 - </p> - - <table> - <tr><th>クエリのキャンセルを考慮しない場合</th> - <td>max_pool * num_init_children <=<br> - (max_connections - superuser_reserved_connections)</td></tr> - <tr><th>クエリのキャンセルを考慮する場合</th> - <td>max_pool * num_init_children * 2 <=<br> - (max_connections - superuser_reserved_connections)</td></tr> - </table> - - <p> - のどちらかを満たすように設定してください。 - </p> - </td> - </tr> - - <tr> - <th id="MAX_POOL"><label>{$message.descMax_pool|escape}</label> - <p>max_pool (integer) *</th> - <td> - <p> - pgpool-II の各サーバプロセスがキープする PostgreSQL への最大コネクション数です。 - pgpool-II は、ユーザ名、データベースが同じならばコネクションを再利用しますが、 - そうでなければ新たに PostgreSQL へのコネクションを確立しようとします。 - したがって、ここでは想定される [ユーザ名:データベース名] のペアの種類の数だけを - max_pool に指定しておく必要があります。 - もし max_pool を使いきってしまった場合は一番古いコネクションを切断し、 - そのスロットが再利用されます。 - </p> - <p> - max_poolのデフォルト値は4です。 - </p> - <p> - なお、pgpool-II全体としては、<a href="#NUM_INIT_CHILDREN">num_init_children</a> * - <a href="#MAX_POOL">max_pool</a> 分だけ - PostgreSQL へのコネクションが張られる点に注意してください。 - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Life time</th></tr> - - <tr> - <th id="CHILD_LIFE_TIME"><label>{$message.descChild_life_time|escape}</label> - <p>child_life_time (integer)</th> - <td> - <p> - pgpool-IIの子プロセスの寿命です。アイドル状態になってから - child_life_time秒経過すると、一旦終了して新しいプロセスを起動します。 - メモリーリークその他の障害に備えた予防措置です。 - child_life_timeのデフォルト値は300秒、すなわち5分です。 - 0を指定するとこの機能は働きません(すなわち起動しっ放し)。 - なお、まだ一度もコネクションを受け付けていないプロセスにはchild_life_timeは適用されません。 - </p> - </td> - </tr> - - <tr> - <th id="CHILD_MAX_CONNECTIONS"><label>{$message.descChild_max_connections|escape}</label> - <p>child_max_connections (integer)</th> - <td> - <p> - 各pgpool-II子プロセスへの接続回数がこの設定値を超えると、その子プロセスを終了します。 - <a href="#CHILD_LIFE_TIME">child_life_time</a> や <a href="#CONNECTION_LIFE_TIME">connection_life_time</a>が - 効かないくらい忙しいサーバで、 - PostgreSQL バックエンドが肥大化するのを防ぐのに有効です。 - </p> - </td> - </tr> - - <tr> - <th id="CONNECTION_LIFE_TIME"><label>{$message.descConnection_life_time|escape}</label> - <p>connection_life_time (integer)</th> - <td> - <p> - コネクションプール中のコネクションの有効期間を秒単位で指定します。 - 0 を指定すると有効期間は無限になります。 - connection_life_timeのデフォルト値は0です。 - </p> - </td> - </tr> - - <tr> - <th id="CLIENT_IDLE_LIMIT"><label>{$message.descClient_idle_limit|escape}</label> - <p>client_idle_limit (integer)</th> - <td> - <p> - 前回クライアントから来たクエリから、client_idle_limit 秒越えても次の - クエリが届かない場合は、クライアントへの接続を強制的に切断し、 - クライアントからの次のコネクションを待つようにします。 - この設定は、だらしないクライアントプログラムや、クライアントと pgpool の間の - TCP/IP コネクションが不調なことによって、 - pgpool の子プロセスが占有されてしまう問題を回避するのに役立ちます。 - デフォルト値は 0(無効)です。 - このパラメータは、オンラインリカバリのセカンドステージでは無視されます。 - </p> - <p> - このパラメータを変更した時には設定ファイルを再読み込みしてください。 - </p> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="backends">Backends</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - <td></td> - </tr> - </thead> - <tbody> - {if paramExists('backend_socket_dir')} - <tr> - <th id="BACKEND_SOCKET_DIR"><label>{$message.descBackend_socket_dir|escape}</label> - <p>backend_socket_dir (string) *</th> - <td>PostgreSQL サーバの Unix domain socket のディレクトリです。</p> - <p>デフォルト値は'/tmp'です。</td> - </tr> - {/if} - - <tr> - <th id="BACKEND_HOSTNAME"><label>{$message.descBackend_hostname|escape}</label> - <p>backend_hostname (string)</th> - <td> - <p> - 使用する PostgreSQL サーバのホスト名を指定します。 - pgpool-II は、このホスト名を使って PostgreSQL と通信します。 - </p> - <p> - TCP/IP を使用する場合、ホスト名または IP アドレスを指定できます。 - "/" で始まる文字列を指定すると、TCP/IP ではなく、UNIX ドメインソケットを使用され、 - ディレクトリ名とみなしてそこにソケットファイルが作成されることになります。 - 空文字(<code>''</code>)を指定すると、<code>/tmp</code> 下に作成した UNIX ドメインソケットで接続します。 - </p> - <p> - 実際には、"backend_hostname" の後に 0, 1, 2...と数字を付加して使用する複数 - の PostgreSQL を区別します(たとえば<code>backend_hostname0</code>)。 - この数字のことを「DBノードID」と呼び、0から開始します。 - DB ノード ID == 0 の PostgreSQL は、特別に「マスターDB」と呼ばれます。 - 複数の DB ノードを運用している場合、条件によってはマスター DB がダウンしても運用を続けることができます。 - この場合は、稼働中かつ DB ノード ID がもっとも若いものが新しいマスター DB になります。 - </p> - <p> - ただし、ストリーミングレプリケーションモードで運用している場合は、 - DB ノード ID が 0 のノードには特別な意味はなく、プライマリノードかどうかが問題になります。 - <p> - 1 台しか PostgreSQL を使用しない場合は、"backend_hostname0" としてください。 - </p> - </td> - </tr> - - <tr> - <th id="BACKEND_PORT"><label>{$message.descBackend_port|escape}</label> - <p>backend_port (integer)</th> - <td> - <p> - 使用する PostgreSQL サーバのポート番号を指定します。 - 実際には、"backend_port" の後に 0, 1, 2... と DB ノード ID を付加して使用する - 複数の PostgreSQL を区別します。 - </p> - <p> - 1 台しか PostgreSQL を使用しない場合は、"backend_port0" としてください。 - </p> - </td> - </tr> - - <tr> - <th id="BACKEND_WEIGHT"><label>{$message.descBackend_weight|escape}</label> - <p>backend_weight (integer)</th> - <td> - <p> - 使用する PostgreSQL サーバに対する負荷分散の比率を0以上の整数または浮動小数点で指定します。 - "backend_weight" の後には、DB ノード ID を付加して使用する複数の PostgreSQL を区別します。 - 1 台しか PostgreSQL を使用しない場合は、"backend_weight0" としてください。 - 負荷分散を使用しない場合は、「1」を設定してください。 - </p> - <p> - backend_weight は新しく追加した行を設定ファイル再読み込みで追加することができます。 - pgpool-II 2.2.6 / 2.3 以降では、設定ファイルの再読込で backend_weight 値を変更できます。 - 新しく接続したクライアントセッションから、この新しい weight 値が反映されます。 - マスタースレーブモードにおいて、あるスレーブに対して管理業務を実施する都合上、 - 問い合わせがそのスレーブに送られるのを防ぎたい場合に有用です。 - </p> - </td> - </tr> - - <tr> - <th id="BACKEND_DATA_DIRECTORY"><label>{$message.descBackend_data_directory|escape}</label> - <p>backend_data_directory (string) *</th> - <td> - <p> - 使用する PostgreSQL サーバのデータベースクラスタのパスを指定します。 - 実際には、"backend_data_directory" の後に DB ノード ID を付加して - 使用する複数の PostgreSQL を区別します。 - このパラメータはオンラインリカバリの際に使用します。 - </p> - <p> - オンラインリカバリを使用しない場合には設定する必要はありません。 - </p> - </td> - </tr> - - {if paramExists('backend_flag')} - <tr> - <th id="BACKEND_FLAG"><label>{$message.descBackend_flag|escape}</label> - <p>backend_flag (string) *</th> - <td> - <p> - バックエンド単位での様々な挙動を制御するフラグです。 - 実際には、"backend_flag" の後に数字を付けて、どのバックエンドのフラグか指定します。 - </p> - <p> - 例: <code>backend_flag0</code> - </p> - <p> - 複数のフラグを "|" で連結して指定することができます。 - 現在以下のものがあります。 - </p> - - <table> - <tr><th class="nodec">ALLOW_TO_FAILOVER</th> - <td>フェイルオーバやデタッチが可能になります。これがデフォルトの動作です。 - DISALLOW_TO_FAILOVER と同時には指定できません。 - </td></tr> - <tr><th class="nodec">DISALLOW_TO_FAILOVER</th> - <td>フェイルオーバやデタッチが行われません。 - Heartbeat や Pacemaker などのHA(High Availability)ソフトでバックエンドを二重化しているなどの事情で、 - pgpool-II 側でフェイルオーバの制御をして欲しくないときなどに指定します。 - ALLOW_TO_FAILOVER と同時には指定できません。 - </td></tr> - </table> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="logs">Logs</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr><th class="category" colspan="2">Where to log</th></tr> - - {if paramExists('log_destination')} - <tr> - <th id="LOG_DESTINATION"><label>{$message.descLog_destination|escape}</label> - <p>log_destination (string) *</th> - <td> - <p> - pgpool-IIは、stderr か syslog のどちらかにログを書くことができます。デフォルトは stderr です。 - </p> - <p> - 注意: syslog を使う場合は、syslog デーモンの設定を変更する必要があります。 - </p> - <p> - pgpool-II は、syslog ファシリティ LOCAL0 から LOCAL7 までにログを書くことができます - (<a href="#SYSLOG_FACILITY">syslog_facility</a> をご覧ください)。 - しかし、ほとんどのデフォルトの syslog 設定は、そのようなメッセージを廃棄してしまいます。 - そこで、syslog デーモンの以下のような設定が必要になります。 - </p> -<pre> -local0.* /var/log/pgpool.log -</pre> - </td> - </tr> - {/if} - - <tr><th class="category" colspan="2">What to log</th></tr> - - <tr> - <th id="PRINT_TIMESTAMP"><label>{$message.descPrint_timestamp|escape}</label> - <p>print_timestamp (string) *</th> - <td> - <p>true ならば pgpool-II のログにタイムスタンプを追加します。デフォルトは true です。</p> - <p>デフォルトは true です。</p></td> - </tr> - - <tr> - <th id="LOG_CONNECTIONS"><label>{$message.descLog_connections|escape}</label> - <p>log_connections (bool)</th> - <td>true ならば、全てのクライアント接続をログへ出力します。</td> - </tr> - - <tr> - <th id="LOG_HOSTNAME"><label>{$message.descLog_hostname|escape}</label> - <p>log_hostname (bool)</th> - <td> - <p> - true ならば、ps コマンドでの状態表示時にIPアドレスではなく、ホスト名を表示します。 - また、<a href="#LOG_CONNECTIONS">log_connections</a> が有効な場合にはログにホスト名を出力します。 - </p> - </td> - </tr> - - <tr> - <th id="LOG_STATEMENT"><label>{$message.descLog_statement|escape}</label> - <p>log_statement (bool)</th> - <td> - <p> - true ならば SQL 文をログ出力します。この役目は PostgreSQL の log_statement オプションと似ていて、 - デバッグオプションがないときでも 問い合わせをログ出力して調べることができるので便利です。 - </p> - </td> - </tr> - - <tr> - <th id~"LOG_PER_NODE_STATEMENT"><label>{$message.descLog_per_node_statement|escape}</label> - <p>log_per_node_statement (bool)</th> - <td> - <p> - <a href="#LOG_STATEMENT">log_statement</a>と似ていますが、DBノード単位でログが出力されるので、 - レプリケーションや負荷分散の確認が容易です</td> - </p> - </td> - </tr> - - <tr> - <th id="LOG_STANDBY_DELAY"><label>{$message.descLog_standby_delay|escape}</label> - <p>log_standby_delay (string)</th> - <td> - <p> - レプリケーションの遅延状況をログする条件を指定します。 - 'none' を指定すると、ログを出力しません。 - 'always' ならヘルスチェックを実行するたびに必ず出力します。 - 'if_over_threshold' を指定すると、<a href="#DELAY_THRESHOLD">delay_threshold</a>を超えたときだけ - ログが出力されます。 - </p> - <p> - デフォルト値は'none'です。 - </p> - </td> - </tr> - - {if paramExists('syslog_facility')} - <tr><th class="category" colspan="2">Syslog specific</th></tr> - - <tr> - <th><label>{$message.descSyslog_facility|escape}</label> - <p id="SYSLOG_FACILITY">syslog_facility (string) *</th> - <td> - <p> - syslog が有効な場合、このパラメータによって syslog の「ファシリティ」を設定します。 - LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7から選択します。 - デフォルトは LOCAL0 です。 - 併せて syslog デーモンのドキュメントもご覧ください。 - </p> - </td> - </tr> - - <tr> - <th id="SYSLOG_IDENT"><label>{$message.descSyslog_ident|escape}</label> - <p>syslog_ident (string) *</th> - <td> - <p> - syslog が有効な場合、このパラメータによって syslog のメッセージにあらわれるプログラム名を設定します。 - デフォルトは "pgpool" です。 - </p> - </td> - </tr> - {/if} - - {if paramExists('debug_level')} - <tr><th class="category" colspan="2">Debug</th></tr> - - <tr> - <th id="DEBUG_LEVEL"><label>{$message.descDebug_level|escape}</label> - <p>debug_level (integer)</th> - <td> - <p> - デバッグメッセージの詳細レベル。0 でデバッグメッセージの出力なし。 - 1 以上でデバッグメッセージを出力します。 - 数字が大きければより詳細なメッセージが出力されるようになります - (3.0 では今のところメッセージの詳細度は変りません)。 - </p> - <p> - デフォルト値は0です。 - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="file_locations">File Locations</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="LOGDIR"><label>{$message.descLogdir|escape}</label> - <p>logdir (string) *</th> - <td> - <p>このディレクトリ下に、pgpool-II の DB ノードの状態を記録する pgpool_status ファイルが書かれます。</p> - <p>デフォルト値は '/tmp' です。</p></td> - </tr> - - {if paramExists('pid_file_name')} - <tr> - <th id="PID_FILE_NAME"><label>{$message.descPid_file_name|escape}</label> - <p>pid_file_name (string) *</th> - <td> - <p>pgpool-II の pid file(プロセス IDを 格納したファイル)のフルパス名です。</p> - <p>デフォルト値は'/var/run/pgpool/pgpool.pid'です。</p></td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="connection_pooling">Connection Pooling</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="CONNECTION_CACHE"><label>{$message.descConnection_cache|escape}</label> - <p>connection_cache (bool) *</th> - <td>true なら PostgreSQL へのコネクションをキャッシュします。</td> - </tr> - - <tr> - <th id="RESET_QUERY_LIST"><label>{$message.descReset_query_list|escape}</label> - <p>reset_query_list (string)</th> - <td> - <p> - セッションが終了するときにコネクションを初期化するための SQL コマンドを「;」で区切って列挙します。 - デフォルトは以下のようになっていますが、任意の SQL 文を追加しても構いません。 -<pre> -reset_query_list = 'ABORT; DISCARD ALL' -</pre> - - <p> - PostgreSQL のバージョンによって使用できる SQL コマンドが違います。 - 各バージョンごとのお勧め設定は以下です(ただし、"ABORT" は必ずコマンドに含めてください)。 - </p> - - <table> - <tr class="header"><th>PostgreSQL バージョン</th><th>reset_query_list の推奨設定値</th></tr> - <tr><th>7.1 以前</th><td>ABORT</td></tr> - <tr><th>7.2 から 8.2</th><td>ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT</td></tr> - <tr><th>8.3 以降</th><td>ABORT; DISCARD ALL</td></tr> - </table> - - <p> - ※ 「ABORT」は、PostgreSQL 7.4 以上ではトランザクションブロックの中にいない場合には発行されません。 - </p> - </td> - </tr> - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="replication">Replication</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - - <tr> - <th id="REPLICATE_MODE"><label>{$message.descReplication_mode|escape}</label> - <p>replication_mode (bool) *</th> - <td>レプリケーションモードで動作させる場合は true を指定してください。</p> - <p>デフォルト値は false です。</p></td> - </tr> - - <tr> - <th id="REPLICATE_SELECT"><label>{$message.descReplicate_select|escape}</label> - <p>replicate_select (bool)</th> - <td> - <p> - true を設定すると、レプリケーションモードでは SELECT 文をレプリケーションします。 - これは pgpool-II 1.0 までの挙動と同じになります。 - false を設定すると SELECT 文をマスタのみに送信します。デフォルト値は false です。 - </p> - <p> - replicate_select、<a href="#LOAD_BALANCE_MODE">load_balance_mode</a>、 - SELECT 問合わせが明示的なトランザクションブロックの内側にあるかどうかどうかで、 - レプリケーションモードの動作が変化します。詳細を表に示します。 - </p> - - <table> - <tr> - <th class="nodec">SELECT が明示的なトランザクションブロックの内側にある</th> - <td>Y</td><td>Y</td><td>Y</td><td>N</td><td>N</td><td>N</td><td>Y</td><td>N</td> - </tr> - - <tr> - <th class="nodec">replicate_select が true</th> - <td>Y</td><td>Y</td><td>N</td><td>N</td><td>Y</td><td>Y</td><td>N</td><td>N</td> - </tr> - - <tr> - <th class="nodec">load_balance_mode が true</th> - <td>Y</td><td>N</td><td>N</td><td>N</td><td>Y</td><td>N</td><td>Y</td><td>Y</td> - </tr> - - <tr> - <th class="nodec">結果(R:レプリケーション, M: マスタのみに送信, L: ロードバランスされる)</th> - <td>R</td><td>R</td><td>M</td><td>M</td><td>R</td><td>R</td><td>M</td><td>L</td> - </tr> - </table> - </td> - </tr> - - <tr> - <th><label>{$message.descInsert_lock|escape}</label> - <p>insert_lock (bool)</th> - <td> - <p> - SERIAL 型を使っているテーブルをレプリケーションすると、SERIAL 型の列の値が DB ノードの間で - 一致しなくなることがあります。 - この問題は、該当テーブルを明示的にロックすることで回避できます - (もちろんトランザクションの並列実行性は犠牲になりますが)。 - しかし、そのためには、 - </p> -<pre> -INSERT INTO ... -</pre> - - <p> - を - </p> - -<pre> -BEGIN; -LOCK TABLE ... -INSERT INTO ... -COMMIT; -</pre> - - <p> - に書き換えなければなりません。 - insert_lock を true にすると自動的にトランザクションの開始、テーブルロック、トランザクションの終了を - 行ってくれるので、こうした手間を省くことができます - (すでにトランザクションが開始されている場合は LOCK TABLE...だけが実行されます)。 - </p> - <p> - そのほか注意事項などは pgpool-II のマニュアルに詳細があります。 - </p> - <p> - insert_lock のデフォルト値は true です。 - </p> - </td> - </tr> - - {if paramExists('lobj_lock_table')} - <tr> - <th id="LOBJ_LOCK_TABLE"><label>{$message.descLobj_lock_table|escape}</label> - <p>lobj_lock_table (string)</th> - <td> - <p> - ラージオブジェクトのレプリケーションを行いたいときにロック管理に使うためのテーブル名を指定します。 - これを使用することによって、すべての DB ノードで同じIDを持つラージオブジェクトが作成されることが - 保証されます。 - </p> - <p> - lobj_lock_table に指定するテーブル名が空文字の場合は、ラージオブジェクトに関する上記の処理は行いません - (したがって、ラージオブジェクトのレプリケーションは保証されません)。 - lobj_lock_table のデフォルト値は空文字です。 - </p> - <p> - pgpool-II のマニュアルに、より詳細な説明があります。 - </p> - </td> - </tr> - {/if} - - <tr><th class="category" colspan="2">Degenerate handling</th></tr> - - <tr> - <th id="REPLICATION_STOP_ON_MISMATCH"><label>{$message.descReplication_stop_on_mismatch|escape}</label> - <p>replication_stop_on_mismatch (bool)</th> - <td> - <p> - 各 DB ノードから送られてくるパケットの種類が不一致になった場合に、DB ノードを切り放して縮退運転に入ります。 - </p> - <p> - 良くあるケースとしては、<a href="#REPLICATE_SELECT">replicate_select</a> が指定されていて - SELECT が各 DB ノードで実行されているときに、 - 検索結果行数が一致しないなど、があります(これに限定されるものではありません。 - たとえばある DB ノードで UPDATE が成功したのに、他の DB ノードでは失敗した場合が一例です)。 - ただし、pgpool はパケットの中身まではチェックしていないので、SELECT 結果のデータ内容が異なっていても、 - 縮退は起きないことに注意してください。 - </p> - <p> - 縮退対象の DB ノードは「多数決」で少数派になったものが対象になります。 - もし多数決で同票になった場合は、マスタ DB ノード - (DB ノード番号がもっともわかいもの)を含むグループが優先され、 - それ以外のグループに所属する DB ノードが切り放しの対象になります。 - </p> - <p> - このオプションが false の場合は、該当のセッションを強制的に終了するだけに留めます。 - デフォルト値は false です。 - </p> - </td> - </tr> - - {if paramExists('failover_if_affected_tuples_mismatch')} - <tr> - <th id="FAIL_OVER_IF_AFFECTED_TUPLES_MISMATCH"><label>{$message.descFailover_if_affected_tuples_mismatch|escape}</label> - <p>failover_if_affected_tuples_mismatch (bool)</th> - <td> - <p> - 各 DB ノードで実行された INSERT/UPDATE/DELETE の結果行数が不一致になった場合に、 - DB ノードを切り放して縮退運転に入ります。 - </p> - <p> - 縮退対象の DB ノードは「多数決」で少数派になったものが対象になります。 - もし多数決で同票になった場合は、マスタ DB ノード - (DB ノード番号がもっともわかいもの)を含むグループが優先され、 - それ以外のグループに所属する DB ノードが切り放しの対象になります。 - </p> - <p> - このオプションが false の場合は、該当のセッションを強制的に終了するだけに留めます。 - デフォルト値は false です。 - </p> - </td> - </tr> - {/if} - - {if paramExists('fail_over_on_backend_error')} - <tr> - <th id="FAIL_OVER_ON_BACKEND_ERROR"><label>{$message.descFail_over_on_backend_error|escape}</label> - <p>fail_over_on_backend_error</th> - <td> - <p> - true ならば、バックエンドのソケットへからの読み出し、書き込みに失敗するとフェイルオーバします。 - false にすると、フェイルオーバせず、単にエラーがレポートされてセッションが切断されます。 - </p> - <p> - このパラメータをfalseにする場合には、health check を有効にすることをお勧めします。 - なお、このパラメータが false の場合でも、バックエンドがシャットダウンされたことを - pgpool-II が検知した場合にはフェイルオーバが起きることに注意してください。 - </p> - </td> - </tr> - {/if} - - <tr> - <th id="REPLICATION_TIMEOUT"><label>{$message.descReplication_timeout|escape}</label> - <p>replication_timeout (integer)</th> - <td>デットロックを監視するためのタイムアウト時間をミリ秒単位で指定します。 - <p>デフォルト値は 5000 (5秒)です。</td> - </tr> - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="load_balancing_mode" id="load_balancing_mode">Load Balancing Mode</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="LOAD_BALANCE_MODE"><label>{$message.descLoad_balance_mode|escape}</label> - <p>load_balance_mode (bool) *</th> - <td> - <p> - true を指定するとレプリケーションモードまたはマスタースレーブモードの際に、 - SELECT 文をロードバランスして検索性能を向上させることができます。デフォルト値は false です。 - </p> - </td> - </tr> - - {if paramExists('ignore_leading_white_space')} - <tr> - <th id="IGNORE_LEADING_WHITE_SPACE"><label>{$message.descIgnore_leading_white_space|escape}</label> - <p>ignore_leading_white_space (bool)</th> - <td> - <p> - true ならば、load balance の際に SQL 文行頭の空白を無視します(全角スペースは無視されません)。 - これは、DBI/DBD:Pg のように、勝手に行頭にホワイトスペースを追加するような API を使い、 - ロードバランスしたいときに有効です。 - </p> - </td> - </tr> - {/if} - - {if paramExists('white_function_list')} - <tr> - <th id="WHITE_FUNCTION_LIST"><label>{$message.descWhite_function_list|escape}</label> - <p>white_function_list (string)</th> - <td> - <p> - データベースに対して<strong>更新を行なわない関数名</strong>をコンマ区切りで指定します。 - このリストに含まれない関数呼び出しを含む SELECT は、負荷分散の対象とはならず、 - レプリケーションモードにおいてはすべての DB ノードで実行されます - (マスタースレーブモードにおいては、マスター(primary)DB ノードにのみ送信されます)。 - </p> - <p> - 関数名には正規表現を使うことができます。 - たとえば、読み出しのみの関数が "get_" あるいは "select_" で始まるならば、以下のような指定が可能です。 - </p> -<pre> -white_function_list = 'get_.*,select_.*' -</pre> - </td> - </tr> - - <tr> - <th id="BLACK_FUNCTION_LIST"><label>{$message.descBlack_function_list|escape}</label> - <p>black_function_list (string)</th> - <td> - <p> - データベースに対して<strong>更新を行なう関数名</strong>をコンマ区切りで指定します。 - このリストに含まれる関数呼び出しを含む SELECT は、負荷分散の対象とはならず、 - レプリケーションモードにおいてはすべてのDBノードで実行されます。 - このリストに含まれない関数呼び出しを含む SELECT は、負荷分散の対象となります。 - </p> - <p> - 関数名には正規表現を使うことができます。 - たとえば、読み出しのみの関数が "set_"、"update_"、"delete_" あるいは "insert_" で始まるならば、 - 以下のような指定が可能です。 - </p> -<pre> -black_function_list = 'nextval,setval,set_.*,update_.*,delete_.*,insert_.*' -</pre> - - <p> - white_function_list と black_function_list の両方を空以外にすることはできません。 - どちらか一方のみに関数名を指定します。 - </p> - <p> - pgpool-II 3.0 より前のバージョンでは、固定で nextval と setval が書き込みを行なう関数として - 認識されていました。 - それと同じ動作を行なわせるには、以下のように white_function_list と black_function_list を指定します。 - </p> -<pre> -white_function_list = '' -black_function_list = 'nextval,setval,lastval,currval' -</pre> - - <p> - 上の例では、nextval と setval に加え、lastval と currval が追加されていることに注意してください。 - lastval と currval は書き込みを行う関数ではありませんが、これらの関数が負荷分散されることによって、 - エラーが発生するのを未然に防ぐことができます。 - black_function_list に含まれる関数は負荷分散されないからです。 - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="master_slave_mode" id="master_slave_mode">Master/Slave Mode</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="MASTER_SLAVE_MODE"><label>{$message.descMaster_slave_mode|escape}</label> - <p>master_slave_mode *</th> - <td>true ならばマスタ/スレーブモードで pgpool を運転します。 - このモードは replication_mode とは両立できません。 - <p>デフォルトは false です。</td> - </td> - </tr> - - {if paramExists('sr_check_period')} - <tr><th class="category" colspan="2">Streaming</th></tr> - - <tr> - <th id="SR_CHECK_PERIOD"><label>{$message.descSr_check_period|escape}</label> - <p>sr_check_period (integer) *</th> - <td> - <p> - ストリーミングレプリケーションの遅延チェックの間隔を秒単位で指定します。 - デフォルト値は0で、これはチェックを行わないことを意味します。 - </p> - </td> - </tr> - - <tr> - <th id="SR_CHECK_USER"><label>{$message.descSr_check_user|escape}</label> - <p>sr_check_user (string) *</th> - <td> - <p> - ストリーミングレプリケーションの遅延チェックを行うユーザ名を指定します。 - このユーザは、すべてのバックエンドに存在しなければなりません。 - さもなければエラーになります。 - </p> - <p> - sr_check_user と sr_check_password は、sr_check_period が 0 であっても指定が必要です。 - pgpool-II は、どのサーバが primary サーバであるのかを調べるために、 - PostgreSQL バックエンドに関数呼び出しのリクエストを送ります。 - そのセッションで sr_check_user と sr_check_password が使われるからです。 - </p> - <p> - このパラメータは設定ファイルの再読込によって変更できます。 - </p> - </td> - </tr> - - <tr> - <th id="SR_CHECK_PASSWORD"><label>{$message.descSr_check_password|escape}</label> - <p>sr_check_password (string) *</th> - <td> - <p> - ストリーミングレプリケーションの遅延チェックを行うユーザに対するパスワードをを指定します。 - パスワードが必要なければ空文字 ('') を指定します。 - </p> - </td> - </tr> - - <tr> - <th id="DELAY_THRESHOLD"><label>{$message.descDelay_threshold|escape}</label> - <p>delay_threshold (integer)</th> - <td> - <p> - スタンバイサーバへのレプリケーションの遅延許容度をバイト単位で指定します。 - </p> - <p> - pgpool-II は、スタンバイサーバの遅延がこの値を超えた場合には、 - 負荷分散が有効であってもその DB ノードに SELECT を送信せず、プライマリサーバに送るようにします。 - delay_threshold が 0 の場合は、遅延のチェックを行ないません。 - また、delay_threshold が指定されていても、<a href="#SR_CHECK_PERIOD">sr_check_period</a>が - 無効 (=0) ならば、やはりこの機能は働きません。 - </p> - <p> - デフォルト値は 0 です。 - </p> - </td> - </tr> - {/if} - - {if paramExists('follow_master_command')} - <tr><th class="category" colspan="2">Special commands</th></tr> - <tr> - <th id="FOLLOW_MASTER_COMMAND"><label>{$message.descFollow_master_command|escape}</label> - <p>follow_master_command (string) *</th> - <td> - <p> - マスターノードのフェイルオーバー後に実行するコマンドを指定します。 - これは、マスタースレーブモードでストリーミングレプリケーション構成の場合のみ有効です。 - 特殊文字を指定すると、pgpool が必要な情報に置き換えてコマンドを実行します。 - </p> - - <center> - <table> - <tr class="header"><th>文字</th><th>意味</th></tr> - <tr><td>%d</td><td>切り離されたノード番号</td></tr> - <tr><td>%h</td><td>切り離されたノードのホスト名</td></tr> - <tr><td>%p</td><td>切り離されたノードのポート番号</td></tr> - <tr><td>%D</td><td>切り離されたノードのデータベースクラスタパス</td></tr> - <tr><td>%M</td><td>古いマスターのノード番号</td></tr> - <tr><td>%m</td><td>新しいマスターのノード番号</td></tr> - <tr><td>%H</td><td>新しいマスターのホスト名</td></tr> - <tr><td>%P</td><td>古いプライマリノード番号</td></tr> - <tr><td>%%</td><td>'%'文字</td></tr> - </table> - </center> - - <p> - このパラメータを変更した時には設定ファイルを再読み込みしてください。 - </p> - - <p> - 空文字列以外を指定すると、マスターノードのフェイルオーバー後に新しいマスター以外の - すべてのノードは切り離され、 - クライアントから再び接続を受け付けるために子プロセスの再起動が行われます。 - その後、切り離されたそれぞれのノードに対して follow_master_command に指定したコマンドが実行されます。 - 通常は、ここに <a href="#pcp_recovery_node">pcp_recovery_node</a> コマンドを - 組み込んだシェルスクリプトなどを指定し、新しいマスターからスレーブをリカバリするために使用します。 - </p> - </td> - </tr> - {/if} - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - - -<h3><a name="parallel_mode" id="parallel_mode">Parallel Mode and Query Cache</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="PARALLEL_MODE"><label>{$message.descParallel_mode|escape}</label> - <p>parallel_mode *</th> - <td>pgpool をパラレルモードで稼働させる場合には true を指定します。 - この場合には分散ルールを指定する必要があります。 - <p>デフォルト値は false です。</td> - </tr> - - {if paramExists('enable_pool_hba')} - <tr> - <th id="ENABLE_QUERY_CACHE"><label>{$message.descEnable_query_cache|escape}</label> - <p>enable_query_cache *</th> - <td>SELECT の結果をキャッシュする場合には true にします。 - <p>デフォルト値は false です。</td> - </tr> - {/if} - - <tr> - <th id="PGPOOL2_HOSTNAME"><label>{$message.descPgpool2_hostname|escape}</label> - <p>pgpool2_hostname (string) *</th> - <td>pgpool2 が稼働しているホスト名を指定します。 - <p>デフォルトでは設定されていません。 - </td> - </tr> - - <tr><th class="category" colspan="2">System DB info</th></tr> - - <tr> - <th id="SYSTEM_DB_HOSTNAME"><label>{$message.descSystem_db_hostname|escape}</label> - <p>system_db_hostname (string) *</th> - <td>システム DB が稼働しているホスト名を指定します。 - 指定しない場合には Unix domain socket で接続します。 - <p>デフォルト値は localhost です。</td> - </tr> - - <tr> - <th id="SYSTEM_DB_PORT"><label>{$message.descSystem_db_port|escape}</label> - <p>system_db_port (integer) *</th> - <td>システム DB がある PostgreSQL に接続するためのポート番号を指定します。 - <p>デフォルト値は 5432 です。</td> - </tr> - - <tr> - <th id="SYSTEM_DB_DBNAME"><label>{$message.descSystem_db_dbname|escape}</label> - <p>system_db_dbname (string) *</th> - <td>システムDBのデータベース名を指定します。 - <p>デフォルト値は pgpool です。</td> - </tr> - - <tr> - <th id="SYSTEM_DB_SCHEMA"><label>{$message.descSystem_db_schema|escape}</label> - <p>system_db_schema (string) *</th> - <td>システムDBのスキーマを指定します。 - <p>デフォルト値は pgpool_catelog です。</td> - </tr> - - <tr> - <th id="SYSTEM_DB_USER"><label>{$message.descSystem_db_user|escape}</label> - <p>system_db_user (string) *</th> - <td>システムDBに接続するユーザ名を指定します。 - <p>デフォルト値は pgpool です。</td> - </tr> - - <tr> - <th id="SYSTEM_DB_PASSWORD"><label>{$message.descSystem_db_password|escape}</label> - <p>system_db_password (string) *</th> - <td>システムDBに接続するユーザのパスワードを指定します。 - <p>デフォルト値は設定されていません。</td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="health-check">Health Check</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="HEALTH_CHECK_TIMEOUT"><label>{$message.descHealth_check_timeout|escape}</label> - <p>health_check_timeout (integer)</th> - <td> - <p> - pgpool-II はサーバ障害やネットワーク障害を検知するために、定期的にバックエンドに接続を試みます。 - これを「ヘルスチェック」と言います。障害が検知されると、フェイルオーバや縮退運転を試みます。 - </p> - <p> - この パラメータは、ネットワークケーブルが抜けた際などにヘルスチェックが長時間待たされるのを防ぐための - タイムアウト値を秒単位で指定します。 - デフォルトは 20 秒です。0 を指定するとタイムアウト処理をしません - (すなわち TCP/IP のタイムアウトまで待つことになります)。 - </p> - <p> - なお、ヘルスチェックを有効にすると、ヘルスチェックのための余分の接続が 1 つ必要になりますので、 - PostgreSQL の postgresql.conf の設定項目の max_connections を少くとも1増やすようにしてください。 - </p> - <p> - このパラメータを変更した時には設定ファイルを再読み込みしてください。 - </p> - </td> - </tr> - - <tr> - <th id="HEALTH_CHECK_PERIOD"><label>{$message.descHealth_check_period|escape}</label> - <p>health_check_period (integer)</th> - <td> - <p> - ヘルスチェックを行う間隔を秒単位で指定します。0を指定するとヘルスチェックを行いません。 - デフォルトは0です(つまりヘルスチェックを行いません)。 - </p> - </td> - </tr> - - <tr> - <th id="HEALTH_CHECK_USER"><label>{$message.descHealth_check_user|escape}</label> - <p>health_check_user (string)</th> - <td> - <p> - ヘルスチェックを行うための PostgreSQL ユーザ名です。 - このユーザ名は PostgreSQL に登録済みでなければなりません。 - さもないと、ヘルスチェックがエラーとなります。 - </p> - </td> - </tr> - - {if paramExists('health_check_password')} - <tr> - <th id="HEALTH_CHECK_PASSWORD"><label>{$message.descHealth_check_password|escape}</label> - <p>health_check_password (string)</th> - <td> - <p>ヘルスチェックを行うためのPostgreSQLパスワードです。</p> - </td> - </tr> - {/if} - - {if paramExists('health_check_max_retries')} - <tr> - <th id="HEALTH_CHECK_MAX_RETRIES"><label>{$message.descHealth_check_max_retries|escape}</label> - <p>health_check_max_retries (integer)</th> - <td> - <p> - ヘルスチェックに失敗した後(したがってフェイルオーバする前に)リトライする回数を指定します。 - この設定は動作にむらのあるネットワーク環境において、マスタが正常であるにも関わらず - たまにヘルスチェックが失敗することが予想される場合に有用です。 - デフォルト値は 0 で、この場合はリトライをしません。 - </p> - <p> - この設定を有効にする場合は、併せて <a href="#FAIL_OVER_ON_BACKEND_ERROR">fail_over_on_backend_error</a> を - off にすることをお勧めします。 - </p> - </td> - </tr> - {/if} - - {if paramExists('health_check_retry_delay')} - <tr> - <th id="HEALTH_CHECK_RETRY_DELAY"><label>{$message.descHealth_check_retry_delay|escape}</label> - <p>health_check_retry_delay (integer)</th> - <td> - <p> - ヘルスチェックのリトライの間の秒数を指定します - (<a href="HEALTH_CHECK_MAX_RETRIES">health_check_max_retries</a> > 0でなければ有効になりません)。 - 0を指定すると、待ちなしに直ちにリトライします。 - </p> - </td> - </tr> - {/if} - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - -<h3><a name="failover" id="failover">Failover and Failback</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="FAILOVER_COMMAND"><label>{$message.descFailover_command|escape}</label> - <p>failover_command</th> - <td> - <p> - ノードが切り離された時に実行するコマンドを指定します。特殊文字を指定すると、 - pgpool が必要な情報に置き換えてコマンドを実行します。 - </p> - - <center> - <table> - <tr class="header"><th>文字</th><th>意味</th></tr> - <tr><td>%d</td><td>切り離されたノード番号</td></tr> - <tr><td>%h</td><td>切り離されたノードのホスト名</td></tr> - <tr><td>%H</td><td>新しいマスターのホスト名</td></tr> - <tr><td>%p</td><td>切り離されたノードのポート番号</td></tr> - <tr><td>%D</td><td>切り離されたノードのデータベースクラスタパス - </td></tr> - <tr><td>%M</td><td>古いマスターのノード番号</td></tr> - <tr><td>%m</td><td>新しいマスターのノード番号</td></tr> - <tr><td>%P</td><td>古いプライマリノード番号</td></tr> - <tr><td>%%</td><td>'%'文字</td></tr> - </table> - </center> - - <p> - このパラメータを変更した時には設定ファイルを再読み込みしてください。 - </p> - <p> - フェイルオーバー時には、pgpool はまず子プロセスを切断します(結果として、すべてのセッションが切断されます)。 - 次に、pgpool はフェイルオーバコマンドを実行し、その完了を待ちます。 - そのあとで新しい pgpool の子プロセスが起動され、クライアントからの接続を受け付けられる状態になります。 - </p> - </td> - </tr> - - <tr> - <th id="FAILBACK_COMMAND"><label>{$message.descFailback_command|escape}</label> - <p>failback_command</th> - <td> - <p> - ノードが復帰した時に実行するコマンドを指定します。特殊文字を指定すると、 - pgpool が必要な情報に置き換えてコマンドを実行します。 - </p> - - <center> - <table> - <tr class="header"><th>文字</th><th>意味</th></tr> - <tr><td>%d</td><td>復帰したノード番号</td></tr> - <tr><td>%h</td><td>復帰したノードのホスト名</td></tr> - <tr><td>%p</td><td>復帰したノードのポート番号</td></tr> - <tr><td>%D</td><td>復帰したノードのデータベースクラスタパス - </td></tr> - <tr><td>%M</td><td>古いマスターのノード番号</td></tr> - <tr><td>%m</td><td>新しいマスターのノード番号</td></tr> - <tr><td>%H</td><td>新しいマスターのホスト名</td></tr> - <tr><td>%P</td><td>古いプライマリノード番号</td></tr> - <tr><td>%%</td><td>'%'文字</td></tr> - </table> - </center> - - <p> - このパラメータを変更した時には設定ファイルを再読み込みしてください。 - </p> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - - - -<h3><a name="online-recovery">Online Recovery</a></h3> -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="RECOVERY_USER"><label>{$message.descRecovery_user|escape}</label> - <p>recovery_user (string)</th> - <td> - <p> - オンラインリカバリを行うための PostgreSQL ユーザ名です。 - デフォルト値は 'nobody' です。 - </p> - </td> - </tr> - - <tr> - <th id~"RECOVERY_PASSWORD"><label>{$message.descRecovery_password|escape}</label> - <p>recovery_password (string)</th> - <td> - <p> - オンラインリカバリを行うための PostgreSQL ユーザパスワードです。 - デフォルト値は設定されていません。 - </p> - </td> - </tr> - - <tr> - <th id="RECOVERY_1ST_STAGE"><label>{$message.descRecovery_1st_stage_command|escape}</label> - <p>recovery_1st_stage_command (string)</th> - <td> - <p> - オンラインリカバリ中に起動するコマンド名を指定します。 - このスクリプトは PostgreSQL のマスタ(プライマリ)サーバが起動します。 - コマンドファイルはセキュリティ上の観点からデータベースクラスタ以下にある - コマンドやスクリプトのみを呼び出します。 - 例えば、recovery_1st_stage_command = 'sync-command' と設定してある場合、 - $PGDATA/sync-command を起動しようとします。 - </p> - <p> - recovery_1st_stage_command は次の 3 つの引数を受けとります。 - </p> - <ol> - <li>マスタ(プライマリ)データベースクラスタへのパス</li> - <li>リカバリ対象の PostgreSQL のホスト名</li> - <li>リカバリ対象のデータベースクラスタへのパス</li> - </ol> - <p> - recovery_1st_stage_command を実行している間は pgpool ではクライアン - トからの接続を<b>制限しません</b>。参照や更新を行うことができます。 - </p> - </td> - </tr> - - <tr> - <th id="RECOVERY_2ND_STAGE"><label>{$message.descRecovery_2nd_stage_command|escape}</label> - <p>recovery_2nd_stage_command (string)</th> - <td> - <p> - 2 回目のオンラインリカバリ中に起動するコマンド名を指定します。 - このスクリプトは PostgreSQL のマスタ(プライマリ)サーバが起動します。 - コマンドファイルはセキュリティ上の観点からデータベースクラスタ以下にある - コマンドやスクリプトのみを呼び出します。 - 例えば、recovery_2nd_stage_command = 'sync-command' と設定してある場合、 - $PGDATA/sync-command を起動しようとします。 - </p> - <p> - recovery_2nd_stage_command は次の 3 つの引数を受けとります。 - </p> - <ol> - <li>マスタ(プライマリ)データベースクラスタへのパス</li> - <li>リカバリ対象の PostgreSQL のホスト名</li> - <li>リカバリ対象のデータベースクラスタへのパス</li> - </ol> - </p> - <p> - recovery_2nd_stage_command を実行している間は pgpool ではクライアントから - 接続、参照、更新処理を一切<b>受け付けません</b>。 - また、バッチ処理などによって接続しているクライアントが長時間存在している場合にはコマンドを起動しません。 - 新たな接続を制限し、現在の接続数が 0 になった時点 - でコマンドを起動します。 - </p> - </td> - </tr> - - <tr> - <th id="RECOVERY_TIMEOUT"><label>{$message.descRecovery_timeout|escape}</label> - <p>recovery_timeout (integer)</th> - <td> - <p> - pgpool は、オンラインリカバリの際にすべてのクライアントが接続を終了するまで待ちます。 - recovery_timeout でその最大待ち時間を指定します。単位は秒です。 - 待ち時間が recovery_timeout を越えると、オンラインリカバリは中止され、通常の状態に戻ります。 - </p> - <p> - アイドル状態のクライアントが自分から切断するのを待ちたくない場合は、 - <a href="#CLIENT_IDLE_LIMIT_IN_RECOVERY">client_idle_limit_in_recovery</a> を利用することもできます。 - </p> - </p> - <p> - recovery_timeout は、この他、オンラインリカバリの最後にリカバリ対象のDBノードで - postmasterを起動する際の待ち時間にも利用されます。 - </p> - <p> - recovery_timeout のデフォルト値は 90 秒です。 - recovery_timeout を 0 としてもタイムアウトが無効になるわけではなく、 - 単に即座にタイムアウトするだけですので注意してください。 - </p> - </td> - </tr> - - {if paramExists('client_idle_limit_in_recovery')} - <tr> - <th id="CLIENT_IDLE_LIMIT_IN_RECOVERY"><label>{$message.descClient_idle_limit_in_recovery|escape}</label> - <p>client_idle_limit_in_recovery (integer)</th> - <td> - <p> - client_idle_limitと似ていますが、このパラメータはリカバリのセカンドステージでのみ効力があります。 - 前回クライアントから来たクエリから、client_idle_limit_in_recovery 秒越えても次のクエリが届かない場合は、 - クライアントへの接続を強制的に切断し、リカバリのセカンドステージの進行が妨害されるのを防ぎます。 - -1 を指定すると、直ちにクライアントへの接続を切断してセカンドステージに入ります。 - </p> - <p> - デフォルト値は 0(無効)です。 - </p> - <p> - クライアントが忙しく、アイドル状態にならない場合は client_idle_limit_in_recovery を設定しても - セカンドステージに移行できません。 - この場合、client_idle_limit_in_recovery に -1 を設定すると、クライアントがビジーであっても - ただちにクライアントへの接続を切断し、セカンドステージに移行することができます。 - </p> - </td> - </tr> - {/if} - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> - -{if paramExists('use_watchdog')} -<h3><a name="watchdog" id="watchdog">Watchdog</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="4">Enabling</th></tr> - - <tr> - <th id="USE_WATCHDOG"><label>{$message.descUse_watchdog|escape}</label> - <p>use_watchdog (bool) *</th> - <td> - <p>watchdog を有効にするには on にします。デフォルトは off です。</p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Connection to up stream servers</th></tr> - - <tr> - <th id="TRUSTED_SERVERS"><label>{$message.descTrusted_servers|escape}</label> - <p>trusted_servers (string) *</th> - <td> - <p>上位接続を確認するための信頼できるサーバリストです。 ping の応答が得られる必要があります。 - "hostA,hostB,hostC ..." のようにカンマで区切って複数のサーバを指定できます。</p> - <p>指定がない場合は上位サーバへのネットワーク到達監視をしません。</p> - </td> - </tr> - - <tr> - <th id="PING_PATH"><label>{$message.descPing_path|escape}</label> - <p>ping_path (string) *</th> - <td> - <p>上位サーバへの接続監視に利用する ping コマンドのパスです。 "/bin" のようにパスだけを指定します。 </p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Watchdog communication Settings</th></tr> - - <tr> - <th id="WD_HOSTNAME"><label>{$message.descWd_hostname|escape}</label> - <p>wd_hostname (string) *</th> - <td> - <p>watchdog プロセスが相互監視を受信する為のホスト名または IP アドレスです。 </p> - </td> - </tr> - - <tr> - <th id="WD_PORT"><label>{$message.descWd_port|escape}</label> - <p>wd_port (integer) *</th> - <td> - <p>watchdog プロセスが相互監視を受信する為のポート番号です。 </p> - </td> - </tr> - - {if paramExists('wd_authkey')} - <tr> - <th id="WD_AUTHKEY"><label>{$message.descWd_authkey|escape}</label> - <p>wd_authkey (string) *</th> - <td> - <p>wachdog 間通信で用いられる認証キーです。 全ての pgpool-II で同じキーを指定する必要があります。 - 認証キーが異なる watchdog からの通信は拒絶されます。 - 死活監視をハートビートモードで行う場合には、この認証はハートビート信号にも適用されます。</p> - <p>指定が無い場合には認証は行われず、これがデフォルトです。</p> - </td> - </tr> - {/if} - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Virtual IP address</th></tr> - - <tr> - <th id="DELEGATE_IP"><label>{$message.descDelegate_IP|escape}</label> - <p>delegate_IP (string) *</th> - <td> - <p>(アプリケーションサーバなど)外部からの接続される pgpool-II の仮想 IP アドレスです。 - スタンバイからアクティブに切り替わる際、pgpool はこの仮想 IP を引き継ぎます。 </p> - </td> - </tr> - - <tr> - <th id="IFCONFIG_PATH"><label>{$message.descIfconfig_path|escape}</label> - <p>ifconfig_path (string) *</th> - <td> - <p>IP アドレス切り替えに利用するコマンドのパスです。 "/sbin" のようにパスだけを指定します。</p> - </td> - </tr> - - <tr> - <th id="IF_UP_CMD"><label>{$message.descIf_up_cmd|escape}</label> - <p>if_up_cmd (string) *</th> - <td> - <p>仮想 IP を起動するために実行するコマンドです。 - "<code>ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0</code>" のようにコマンドとパラメータを指定します。 - $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。 </p> - </td> - </tr> - - <tr> - <th id="IF_DOWN_CMD"><label>{$message.descIf_down_cmd|escape}</label> - <p>if_down_cmd (string) *</th> - <td> - <p>仮想IPを停止するために実行するコマンドです。 - "<code>ifconfig eth0:0 down</code>" のようにコマンドとパラメータを指定します。</p> - </td> - </tr> - - <tr> - <th id="ARPING_PATH"><label>{$message.descArping_path|escape}</label> - <p>arping_path (string) *</th> - <td> - <p>IP アドレス切り替え後に ARP リクエストを送信するコマンドのパスです。 - "/usr/sbin" のようにパスだけを指定します。 </p> - </td> - </tr> - - <tr> - <th id="ARPING_CMD"><label>{$message.descArping_cmd|escape}</label> - <p>arping_cmd (string) *</th> - <td> - <p>IPアドレス切り替え後に ARP リクエストを送信するコマンドです。 - "<code>arping -U $_IP_$ -w 1</code>" のようにコマンドとパラメータを指定します。 - $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。 </p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - {if paramExists('clear_memqcache_on_escalation')} - <tr><th class="category" colspan="2">Behaivor on escalation Setting</th></tr> - - <tr> - <th id="CLEAR_MEMQCACHE_ON_ESCALATION"><label>{$message.descClear_memqcache_on_escalation|escape}</label> - <p>clear_memqcache_on_escalation (bool) *</th> - <td> - <p>このオプションが on の場合、pgpool-II がアクティブに昇格した時に、 - 共有メモリ上のクエリキャッシュを全て削除します。 - これにより、旧アクティブと非整合な古いクエリキャッシュが使われることを防止します。</p> - <p><a href="MEMQCACHE_METHOD">memqcache_method</a> が 'shmem' の場合のみ有効です。 デフォルトは on です。</p> - </td> - </tr> - - <tr> - <th id="WD_ESCALATION_COMMAND"><label>{$message.descWd_escalation_command|escape}</label> - <p>wd_escalation_command (string) *</th> - <td> - <p>pgpool-II がアクティブに昇格した時に、ここで指定したコマンドが実行されます。 - コマンドは、仮想 IP が立ち上がる直前のタイミングで実行されます。 </p> - </td> - </tr> - {/if} - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Lifecheck Setting (common)</th></tr> - - {if paramExists('wd_lifecheck_method')} - <tr> - <th id="WD_LIFECHECK_METHOD"><label>{$message.descWd_lifecheck_method|escape}</label> - <p>wd_lifecheck_method (string) *</th> - <td> - <p>死活監視の方法を指定します。指定できる値は 'heartbeat' (デフォルト)か 'query' です。</p> - <dl> - <dt>heartbeat</dt> - <dd> - 監視は「ハートビートモード」で行われます。 - watchdog は一定間隔でハートビート信号(UDP パケット)を他の pgpool-II へ送信します。 - また watchdog は他の pgpool-II から送られてくる信号を受信し、これが一定時間以上途絶えた場合には - その pgpool-II に障害が発生したと判断します。 - </dd> - <dt>query</dt> - <dd> - 監視は「クエリモード」で行われます。 - watchdog は監視用のクエリを pgpool-II に発行し、それが成功するかどうかで - pgpool-II が生きているかどうかを判断します。 </p> - </dd> - </dl> - </td> - </tr> - {/if} - - <tr> - <th id="WD_INTERVAL"><label>{$message.descWd_interval|escape}</label> - <p>wd_interval (integer) *</th> - <td> - <p>pgpool-II への生存監視の間隔(秒)です。 (1 以上の数値) </p> - </td> - </tr> - - {* --------------------------------------------------------------------- *} - {if paramExists('wd_lifecheck_method')} - <tr><th class="category" colspan="2">Lifecheck Setting (heartbeat mode)</th></tr> - - <tr> - <th id="WD_HEARTBEAT_PORT"><label>{$message.descWd_heartbeat_port|escape}</label> - <p>wd_heartbeat_port (integer) *</th> - <td> - <p>ハートビート信号を受信するポート番号を指定します。</p> - </td> - </tr> - - <tr> - <th id="WD_HEARTBEAT_KEEPALIVE"><label>{$message.descWd_heartbeat_keepalive|escape}</label> - <p>wd_heartbeat_keepalive (integer) *</th> - <td> - <p>ハートビート信号を送信する間隔(秒)を指定します。 デフォルトは 2 です。</p> - </td> - </tr> - - <tr> - <th id="WD_HEARTBEAT_DEADTIME"><label>{$message.descWd_heartbeat_deadtime|escape}</label> - <p>wd_heartbeat_deadtime (integer) *</th> - <td> - <p>このオプションで指定された間隔(秒)の間ハートビート信号が途絶えた場合、 - その pgpool-II に障害が発生したとみなされます。</p> - </td> - </tr> - - <tr> - <th id="HEARTBEAT_DESTINATION"><label>{$message.descHeartbeat_destination|escape}</label> - <p>heartbeat_destination (string) *</th> - <td> - <p>ハートビート信号の宛先をホスト名か IP で指定します。 - 数値の部分は送り先の番号です。 0 からの連番にします。 </p> - </td> - </tr> - - <tr> - <th id="HEARTBEAT_DESTINATION_PORT"><label>{$message.descHeartbeat_destination_port|escape}</label> - <p>heartbeat_destination_port (string) *</th> - <td> - <p><a href="HEARTBEAT_DESTINATION">heartbeat_destinationX</a>に指定したハートビート信号の送り先のポート番号を指定します。 - 通常は <a href="WD_HEARTBEAT_PORT">wd_heartbeat_port</a> と同じ値を指定します。 - そのポート番号が使用できないホストや、同じホストで複数の pgpool-II を動作させる場合には、異なる値を指定する必要があります。 - 数値の部分は送り先の番号です。0 からの連番にします。</p> - </td> - </tr> - - <tr> - <th id="HEARTBEAT_DEVICE"><label>{$message.descHeartbeat_device|escape}</label> - <p>heartbeat_device (string) *</th> - <td> - <p><a href="HEARTBEAT_DESTINATION">heartbeat_destinationX</a>に指定した送り先とのハートビートの送受信に用いるネットワークデバイス名を指定します。 - 数値の部分は送り先の番号です。デバイス毎に 0 からの連番にします。 - 複数の異なる送り先に同じデバイスを設定することが可能です。 - ハートビートモードの場合のみ有効です。 - また、SO_BINDTODEVICE ソケットオプションを使用しているため、pgpool-II が Linux で root 権限で起動している場合のみ有効です。</p> - </td> - </tr> - {/if} - - {* --------------------------------------------------------------------- *} - <tr><th class="category" colspan="2">Lifecheck Setting (query mode)</th></tr> - - <tr> - <th id="WD_LIFE_POINT"><label>{$message.descWd_life_point|escape}</label> - <p>wd_life_point (string) *</th> - <td> - <p>pgpool-II の死活監視で応答が得られなかった場合のリトライ回数です。 (1 以上の数値) </p> - </td> - </tr> - - <tr> - <th id="WD_LIFECHECK_QUERY"><label>{$message.descWd_lifecheck_query|escape}</label> - <p>wd_lifecheck_query (string) *</th> - <td> - <p>pgpool-II の死活監視のために発行されるクエリです。 デフォルトは "SELECT 1" です。</p> - </td> - </tr> - - {if paramExists('wd_lifecheck_dbname')} - <tr> - <th id="WD_LIFECHECK_DBNAME"><label>{$message.descWd_lifecheck_dbname|escape}</label> - <p>wd_lifecheck_dbname(string) *</th> - <td> - <p>pgpool-II の死活監視を行なうのに接続するデータベースです。 デフォルトは "template1" です。</p> - </td> - </tr> - - <tr> - <th id="WD_LIFECHECK_USER"><label>{$message.descWd_lifecheck_user|escape}</label> - <p>wd_lifecheck_user(string) *</th> - <td> - <p>pgpool-II の死活監視を行なうユーザです。 デフォルトは "nobody" です。</p> - </td> - </tr> - - <tr> - <th id="WD_LIFECHECK_PASSWORD"><label>{$message.descWd_lifecheck_password|escape}</label> - <p>wd_lifecheck_query (string) *</th> - <td> - <p>pgpool-II の死活監視を行なうユーザのパスワードです。 </p> - </td> - </tr> - {/if} - - <tr><th class="category" colspan="2">Servers to monitor</th></tr> - - <tr> - <th id="OTHER_PGPOOL_HOSTNAME"><label>{$message.descOther_pgpool_hostname|escape}</label> - <p>other_pgpool_hostname (string)</th> - <td> - <p>監視対象のpgpool-IIサーバのホスト名を指定します。 数値の部分は監視対象サーバの番号です。 - 監視対象のサーバ毎に 0 からの連番にします。</p> - </td> - </tr> - - <tr> - <th id="OTHER_PGPOOL_PORT"><label>{$message.descOther_pgpool_port|escape}</label> - <p>other_pgpool_port (integer)</th> - <td> - <p>監視対象のpgpool-IIサーバのpgpool用のポート番号を指定します。 数値の部分は監視対象サーバの番号です。 - 監視対象のサーバ毎に 0 からの連番にします。 </p> - </td> - </tr> - - <tr> - <th id="OTHER_WD_PORT"><label>{$message.descOther_wd_port|escape}</label> - <p>other_wd_port (integer)</th> - <td> - <p>監視対象のpgpool-IIサーバのwatchdog用のポート番号を指定します 数値の部分は監視対象サーバの番号です。 - 監視対象のサーバ毎に 0 からの連番にします。</p> - </td> - </tr> - - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> -{/if} - -{if hasMemqcache()} -<h3><a name="memqcache" id="memqcache">On Memory Query Cache</a></h3> - -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="MEMORY_CACHE_ENABLED"><label>{$message.descMemory_cache_enabled|escape}</label> - <p>memory_cache_enabled (bool)</th> - <td> - <p>オンメモリクエリキャッシュを有効にするには、このパラメータを有効にします。</p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_METHOD"><label>{$message.descMemqcache_method|escape}</label> - <p>memqcache_method (string) *</th> - <td> - <p> - メモリキャッシュのストレージには、共有メモリと <a href="http://memcached.org">memcached</a> のどちらかを - 選択することができます(併用はできません)。 - <p> - 共有メモリを使用するクエリキャッシュは高速で、memcached の立ち上げも必要なく、手軽に利用できます。 - ただし、共有メモリサイズの上限によって保存できるキャッシュの量に制限があります。 - memcached をキャッシュストレージに使用する場合は、ネットワークアクセスのオーバヘッドがあるものの、 - 比較的自由にキャッシュメモリの大きさを設定できます。 - </p> - <p> - 共有メモリを利用する場合は 'shmem'、Memcached を利用する場合は'memcached'と設定します。 - デフォルトは、'shmem'です。 - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Memcached specific</th></tr> - - <tr> - <th id="MEMQCACHE_MEMCACHED_HOST"><label>{$message.descMemqcache_memcached_host|escape}</label> - <p>memqcache_memcached_host (string) *</th> - <td> - <p> - memcached が動いているホスト名またはIPアドレスを指定します。 - pgpool-II と同じマシンで memcached を動かす場合は、'localhost' とします。 - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_MEMCACHED_PORT"><label>{$message.descMemqcache_memcached_port|escape}</label> - <p>memqcache_memcached_port (integer) *</th> - <td> - <p> - memcached のポート番号を指定します。デフォルト値は 11211 です。 - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Shared memory specific</th></tr> - - <tr> - <th id="MEMQCACHE_TOTAL_SIZE"><label>{$message.descMemqcache_total_size|escape}</label> - <p>memqcache_total_size (integer) *</th> - <td> - <p> - キャッシュストレージに使用する共有メモリ領域のサイズを指定します。単位はバイトです。 - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_MAX_NUM_CACHE"><label>{$message.descMemqcache_max_num_cache|escape}</label> - <p>memqcache_max_num_cache (integer) *</th> - <td> - <p> - キャッシュの数を指定します。 - この設定項目は、キャッシュの管理領域の大きさを決めるために使用します - (<a href="MEMQCACHE_TOTAL_SIZE">memqcache_total_size</a>と は別に取られます)。 - 管理領域の大きさは、memqcache_max_num_cache * 48 (バイト) になります。 - この数は少なすぎるとキャッシュを登録することができずにエラーになります。 - 逆に多すぎると無駄になります。 - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_CACHE_BLOCK_SIZE"><label>{$message.descMemqcache_cache_block_size|escape}</label> - <p>memqcache_cache_block_size (integer) *</th> - <td> - <p> - キャッシュストレージとして共有メモリを使用する場合は、メモリを - memqcache_cache_block_size のブロックに分けて利用します。 - 検索結果のキャッシュはこのブロックに入るだけ詰め込まれます。 - ただし、キャッシュは複数のブロックにまたがって格納されないので、 - memqcache_cache_block_size を検索結果が超えると、キャッシュに格納できなくなります。 - </p> - <p> - memqcache_cache_block_size は、512 以上の値でなければなりません。 - </p> - </td> - </tr> - - <tr><th class="category" colspan="2">Common</th></tr> - - <tr> - <th id="MEMQCACHE_EXPIRE"><label>{$message.descMemqcache_expire|escape}</label> - <p>memqcache_expire (integer) *</th> - <td> - <p> - クエリキャッシュの寿命を秒単位で設定します。デフォルトは 60 です。 - 0 を指定すると寿命が無限大になり、関連テーブルが更新されるまではキャッシュが有効になります。 - </p> - <p> - なお、この設定は、<a href="#MEMQCACHE_AUTO_CACHE_INVALIDATION">memqcache_auto_cache_invalidation</a>とは - 独立です。 - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_MAXCACHE"><label>{$message.descMemqcache_maxcache|escape}</label> - <p>memqcache_maxcache (integer) *</th> - <td> - <p> - true ならば関連するテーブルが更新されるとキャッシュを無効化します。 - false ならばテーブルが更新されてもキャッシュを無効化しません。 - デフォルト値は true です。 - </p> - <p> - なお、この設定は<a href="#MEMQCACHE_EXPIRE">memqcache_expire</a>の設定とは独立です。 - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_AUTO_CACHE_INVALIDATION"><label>{$message.descMemqcache_auto_cache_invalidation|escape}</label> - <p>memqcache_auto_cache_invalidation (bool) *</th> - <td> - <p> - SELECT文の実行結果が memqcache_maxcache バイトを超えると、キャッシュされません。 - </p> - <p> - この問題を回避するためには、memqcache_maxcache を大きくすれば良いのですが、 - キャッシュストレージとして共有メモリを使用する場合は、 - <a href="#MEMQCACHE_CACHE_BLOCK_SIZE">memqcache_cache_block_size</a> を超えないようにしてください。 - キャッシュストレージとして memcached を使用する場合は、 - memcached のスラブサイズ(デフォルトで 1MB)を超えないようにしてください。 - </p> - </td> - </tr> - - <tr> - <th id="MEMQCACHE_OIDDIR"><label>{$message.descMemqcache_oiddir|escape}</label> - <p>memqcache_oiddir (string) *</th> - <td> - <p> - SELECT 文が使用するテーブルに OID を格納する一時ファイル領域のトップディレクトリをフルパスで指定します。 - memqcache_oiddir 以下には、データベース OID 名のディレクトリが作成され、 - 更にその下にはテーブル OID 名のファイルが作成されます。 - テーブル OID 名ファイルの中には、クエリキャッシュへのポインタが格納されており、 - テーブルの更新があった際にキャッシュを削除するキーとなります。 - </p> - <p> - この領域は pgpool が再起動されると自動的に削除されます。 - </p> - </td> - </tr> - - <tr> - <th id="WHITE_MEMQCACHE_TABLE_LIST"><label>{$message.descWhite_memqcache_table_list|escape}</label> - <p>white_memqcache_table_list (string)</th> - <td> - <p> - VIEW やunloggedテーブルを使っているSELECTは通常キャッシュの対象になりませんが、 - white_memqcache_table_list に記述しておくことで、キャッシュされるようになります。 - テーブル名はカンマ区切りで指定します。 - 正規表現も利用できます(指定した各表現に ^ と $ をつけた形で使われます)。 - <p> - なお、同じテーブル・VIEW が <a href="#BLACK_MEMQCACHE_TABLE_LIST">black_memqcache_table_list</a> と両方に - 指定されている場合は、white_memqcache_table_list が優先され、キャッシュを利用します。 - </p> - </td> - </tr> - - <tr> - <th id="BLACK_MEMQCACHE_TABLE_LIST"><label>{$message.descBlack_memqcache_table_list|escape}</label> - <p>black_memqcache_table_list(string)</th> - <td> - <p> - SELECT 結果をキャッシュしたくないテーブル名をカンマ区切りで指定します。 - 正規表現も利用できます(指定した各表現に ^ と $ をつけた形で使われます)。 - </p> - </td> - </tr> - - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> -{/if} - -<h3><a name="others">Others</a></h3> - -{if paramExists('relcache_expire')} -<table> - <thead> - <tr> - <th width="240">{$message.strParameter|escape}</th> - <th>{$message.strDetail|escape}</th> - </tr> - </thead> - <tbody> - <tr> - <th id="RELCACHE_EXPIRE"><label>{$message.descRelcache_expire|escape}</label> - <p>relcache_expire (integer)</th> - <td> - <p> - リレーションキャッシュの寿命を秒単位で指定します。 - 0を指定すると、キャッシュの寿命の管理は行わず、プロセスが生きているか、 - キャッシュが溢れるまでは有効になります(デフォルトの動作)。 - </p> - <p> - リレーションキャッシュは、PostgreSQL のシステムカタログに対する問い合わせを保存しておくものです。 - 問い合わせる内容は、テーブルの構造、テーブルが一時テーブルかどうかなどがあります。 - キャッシュは pgpool の子プロセスのローカルメモりに保管されています。 - <p> - もし ALTER TABLE が発行されると、テーブルの構造が変わる場合があり、 - リレーションキャッシュの内容と一致しなくなる恐れがあります。 - relcache_expireにより、その危険性をコントロールできるようになります。 - </p> - </td> - </tr> - - {if paramExists('relcache_size')} - <th id="RELCACHE_SIZE"><label>{$message.descRelcache_size|escape}</label> - <p>relcache_size (integer)</th> - <td> - <p>リレーションキャッシュのサイズを指定します。 デフォルトは256です。</p> -<pre> -"pool_search_relcache: cache replacement happend" -</pre> - <p>のようなメッセージがログに頻繁に出る場合は、この数字を大きくしてください。</p> - </td> - </tr> - {/if} - - {if paramExists('check_temp_table')} - <th id="CHECK_TEMP_TABLE"><label>{$message.descCheck_temp_table|escape}</label> - <p>check_temp_table (bool)</th> - <td> - <p>もし on なら、SELECT に含まれるテーブルが一時テーブルかどうかのチェックを行います。 - このチェックは、primary/master のシステムカタログへのアクセスを発生させ、それなりに負荷を上げます。 - もし一時テーブルを使っていないということが確かで、primary/master の負荷を少しでも下げたいのであれば、 - off にすることができます。デフォルトは on です。</p> - </td> - </tr> - {/if} - </tbody> - <tfoot> - <tr> - <td colspan="2"></td> - </tr> - </tfoot> -</table> -{/if} - </div> <hr class="hidden" /> <div id="footer"> diff --git a/templates/pgconfig.tpl b/templates/pgconfig.tpl index 75d96f4..b2ae6cb 100644 --- a/templates/pgconfig.tpl +++ b/templates/pgconfig.tpl @@ -128,7 +128,7 @@ function delHeartbeatDestination(num){ <li><a href="#watchdog">Watchdog</a></li> {/if} {if hasMemqcache()} - <li><a href="#memqcache">On Memory Query Cache</a></li> + <li><a href="#memqcache">In Memory Query Cache</a></li> {/if} {if paramExists('relcache_expire')} <li><a href="#others">Others</a></li> @@ -184,6 +184,17 @@ function delHeartbeatDestination(num){ <td><input type="text" name="socket_dir" value="{$params.socket_dir|escape}"/></td> </tr> + {if paramExists('listen_backlog_multiplier')} + <tr> + <th{if isset($error.listen_backlog_multiplier)} class="error"{/if}> + <label>{$message.descListen_backlog_multiplier|escape}</label> + <br />listen_backlog_multiplier (integer) *</th> + <td><input type="text" name="listen_backlog_multiplier" + value="{$params.listen_backlog_multiplier|escape}"/></td> + </tr> + {/if} + + <tr> {if paramExists('backend_socket_dir')} <tr> <th{if isset($error.backend_socket_dir)} class="error"{/if}> @@ -839,7 +850,9 @@ function delHeartbeatDestination(num){ <br />white_function_list (string)</th> <td><input type="text" name="white_function_list" value="{$params.white_function_list|escape}"/></td> </tr> + {/if} + {if paramExists('black_function_list')} <tr> <th{if isset($error.black_function_list)} class="error"{/if}> <label>{$message.descBlack_function_list|escape}</label> @@ -848,6 +861,36 @@ function delHeartbeatDestination(num){ </tr> {/if} + {if paramExists('database_redirect_preference_list')} + <tr> + <th{if isset($error.database_redirect_preference_list)} class="error"{/if}> + <label>{$message.descDatabase_redirect_preference_list|escape}</label> + <br />database_redirect_preference_list(string)</th> + <td><input type="text" name="database_redirect_preference_list" + value="{$params.database_redirect_preference_list|escape}"/></td> + </tr> + {/if} + + {if paramExists('app_name_redirect_preference_list')} + <tr> + <th{if isset($error.app_name_redirect_preference_list)} class="error"{/if}> + <label>{$message.descApp_name_redirect_preference_list|escape}</label> + <br />app_name_redirect_preference_list (string)</th> + <td><input type="text" name="app_name_redirect_preference_list" + value="{$params.app_name_redirect_preference_list|escape}"/></td> + </tr> + {/if} + + {if paramExists('allow_sql_comments')} + <tr> + <th{if isset($error.allow_sql_comments)} class="error"{/if}> + <label>{$message.descAllow_sql_comments|escape}</label> + <br />allow_sql_comments (bool) *</th> + <td><input type="checkbox" name="allow_sql_comments" + id="allow_sql_comments" value="true" + {if $params.allow_sql_comments == 'on'}checked="checked"{/if} /></td> + </tr> + {/if} </tbody> </table> @@ -1103,7 +1146,9 @@ function delHeartbeatDestination(num){ <br />health_check_max_retries (integer)</th> <td><input type="text" name="health_check_max_retries" value="{$params.health_check_max_retries|escape}"/></td> </tr> + {/if} + {if paramExists('health_check_retry_delay')} <tr> <th{if isset($error.health_check_retry_delay)} class="error"{/if}> <label>{$message.descHealth_check_retry_delay|escape}</label> @@ -1111,6 +1156,16 @@ function delHeartbeatDestination(num){ <td><input type="text" name="health_check_retry_delay" value="{$params.health_check_retry_delay|escape}"/></td> </tr> {/if} + + {if paramExists('connect_timeout')} + <tr> + <th{if isset($error.connect_timeout)} class="error"{/if}> + <label>{$message.desCconnect_timeout|escape}</label> + <br />connect_timeout (integer)</th> + <td><input type="text" name="connect_timeout" value="{$params.connect_timeout|escape}"/></td> + </tr> + {/if} + </tbody> </tbody> </table> @@ -1590,9 +1645,9 @@ function delHeartbeatDestination(num){ {if hasMemqcache()} {* --------------------------------------------------------------------- * - * On Memory Query Cache * + * In Memory Query Cache * * --------------------------------------------------------------------- *} - <h3><a name="memqcache" id="memqcache">On Memory Query Cache</a></h3> + <h3><a name="memqcache" id="memqcache">In Memory Query Cache</a></h3> <table> <thead> |