diff options
-rw-r--r-- | common.php | 11 | ||||
-rw-r--r-- | definePgpoolConfParam.php | 110 | ||||
-rw-r--r-- | lang/en.lang.php | 9 | ||||
-rw-r--r-- | lang/ja.lang.php | 9 | ||||
-rw-r--r-- | pgconfig.php | 642 | ||||
-rw-r--r-- | screen.css | 11 | ||||
-rw-r--r-- | templates/help/en/pgconfig.tpl | 219 | ||||
-rw-r--r-- | templates/help/ja/pgconfig.tpl | 223 | ||||
-rw-r--r-- | templates/pgconfig.tpl | 315 |
9 files changed, 1065 insertions, 484 deletions
@@ -30,7 +30,7 @@ error_reporting(E_ALL); function versions() { - return array('3.2', '3.1', '3.0', + return array('3.3', '3.2', '3.1', '3.0', '2.3', '2.2', '2.1', '2.0'); } @@ -543,6 +543,15 @@ function paramExists($param) /* Add */ // params added in 3.3 + case 'clear_memqcache_on_escalation': + case 'heartbeat_device': + case 'heartbeat_destination': + case 'wd_authkey': + case 'wd_escalation_command': + case 'wd_lifecheck_method': + case 'wd_heartbeat_port': + case 'wd_heartbeat_keepalive': + case 'wd_heartbeat_deadtime': case 'wd_lifecheck_dbname': case 'wd_lifecheck_user': case 'wd_lifecheck_password': diff --git a/definePgpoolConfParam.php b/definePgpoolConfParam.php index 29145b1..7036e64 100644 --- a/definePgpoolConfParam.php +++ b/definePgpoolConfParam.php @@ -238,14 +238,14 @@ $pgpoolConfigParam[$key]['regexp'] = selectreg(array('always', 'if_over_threshol # - Syslog specific - $key = 'syslog_facility'; -$pgpoolConfigBackendParam[$key]['type'] = 'C'; -$pgpoolConfigBackendParam[$key]['default'] = 'LOCAL0'; -$pgpoolConfigBackendParam[$key]['regexp'] = $strreg; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = 'LOCAL0'; +$pgpoolConfigParam[$key]['regexp'] = $strreg; $key = 'syslog_ident'; -$pgpoolConfigBackendParam[$key]['type'] = 'C'; -$pgpoolConfigBackendParam[$key]['default'] = 'pgpool'; -$pgpoolConfigBackendParam[$key]['regexp'] = $strreg; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = 'pgpool'; +$pgpoolConfigParam[$key]['regexp'] = $strreg; # - Debug - @@ -524,20 +524,13 @@ $pgpoolConfigParam[$key]['max'] = NUM_MAX; # WATCHDOG #------------------------------------------------------------------------------ +# Enabling + $key = 'use_watchdog'; $pgpoolConfigParam[$key]['type'] = 'B'; $pgpoolConfigParam[$key]['default'] = 'off'; -$key = 'trusted_servers'; -$pgpoolConfigParam[$key]['type'] = 'C'; -$pgpoolConfigParam[$key]['default'] = ''; -$pgpoolConfigParam[$key]['regexp'] = $anyelse; - -$key = 'delegate_IP'; -$pgpoolConfigParam[$key]['type'] = 'C'; -$pgpoolConfigParam[$key]['default'] = ''; -$pgpoolConfigParam[$key]['regexp'] = $addressreg; -$pgpoolConfigParam[$key]['null_ok'] = TRUE; +# Watchdog communication $key = 'wd_hostname'; $pgpoolConfigParam[$key]['type'] = 'C'; @@ -551,17 +544,32 @@ $pgpoolConfigParam[$key]['default'] = 9000; $pgpoolConfigParam[$key]['max'] = NUM_MAX; $pgpoolConfigParam[$key]['min'] = 1024; -$key = 'wd_interval'; -$pgpoolConfigParam[$key]['type'] = 'N'; -$pgpoolConfigParam[$key]['default'] = 10; -$pgpoolConfigParam[$key]['max'] = NUM_MAX; -$pgpoolConfigParam[$key]['min'] = 0; +$key = 'wd_authkey'; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = ''; +$pgpoolConfigParam[$key]['regexp'] = $anyelse; +$pgpoolConfigParam[$key]['null_ok'] = TRUE; + +# Connection to up stream servers + +$key = 'trusted_servers'; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = ''; +$pgpoolConfigParam[$key]['regexp'] = $anyelse; $key = 'ping_path'; $pgpoolConfigParam[$key]['type'] = 'C'; $pgpoolConfigParam[$key]['default'] = ''; $pgpoolConfigParam[$key]['regexp'] = $anyelse; +# Virtual IP control + +$key = 'delegate_IP'; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = ''; +$pgpoolConfigParam[$key]['regexp'] = $addressreg; +$pgpoolConfigParam[$key]['null_ok'] = TRUE; + $key = 'ifconfig_path'; $pgpoolConfigParam[$key]['type'] = 'C'; $pgpoolConfigParam[$key]['default'] = ''; @@ -587,6 +595,64 @@ $pgpoolConfigParam[$key]['type'] = 'C'; $pgpoolConfigParam[$key]['default'] = ''; $pgpoolConfigParam[$key]['regexp'] = $anyelse; +# Behaivor on escalation + +$key = 'clear_memqcache_on_escalation'; +$pgpoolConfigParam[$key]['type'] = 'B'; +$pgpoolConfigParam[$key]['default'] = 'on'; + +$key = 'wd_escalation_command'; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = ''; +$pgpoolConfigParam[$key]['regexp'] = $anyelse; + +# Life checking pgpool-II + +# (Common) + +$key = 'wd_lifecheck_method'; +$pgpoolConfigParam[$key]['type'] = 'C'; +$pgpoolConfigParam[$key]['default'] = 'heartbeat'; +$pgpoolConfigParam[$key]['regexp'] = selectreg(array('heartbeat', 'query')); + +$key = 'wd_interval'; +$pgpoolConfigParam[$key]['type'] = 'N'; +$pgpoolConfigParam[$key]['default'] = 10; +$pgpoolConfigParam[$key]['max'] = NUM_MAX; +$pgpoolConfigParam[$key]['min'] = 0; + +# (Configuration of heartbeat mode) + +$key = 'wd_heartbeat_port'; +$pgpoolConfigParam[$key]['type'] = 'N'; +$pgpoolConfigParam[$key]['default'] = 9694; +$pgpoolConfigParam[$key]['max'] = NUM_MAX; +$pgpoolConfigParam[$key]['min'] = 0; + +$key = 'wd_heartbeat_keepalive'; +$pgpoolConfigParam[$key]['type'] = 'N'; +$pgpoolConfigParam[$key]['default'] = 2; +$pgpoolConfigParam[$key]['max'] = NUM_MAX; +$pgpoolConfigParam[$key]['min'] = 0; + +$key = 'wd_heartbeat_deadtime'; +$pgpoolConfigParam[$key]['type'] = 'N'; +$pgpoolConfigParam[$key]['default'] = 30; +$pgpoolConfigParam[$key]['max'] = NUM_MAX; +$pgpoolConfigParam[$key]['min'] = 0; + +$key = 'heartbeat_device'; +$pgpoolConfigHbDeviceParam[$key]['type'] = 'C'; +$pgpoolConfigHbDeviceParam[$key]['default'] = 'eth0'; +$pgpoolConfigHbDeviceParam[$key]['regexp'] = $anyelse; + +$key = 'heartbeat_destination'; +$pgpoolConfigHbDeviceParam[$key]['type'] = 'C'; +$pgpoolConfigHbDeviceParam[$key]['default'] = ''; +$pgpoolConfigHbDeviceParam[$key]['regexp'] = $anyelse; + +# (Configuration of query mode) + $key = 'wd_life_point'; $pgpoolConfigParam[$key]['type'] = 'N'; $pgpoolConfigParam[$key]['default'] = 3; @@ -613,7 +679,7 @@ $pgpoolConfigParam[$key]['type'] = 'C'; $pgpoolConfigParam[$key]['default'] = ''; $pgpoolConfigParam[$key]['regexp'] = $anyelse; -# Other pgpool Connection Settings +# Servers to monitor $key = 'other_pgpool_hostname'; $pgpoolConfigWdOtherParam[$key]['type'] = 'C'; diff --git a/lang/en.lang.php b/lang/en.lang.php index 38e1e01..fdb6b95 100644 --- a/lang/en.lang.php +++ b/lang/en.lang.php @@ -41,6 +41,7 @@ $message = array( 'descBlack_memqcache_table_list' => 'Comma separated list of table names not to be cached', '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', 'descClient_idle_limit' => 'Timeout in seconds while waiting for a query from a client', 'descClient_idle_limit_in_recovery' => 'Timeout in seconds while waiting for a query '. 'from a client in on line recovery', @@ -58,6 +59,8 @@ $message = array( 'in UPDATE/DELETE', 'descFail_over_on_backend_error' => 'Fail over when socket communication error to backend occurs', 'descFollow_master_command' => 'Command to run only after a master failover', + 'descHeartbeat_destination' => 'The destination of heartbeat signals which is sent from the device. Specify by hostname or IP address.', + 'descHeartbeat_device' => 'The network device name for sending heartbeat signals', 'descHealth_check_period' => 'Specifies the interval for next health checking. 0 means no health checking, '. '-1 means no wait', 'descHealth_check_timeout' => 'Pgpool does "health check" periodically to detect PostgreSQL servers down, '. @@ -146,10 +149,16 @@ $message = array( 'descSystem_db_user' => 'The username when connection system database', 'descTrusted_servers' => 'The list of trusted servers to check the up stream connections', 'descUse_watchdog' => 'Enable watchdog', + 'descWd_authkey' => 'The authentication key used in watchdog communication', + 'descWd_escalation_command' => 'The command which will be executed on the new active when pgpool-II escaltes to active', + 'descWd_heartbeat_deadtime' => 'If there are no heartbeat signal for the period specified by this option, watchdog regards it as failure of the remote pgpool-II.', + 'descWd_heartbeat_keepalive' => 'The interval time of sending heartbeat signals in seconds', + 'descWd_heartbeat_port' => 'The port number to receive heartbeat signals', 'descWd_hostname' => 'The hostname or IP address in which pgpool-II works', 'descWd_interval' => 'The interval between life checks of pgpool-II in second', 'descWd_life_point' => 'The times to retry a failed life check of pgpool-II', 'descWd_lifecheck_dbname' => 'The database name connected for checking pgpool-II', + 'descWd_lifecheck_method' => 'The method of life check', 'descWd_lifecheck_query' => 'Actual query to check pgpool-II', 'descWd_lifecheck_password' => 'The user name to check pgpool-II', 'descWd_lifecheck_user' => 'The password of the user to check pgpool-II', diff --git a/lang/ja.lang.php b/lang/ja.lang.php index 6be05a0..e1ea239 100644 --- a/lang/ja.lang.php +++ b/lang/ja.lang.php @@ -41,6 +41,7 @@ $message = array( 'descCheck_temp_table' => '一時テーブルかどうかをチェック', 'descChild_life_time' => 'pgpoolの子プロセスの寿命', 'descChild_max_connections' => '各pgpool子プロセスが終了するまでの接続回数', + 'descClear_memqcache_on_escalation' => 'アクティブ昇格時に共有メモリ上のクエリキャッシュを削除するかどうか', 'descClient_idle_limit' => 'クライアントからのクエリの最大待ち時間(秒)', 'descClient_idle_limit_in_recovery' => 'リカバリ中のクライアントからのクエリの最大待ち時間(秒)', 'descConnection_cache' => 'コネクションキャッシュ機能の有無', @@ -55,6 +56,8 @@ $message = array( 'descFailover_if_affected_tuples_mismatch' => '更新行数が一致しないときにフェイルオーバ', 'descFail_over_on_backend_error' => 'DBノードへのソケット通信エラー時にフェイルオーバ', 'descFollow_master_command' => 'マスタのフェイルオーバ後に実行するコマンド', + 'descHeartbeat_destination' => 'ハートビート信号の送信先ホスト名または IP アドレス', + 'descHeartbeat_device' => 'ハートビートの送受信に用いるネットワークデバイス名', 'descHealth_check_period' => 'ヘルスチェックを行う間隔(秒)', 'descHealth_check_timeout' => 'ヘルスチェックが長時間待たされるのを防ぐためのタイムアウト値(秒)', 'descHealth_check_user' => 'ヘルスチェックを行うためのPostgreSQLユーザ名', @@ -137,10 +140,16 @@ $message = array( 'descSystem_db_user' => 'System DBに接続するときのユーザ名', 'descTrusted_servers' => '上位サーバのコンマ区切りのリスト', 'descUse_watchdog' => 'watchdog 機能の有無', + 'descWd_authkey' => 'wachdog 間通信で用いられる認証キー', + 'descWd_escalation_command' => 'アクティブ昇格時に実行するコマンド', + 'descWd_heartbeat_deadtime' => '障害発生とみなすまでの猶予(秒)', + 'descWd_heartbeat_keepalive' => 'ハートビート信号を送信する間隔(秒)', + 'descWd_heartbeat_port' => 'ハートビート信号を受信するポート番号', 'descWd_hostname' => 'watchdog プロセスが相互監視を受信するためのホスト名', 'descWd_interval' => '死活監視の間隔(秒)', 'descWd_life_point' => '死活監視のリトライ回数', 'descWd_lifecheck_dbname' => '死活監視を行なうために接続するデータベース', + 'descWd_lifecheck_method' => '死活監視の方法', 'descWd_lifecheck_query' => '死活監視で実行するクエリ', 'descWd_lifecheck_password' => '死活監視を行なうユーザのパスワード', 'descWd_lifecheck_user' => '死活監視を行なうユーザ', diff --git a/pgconfig.php b/pgconfig.php index 6aed56a..93b9844 100644 --- a/pgconfig.php +++ b/pgconfig.php @@ -27,7 +27,6 @@ require_once('common.php'); require('definePgpoolConfParam.php'); $tpl->assign('help', basename( __FILE__, '.php')); - if (!isset($_SESSION[SESSION_LOGIN_USER])) { header('Location: login.php'); exit(); @@ -49,135 +48,28 @@ if (isset($_POST['action'])) { switch ($action) { case 'add': case 'add_wd': - - // Boolean value - foreach ($pgpoolConfigParam as $key => $value) { - if ($pgpoolConfigParam[$key]['type'] == 'B') { - if (isset($_POST[$key])) { - $configValue[$key] = 'on'; - } else { - $configValue[$key] = 'off'; - } - } elseif (isset($_POST[$key])) { - $configValue[$key] = trim($_POST[$key]); - } - } - - // Backend settings - if (isset($_POST['backend_hostname'])) { - $configValue['backend_hostname'] = $_POST['backend_hostname']; - } else { - $configValue['backend_hostname'][0] = NULL; - - } - if (isset($_POST['backend_port'])) { - $configValue['backend_port'] = $_POST['backend_port']; - } else { - $configValue['backend_port'][0] = NULL; - } - - if (isset($_POST['backend_weight'])) { - $configValue['backend_weight'] = $_POST['backend_weight']; - } else { - $configValue['backend_weight'][0] = NULL; - } - - if (isset($_POST['backend_data_directory'])) { - $configValue['backend_data_directory'] = $_POST['backend_data_directory']; - } else { - $configValue['backend_data_directory'][0] = NULL; - } - - if (paramExists('backend_flag')) { - if (isset($_POST['backend_flag'])) { - $configValue['backend_flag'] = $_POST['backend_flag']; - } else { - $configValue['backend_flag'][0] = NULL; - } - } - - // watchdog settings - if (isset($_POST['other_pgpool_hostname'])) { - $configValue['other_pgpool_hostname'] = $_POST['other_pgpool_hostname']; - } else { - $configValue['other_pgpool_hostname'][0] = NULL; - - } - - if (isset($_POST['other_pgpool_port'])) { - $configValue['other_pgpool_port'] = $_POST['other_pgpool_port']; - } else { - $configValue['other_pgpool_port'][0] = NULL; - } - - if (isset($_POST['other_wd_port'])) { - $configValue['other_wd_port'] = $_POST['other_wd_port']; - } else { - $configValue['other_wd_port'][0] = NULL; - } + case 'add_heartbeat_device': + $configValue = arrangePostData(); + $configValue = doAdd($configValue); $tpl->assign('params', $configValue); - $tpl->assign('isAdd', ($action == 'add')); + $tpl->assign('isAdd', ($action == 'add')); $tpl->assign('isAddWd', ($action == 'add_wd')); + $tpl->assign('isAddHeartbeatDevice', ($action == 'add_heartbeat_device')); $tpl->display('pgconfig.tpl'); return; case 'cancel': case 'cancel_wd': - - // Boolean value - foreach ($pgpoolConfigParam as $key => $value) { - if ($pgpoolConfigParam[$key]['type'] == 'B') { - if (isset($_POST[$key])) { - $configValue[$key] = 'on'; - } else { - $configValue[$key] = 'off'; - } - } elseif (isset($_POST[$key])) { - $configValue[$key] = trim($_POST[$key]); - } - } - - // Backend settings - if (isset($_POST['backend_hostname'])) { - $configValue['backend_hostname'] = $_POST['backend_hostname']; - } - if (isset($_POST['backend_port'])) { - $configValue['backend_port'] = $_POST['backend_port']; - } - if (isset($_POST['backend_weight'])) { - $configValue['backend_weight'] = $_POST['backend_weight']; - } - if (isset($_POST['backend_data_directory'])) { - $configValue['backend_data_directory'] = $_POST['backend_data_directory']; - } - if (paramExists('backend_flag') && isset($_POST['backend_flag'])) { - $configValue['backend_flag'] = $_POST['backend_flag']; - } - array_pop($configValue['backend_hostname']); - array_pop($configValue['backend_port']); - array_pop($configValue['backend_weight']); - array_pop($configValue['backend_data_directory']); - array_pop($configValue['backend_flag']); - - // watchdog settings - if (isset($_POST['other_pgpool_hostname'])) { - $configValue['other_pgpool_hostname'] = $_POST['other_pgpool_hostname']; - } - if (isset($_POST['other_pgpool_port'])) { - $configValue['other_pgpool_port'] = $_POST['other_pgpool_port']; - } - if (isset($_POST['other_wd_port'])) { - $configValue['other_wd_port'] = $_POST['other_wd_port']; - } - array_pop($configValue['other_pgpool_hostname']); - array_pop($configValue['other_pgpool_port']); - array_pop($configValue['other_wd_port']); + case 'cancel_heartbeat_device': + $configValue = arrangePostData(); + $configValue = doCancel($configValue, $action); $tpl->assign('params', $configValue); - $tpl->assign('isAdd', !($action == 'cancel')); - $tpl->assign('isAddWd', !($action == 'cancel_wd')); + $tpl->assign('isAdd', FALSE); + $tpl->assign('isAddWd', FALSE); + $tpl->assign('isAddHeartbeatDevice', FALSE); $tpl->display('pgconfig.tpl'); return; @@ -199,171 +91,15 @@ foreach ($pgpoolConfigParam as $key => $value) { switch ($action) { case 'update': + $configValue = arrangePostData(); + $error = doCheck(); - /** - * copy from POST data to $configValue except backend value - */ - foreach ($pgpoolConfigParam as $key => $value) { - if ($pgpoolConfigParam[$key]['type'] == 'B') { - if (isset($_POST[$key])) { - $configValue[$key] = 'true'; - } else { - $configValue[$key] = 'false'; - } - } elseif (isset($_POST[$key])) { - $configValue[$key] = trim($_POST[$key]); - } - } - - /** - * Confirmations of value except backend host - */ - foreach ($pgpoolConfigParam as $key => $value) { - check($key, $value, $configValue, $error); - } - - /** - * copy backend value from POST data to $configValue - */ - foreach ($pgpoolConfigBackendParam as $key => $value) { - if (isset($_POST[$key])) { - $configValue[$key] = $_POST[$key]; - } - } - - /** - * check backend value - */ - if (isset($configValue['backend_hostname'])) { - for ($i = 0; $i < count($configValue['backend_hostname']); $i++) { - $result = FALSE; - - // backend_hostname - $result = checkString($configValue['backend_hostname'][$i], - $pgpoolConfigBackendParam['backend_hostname']['regexp']); - if (!$result) { - $error['backend_hostname'][$i] = TRUE; - } - - // backend_port - $result = checkInteger($configValue['backend_port'][$i], - $pgpoolConfigBackendParam['backend_port']['min'], - $pgpoolConfigBackendParam['backend_port']['max']); - if (!$result) { - $error['backend_port'][$i] = TRUE; - } - - // backend_weight - $result = checkFloat($configValue['backend_weight'][$i], - $pgpoolConfigBackendParam['backend_weight']['min'], - $pgpoolConfigBackendParam['backend_weight']['max']); - if (!$result) { - $error['backend_weight'][$i] = TRUE; - } - - // backend_data_directory - $result = checkString($configValue['backend_data_directory'][$i], - $pgpoolConfigBackendParam['backend_data_directory']['regexp']); - if (!$result) { - $error['backend_data_directory'][$i] = TRUE; - } - - // backend_flag - if (paramExists('backend_flag')) { - $result = checkString($configValue['backend_flag'][$i], - $pgpoolConfigBackendParam['backend_flag']['regexp']); - if (!$result) { - $error['backend_flag'][$i] = TRUE; - } - } - } - } - - /** - * copy backend value from POST data to $configValue - */ - foreach ($pgpoolConfigWdOtherParam as $key => $value) { - if (isset($_POST[$key])) { - $configValue[$key] = $_POST[$key]; - } - } - - /** - * check other watchdog value - */ - if (isset($configValue['other_pgpool_hostname'])) { - for ($i = 0; $i < count($configValue['other_pgpool_hostname']); $i++) { - $result = FALSE; - - // other_pgpool_hostname - $result = checkString($configValue['other_pgpool_hostname'][$i], - $pgpoolConfigWdOtherParam['other_pgpool_hostname']['regexp']); - if (!$result) { - $error['other_pgpool_hostname'][$i] = TRUE; - } - - // other_pgpool_port - $result = checkInteger($configValue['other_pgpool_port'][$i], - $pgpoolConfigWdOtherParam['other_pgpool_port']['min'], - $pgpoolConfigWdOtherParam['other_pgpool_port']['max']); - - // other_wd_port - $result = checkInteger($configValue['other_wd_port'][$i], - $pgpoolConfigWdOtherParam['other_wd_port']['min'], - $pgpoolConfigWdOtherParam['other_wd_port']['max']); - } - } - - /* - * Chek if there are some errors - */ - $isError = FALSE; - foreach ($error as $key => $value) { - if (preg_match("/^backend_hostname/", $key) || - preg_match("/^backend_port/", $key) || - preg_match("/^backend_weight/", $key) || - preg_match("/^backend_data_directory/", $key) || - preg_match("/^backend_flag/", $key)) - { - for ($i = 0; $i < count($value); $i++) { - if ($value[$i] == TRUE) { - $isError = TRUE; - } - } - - } elseif ( - preg_match("/^other_pgpool_hostname/", $key) || - preg_match("/^other_pgpool_port/", $key) || - preg_match("/^other_wd_port/", $key)) - { - for ($i = 0; $i < count($value); $i++) { - if ($value[$i] == TRUE) { - $isError = TRUE; - } - } - - } elseif ($value == TRUE) { - $isError = TRUE; - } - - if ($isError) { break; } - } - - /* check logically */ - $logical_errors = checkLogical($configValue); - if ($logical_errors) { - $isError = TRUE; - $error += $logical_errors; - } - - /** - * Display - */ - if (!$isError) { + if (! $error) { if (is_writable(_PGPOOL2_CONFIG_FILE)) { writeConfigFile($configValue, $pgpoolConfigParam); $configValue = readConfigParams(); $tpl->assign('status', 'success'); + } else { $errorCode = 'e4003'; $tpl->assign('errorCode', $errorCode); @@ -379,6 +115,7 @@ switch ($action) { case 'delete': case 'delete_wd': + case 'delete_heartbeat_device': $num = $_POST['num']; switch ($action) { @@ -386,6 +123,8 @@ switch ($action) { deleteBackendHost($num, $configValue); break; case 'delete_wd': deleteWdOther($num, $configValue); break; + case 'cancel_heartbeat_device': + deleteHeartbeatDevice($num, $configValue); break; } if (is_writable(_PGPOOL2_CONFIG_FILE)) { @@ -405,6 +144,7 @@ switch ($action) { default: } +/* Set each empty object if null */ if (!isset($configValue['backend_hostname'])) { $configValue['backend_hostname'][0] = NULL; $configValue['backend_port'][0] = NULL; @@ -413,6 +153,11 @@ if (!isset($configValue['backend_hostname'])) { $configValue['backend_flag'][0] = NULL; } +if (!isset($configValue['heartbeat_device'])) { + $configValue['heartbeat_device'][0] = NULL; + $configValue['heartbeat_destination'][0] = NULL; +} + if (!isset($configValue['other_pgpool_hostname'])) { $configValue['other_pgpool_hostname'][0] = NULL; $configValue['other_pgpool_port'][0] = NULL; @@ -552,6 +297,9 @@ function checkBoolean($str) } } +/** + * Check if there is no paradoxes in settings + */ function checkLogical($configValue) { $errors = array(); @@ -646,7 +394,9 @@ function writeConfigFile($configValue, $pgpoolConfigParam) !preg_match("/^backend_flag/", $key) && !preg_match("/^other_pgpool_hostname/", $key) && !preg_match("/^other_pgpool_port/", $key) && - !preg_match("/^other_wd_port/", $key) + !preg_match("/^other_wd_port/", $key) && + !preg_match("/^heartbeat_device/", $key) && + !preg_match("/^heartbeat_destination/", $key) ) { $tmpConfigFile[] = $line; @@ -706,6 +456,13 @@ function writeConfigFile($configValue, $pgpoolConfigParam) } } + if (isset($configValue['heartbeat_device'])) { + for ($i = 0; $i < count($configValue['heartbeat_device']); $i++) { + $configFile[] = "heartbeat_device$i = '" . $configValue['heartbeat_device'][$i] . "'\n"; + $configFile[] = "heartbeat_destination$i = " . $configValue['heartbeat_destination'][$i] . "\n"; + } + } + $outfp = fopen(_PGPOOL2_CONFIG_FILE, 'w'); foreach ($configFile as $line) { fputs($outfp, $line); @@ -757,3 +514,328 @@ function deleteWdOther($num, &$configValue) unset($configValue['other_wd_port'][$num]); $configValue['other_wd_port'] = array_values($configValue['other_wd_port']); } + +/** + * Delete an heartbeat device + */ +function deleteHeartbeatDevice($num, &$configValue) +{ + if (!isset($configValue['heartbeat_device'])) { return; } + + unset($configValue['heartbeat_device'][$num]); + $configValue['heartbeat_device'] = array_values($configValue['heartbeat_device']); + + unset($configValue['heartbeat_destination'][$num]); + $configValue['heartbeat_destination'] = array_values($configValue['heartbeat_destination']); +} + +/** + * Arrange post data + */ +function arrangePostData() +{ + global $pgpoolConfigParam; + global $_POST; + + $configValue = array(); + foreach ($pgpoolConfigParam as $key => $value) { + if ($pgpoolConfigParam[$key]['type'] == 'B') { + $configValue[$key] = (isset($_POST[$key])) ? 'on' : 'off'; + + } elseif (isset($_POST[$key])) { + $configValue[$key] = trim($_POST[$key]); + } + } + + return $configValue; +} + +/** + * Add action + */ +function doAdd($configValue) +{ + global $_POST; + + // Backend settings + if (isset($_POST['backend_hostname'])) { + $configValue['backend_hostname'] = $_POST['backend_hostname']; + } else { + $configValue['backend_hostname'][0] = NULL; + + } + if (isset($_POST['backend_port'])) { + $configValue['backend_port'] = $_POST['backend_port']; + } else { + $configValue['backend_port'][0] = NULL; + } + + if (isset($_POST['backend_weight'])) { + $configValue['backend_weight'] = $_POST['backend_weight']; + } else { + $configValue['backend_weight'][0] = NULL; + } + + if (isset($_POST['backend_data_directory'])) { + $configValue['backend_data_directory'] = $_POST['backend_data_directory']; + } else { + $configValue['backend_data_directory'][0] = NULL; + } + + if (paramExists('backend_flag')) { + if (isset($_POST['backend_flag'])) { + $configValue['backend_flag'] = $_POST['backend_flag']; + } else { + $configValue['backend_flag'][0] = NULL; + } + } + + // watchdog's device settings + if (isset($_POST['heartbeat_device'])) { + $configValue['heartbeat_device'] = $_POST['heartbeat_device']; + } else { + $configValue['heartbeat_device'][0] = NULL; + } + + if (isset($_POST['heartbeat_destination'])) { + $configValue['heartbeat_destination'] = $_POST['heartbeat_destination']; + } else { + $configValue['heartbeat_destination'][0] = NULL; + } + + // watchdog's other pgpool settings + if (isset($_POST['other_pgpool_hostname'])) { + $configValue['other_pgpool_hostname'] = $_POST['other_pgpool_hostname']; + } else { + $configValue['other_pgpool_hostname'][0] = NULL; + } + + if (isset($_POST['other_pgpool_port'])) { + $configValue['other_pgpool_port'] = $_POST['other_pgpool_port']; + } else { + $configValue['other_pgpool_port'][0] = NULL; + } + + if (isset($_POST['other_wd_port'])) { + $configValue['other_wd_port'] = $_POST['other_wd_port']; + } else { + $configValue['other_wd_port'][0] = NULL; + } + + return $configValue; +} + +/** + * Cancel action + */ +function doCancel($configValue, $action) +{ + global $_POST; + + // Backend settings + if (isset($_POST['backend_hostname'])) { + $configValue['backend_hostname'] = $_POST['backend_hostname']; + } + if (isset($_POST['backend_port'])) { + $configValue['backend_port'] = $_POST['backend_port']; + } + if (isset($_POST['backend_weight'])) { + $configValue['backend_weight'] = $_POST['backend_weight']; + } + if (isset($_POST['backend_data_directory'])) { + $configValue['backend_data_directory'] = $_POST['backend_data_directory']; + } + if (paramExists('backend_flag') && isset($_POST['backend_flag'])) { + $configValue['backend_flag'] = $_POST['backend_flag']; + } + + if ($action == 'cancel') { + array_pop($configValue['backend_hostname']); + array_pop($configValue['backend_port']); + array_pop($configValue['backend_weight']); + array_pop($configValue['backend_data_directory']); + array_pop($configValue['backend_flag']); + } + + // watchdog's device settings + if (isset($_POST['heartbeat_device'])) { + $configValue['heartbeat_device'] = $_POST['heartbeat_device']; + } + if (isset($_POST['heartbeat_destination'])) { + $configValue['heartbeat_destination'] = $_POST['heartbeat_destination']; + } + if ($action == 'cancel_heartbeat_device') { + array_pop($configValue['heartbeat_device']); + array_pop($configValue['heartbeat_destination']); + } + + // watchdog's other pgpool settings + if (isset($_POST['other_pgpool_hostname'])) { + $configValue['other_pgpool_hostname'] = $_POST['other_pgpool_hostname']; + } + if (isset($_POST['other_pgpool_port'])) { + $configValue['other_pgpool_port'] = $_POST['other_pgpool_port']; + } + if (isset($_POST['other_wd_port'])) { + $configValue['other_wd_port'] = $_POST['other_wd_port']; + } + if ($action == 'cancel_wd') { + array_pop($configValue['other_pgpool_hostname']); + array_pop($configValue['other_pgpool_port']); + array_pop($configValue['other_wd_port']); + } + + return $configValue; +} + +/** + * Check all params + */ +function doCheck() +{ + global $pgpoolConfigParam; + global $configValue; + global $pgpoolConfigBackendParam; + global $pgpoolConfigWdOtherParam; + global $_POST; + + $error = array(); + + /* + * Confirmations of value except backend host + */ + foreach ($pgpoolConfigParam as $key => $value) { + check($key, $value, $configValue, $error); + } + + /* + * copy backend value from POST data to $configValue + */ + foreach ($pgpoolConfigBackendParam as $key => $value) { + if (isset($_POST[$key])) { + $configValue[$key] = $_POST[$key]; + } + } + + /* + * check backend value + */ + if (isset($configValue['backend_hostname'])) { + for ($i = 0; $i < count($configValue['backend_hostname']); $i++) { + $result = FALSE; + + // backend_hostname + $result = checkString($configValue['backend_hostname'][$i], + $pgpoolConfigBackendParam['backend_hostname']['regexp']); + if (!$result) { + $error['backend_hostname'][$i] = TRUE; + } + + // backend_port + $result = checkInteger($configValue['backend_port'][$i], + $pgpoolConfigBackendParam['backend_port']['min'], + $pgpoolConfigBackendParam['backend_port']['max']); + if (!$result) { + $error['backend_port'][$i] = TRUE; + } + + // backend_weight + $result = checkFloat($configValue['backend_weight'][$i], + $pgpoolConfigBackendParam['backend_weight']['min'], + $pgpoolConfigBackendParam['backend_weight']['max']); + if (!$result) { + $error['backend_weight'][$i] = TRUE; + } + + // backend_data_directory + $result = checkString($configValue['backend_data_directory'][$i], + $pgpoolConfigBackendParam['backend_data_directory']['regexp']); + if (!$result) { + $error['backend_data_directory'][$i] = TRUE; + } + + // backend_flag + if (paramExists('backend_flag')) { + $result = checkString($configValue['backend_flag'][$i], + $pgpoolConfigBackendParam['backend_flag']['regexp']); + if (!$result) { + $error['backend_flag'][$i] = TRUE; + } + } + } + } + + /* + * check watchdof's device value + */ + if (isset($configValue['heartbeat_device'])) { + for ($i = 0; $i < count($configValue['heartbeat_device']); $i++) { + $result = FALSE; + + // heartbeat_device + $result = checkString($configValue['heartbeat_device'][$i], + $pgpoolConfigWdOtherParam['heartbeat_device']['regexp']); + if (!$result) { + $error['heartbeat_device'][$i] = TRUE; + } + + // heartbeat_destination + $result = checkString($configValue['heartbeat_destination'][$i], + $pgpoolConfigWdOtherParam['heartbeat_destination']['regexp']); + if (!$result) { + $error['heartbeat_destination'][$i] = TRUE; + } + } + } + + /* + * check watchdog's other pgpool value + */ + foreach ($pgpoolConfigWdOtherParam as $key => $value) { + if (isset($_POST[$key])) { + $configValue[$key] = $_POST[$key]; + } + } + if (isset($configValue['other_pgpool_hostname'])) { + for ($i = 0; $i < count($configValue['other_pgpool_hostname']); $i++) { + $result = FALSE; + + // other_pgpool_hostname + $result = checkString($configValue['other_pgpool_hostname'][$i], + $pgpoolConfigWdOtherParam['other_pgpool_hostname']['regexp']); + if (!$result) { + $error['other_pgpool_hostname'][$i] = TRUE; + } + + // other_pgpool_port + $result = checkInteger($configValue['other_pgpool_port'][$i], + $pgpoolConfigWdOtherParam['other_pgpool_port']['min'], + $pgpoolConfigWdOtherParam['other_pgpool_port']['max']); + if (!$result) { + $error['other_pgpool_port'][$i] = TRUE; + } + + // other_wd_port + $result = checkInteger($configValue['other_wd_port'][$i], + $pgpoolConfigWdOtherParam['other_wd_port']['min'], + $pgpoolConfigWdOtherParam['other_wd_port']['max']); + if (!$result) { + $error['other_wd_port'][$i] = TRUE; + } + } + } + + /* + * check logically + */ + $logical_errors = checkLogical($configValue); + if ($logical_errors) { + $isError = TRUE; + $error += $logical_errors; + } + + /** + * return params which has errors + */ + return $error; +} @@ -35,7 +35,10 @@ th, td { padding: 4px 8px; border-bottom: 1px solid lightsteelblue; } -thead th, thead td, tfoot th, tfoot td { +thead th, thead td, +tfoot th, tfoot td, +tr.tr_add_button th, +tr.tr_add_button td { background: ghostwhite; } tbody th { @@ -300,6 +303,12 @@ ul { font-family: monospace; border-bottom: 1px dotted #cccccc; } +.param_group { + background-color: #78A1D3; + padding: 3px 5px; + border-radius: 3px; + color: white; +} /* --------------------------------------------------------------------- */ /* Refresh info */ diff --git a/templates/help/en/pgconfig.tpl b/templates/help/en/pgconfig.tpl index 916ddaf..2449653 100644 --- a/templates/help/en/pgconfig.tpl +++ b/templates/help/en/pgconfig.tpl @@ -44,7 +44,7 @@ </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. +The content of pgpool.conf that is the configuration file of pgpool set can be displayed and be changed. <h3>{$message.strFeature|escape}</h3> Please input the value that wants to change and push the update button. @@ -1604,6 +1604,10 @@ black_function_list = 'nextval,setval,lastval,currval' </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> @@ -1612,6 +1616,7 @@ black_function_list = 'nextval,setval,lastval,currval' </td> </tr> + {* --------------------------------------------------------------------- *} <tr><th class="category" colspan="2">Connection to up stream servers</th></tr> <tr> @@ -1635,58 +1640,39 @@ black_function_list = 'nextval,setval,lastval,currval' </td> </tr> - <tr><th class="category" colspan="2">Lifecheck of pgpol-II</th></tr> - - <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> + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="2">Watchdog communication Settings</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> - - <tr> - <th id="WD_LIFECHECK_DBNAME"><label>{$message.descWd_lifecheck_dbname|escape}</label> - <p>wd_lifecheck_dbnam(string) *</th> + <th id="WD_HOSTNAME"><label>{$message.descWd_hostname|escape}</label> + <p>wd_hostname (string) *</th> <td> - <p>The database name connected for checking pgpool-II. Default is "template1"</p> + <p>Specifies the hostname or IP address for mutual monitoring of watchdog processes. </p> </td> </tr> <tr> - <th id="WD_LIFECHECK_USER"><label>{$message.descWd_lifecheck_user|escape}</label> - <p>wd_lifecheck_user(string) *</th> + <th id="WD_PORT"><label>{$message.descWd_port|escape}</label> + <p>wd_port (integer) *</th> <td> - <p>The user name to check pgpool-II. This user must exist in all the PostgreSQL backends. - Default is "nobody" .</p> + <p>Specifies the port number for mutual monitoring of watchdog processes. </p> </td> </tr> + {if paramExists('wd_authkey')} <tr> - <th id="WD_LIFECHECK_PASSWORD"><label>{$message.descWd_lifecheck_password|escape}</label> - <p>wd_lifecheck_query (string) *</th> + <th id="WD_AUTHKEY"><label>{$message.descWd_authkey|escape}</label> + <p>wd_authkey (string) *</th> <td> - <p>The password of the user to check pgpool-II. Default is "".</p> + <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> @@ -1713,7 +1699,7 @@ black_function_list = 'nextval,setval,lastval,currval' <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 "ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0". + 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> @@ -1723,7 +1709,7 @@ black_function_list = 'nextval,setval,lastval,currval' <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 "ifconfig eth0:0 down". </p> + Set the command and parameters such as "<code>ifconfig eth0:0 down</code>". </p> </td> </tr> @@ -1741,29 +1727,168 @@ black_function_list = 'nextval,setval,lastval,currval' <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 "arping -U $_IP_$ -w 1". + 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> - <tr><th class="category" colspan="2">Server itself to be monitored</th></tr> + {* --------------------------------------------------------------------- *} + {if paramExists('clear_memqcache_on_escalation')} + <tr><th class="category" colspan="2">Behaivor on escalation Setting</th></tr> <tr> - <th id="WD_HOSTNAME"><label>{$message.descWd_hostname|escape}</label> - <p>wd_hostname (string) *</th> + <th id="CLEAR_MEMQCACHE_ON_ESCALATION"><label>{$message.descClear_memqcache_on_escalation|escape}</label> + <p>clear_memqcache_on_escalation (bool) *</th> <td> - <p>Specifies the hostname or IP address for mutual monitoring of watchdog processes. </p> + <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_PORT"><label>{$message.descWd_port|escape}</label> - <p>wd_port (integer) *</th> + <th id="WD_ESCALATION_COMMAND"><label>{$message.descWd_escalation_command|escape}</label> + <p>wd_escalation_command (string) *</th> <td> - <p>Specifies the port number for mutual monitoring of watchdog processes. </p> + <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_DEVICE"><label>{$message.descHeartbeat_device|escape}</label> + <p>heartbeat_device (string) *</th> + <td> + <p>Specifies the network device name for sending heartbeat signals. + You can use multiple devices. + The number at the end of the parameter name is referred as "device number", and it starts from 0. + If you want to set mutiple destination (<a href="#HEARTBEAT_DESTINATION">heartbeat_destiationN</a>) for one device, + specify the device name repeatedly using different numbers.</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 which is sent from the device + specified by <a href="#HEARTBEAT_DEVICE">heartbeat_deviceX</a>. + Use IP address or hostname. The number at the end of the parameter name is referred as "device number", + and it starts from 0. This works only heartbeat mode. </p> + </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> diff --git a/templates/help/ja/pgconfig.tpl b/templates/help/ja/pgconfig.tpl index 28ed2a4..2c21a0c 100644 --- a/templates/help/ja/pgconfig.tpl +++ b/templates/help/ja/pgconfig.tpl @@ -1421,7 +1421,7 @@ black_function_list = 'nextval,setval,lastval,currval' <td> <p> ヘルスチェックのリトライの間の秒数を指定します - (health_check_max_retries > 0でなければ有効になりません)。 + (<a href="HEALTH_CHECK_MAX_RETRIES">health_check_max_retries</a> > 0でなければ有効になりません)。 0を指定すると、待ちなしに直ちにリトライします。 </p> </td> @@ -1680,6 +1680,10 @@ black_function_list = 'nextval,setval,lastval,currval' </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> @@ -1688,6 +1692,7 @@ black_function_list = 'nextval,setval,lastval,currval' </td> </tr> + {* --------------------------------------------------------------------- *} <tr><th class="category" colspan="2">Connection to up stream servers</th></tr> <tr> @@ -1708,56 +1713,39 @@ black_function_list = 'nextval,setval,lastval,currval' </td> </tr> - <tr><th class="category" colspan="2">Lifecheck of pgpol-II</th></tr> + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="2">Watchdog communication Settings</th></tr> <tr> - <th id="WD_INTERVAL"><label>{$message.descWd_interval|escape}</label> - <p>wd_interval (integer) *</th> - <td> - <p>pgpool-II への生存監視の間隔(秒)です。 (1 以上の数値) </p> - </td> - </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> - - <tr> - <th id="WD_LIFECHECK_DBNAME"><label>{$message.descWd_lifecheck_dbname|escape}</label> - <p>wd_lifecheck_dbnam(string) *</th> + <th id="WD_HOSTNAME"><label>{$message.descWd_hostname|escape}</label> + <p>wd_hostname (string) *</th> <td> - <p>pgpool-II の死活監視を行なうのに接続するデータベースです。 デフォルトは "template1" です。</p> + <p>watchdog プロセスが相互監視を受信する為のホスト名または IP アドレスです。 </p> </td> </tr> <tr> - <th id="WD_LIFECHECK_USER"><label>{$message.descWd_lifecheck_user|escape}</label> - <p>wd_lifecheck_user(string) *</th> + <th id="WD_PORT"><label>{$message.descWd_port|escape}</label> + <p>wd_port (integer) *</th> <td> - <p>pgpool-II の死活監視を行なうユーザです。 デフォルトは "nobody" です。</p> + <p>watchdog プロセスが相互監視を受信する為のポート番号です。 </p> </td> </tr> + {if paramExists('wd_authkey')} <tr> - <th id="WD_LIFECHECK_PASSWORD"><label>{$message.descWd_lifecheck_password|escape}</label> - <p>wd_lifecheck_query (string) *</th> + <th id="WD_AUTHKEY"><label>{$message.descWd_authkey|escape}</label> + <p>wd_authkey (string) *</th> <td> - <p>pgpool-II の死活監視を行なうユーザのパスワードです。 </p> + <p>wachdog 間通信で用いられる認証キーです。 全ての pgpool-II で同じキーを指定する必要があります。 + 認証キーが異なる watchdog からの通信は拒絶されます。 + 死活監視をハートビートモードで行う場合には、この認証はハートビート信号にも適用されます。</p> + <p>指定が無い場合には認証は行われず、これがデフォルトです。</p> </td> </tr> + {/if} + {* --------------------------------------------------------------------- *} <tr><th class="category" colspan="2">Virtual IP address</th></tr> <tr> @@ -1782,7 +1770,7 @@ black_function_list = 'nextval,setval,lastval,currval' <p>if_up_cmd (string) *</th> <td> <p>仮想 IP を起動するために実行するコマンドです。 - "ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0" のようにコマンドとパラメータを指定します。 + "<code>ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0</code>" のようにコマンドとパラメータを指定します。 $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。 </p> </td> </tr> @@ -1792,7 +1780,7 @@ black_function_list = 'nextval,setval,lastval,currval' <p>if_down_cmd (string) *</th> <td> <p>仮想IPを停止するために実行するコマンドです。 - "ifconfig eth0:0 down" のようにコマンドとパラメータを指定します。</p> + "<code>ifconfig eth0:0 down</code>" のようにコマンドとパラメータを指定します。</p> </td> </tr> @@ -1809,29 +1797,168 @@ black_function_list = 'nextval,setval,lastval,currval' <th id="ARPING_CMD"><label>{$message.descArping_cmd|escape}</label> <p>arping_cmd (string) *</th> <td> - <p>IPアドレス切り替え後にARPリクエストを送信するコマンドです。 - "arping -U $_IP_$ -w 1" のようにコマンドとパラメータを指定します。 + <p>IPアドレス切り替え後に ARP リクエストを送信するコマンドです。 + "<code>arping -U $_IP_$ -w 1</code>" のようにコマンドとパラメータを指定します。 $_IP_$ は <a href="#DELEGATE_IP">delegate_IP</a> で指定された IP アドレスに置換されます。 </p> </td> </tr> - <tr><th class="category" colspan="2">Server itself to be monitored</th></tr> + {* --------------------------------------------------------------------- *} + {if paramExists('clear_memqcache_on_escalation')} + <tr><th class="category" colspan="2">Behaivor on escalation Setting</th></tr> <tr> - <th id="WD_HOSTNAME"><label>{$message.descWd_hostname|escape}</label> - <p>wd_hostname (string) *</th> + <th id="CLEAR_MEMQCACHE_ON_ESCALATION"><label>{$message.descClear_memqcache_on_escalation|escape}</label> + <p>clear_memqcache_on_escalation (bool) *</th> <td> - <p>watchdog プロセスが相互監視を受信する為のホスト名または IP アドレスです。 </p> + <p>このオプションが on の場合、pgpool-II がアクティブに昇格した時に、 + 共有メモリ上のクエリキャッシュを全て削除します。 + これにより、旧アクティブと非整合な古いクエリキャッシュが使われることを防止します。</p> + <p><a href="MEMQCACHE_METHOD">memqcache_method</a> が 'shmem' の場合のみ有効です。 デフォルトは on です。</p> </td> </tr> <tr> - <th id="WD_PORT"><label>{$message.descWd_port|escape}</label> - <p>wd_port (integer) *</th> + <th id="WD_ESCALATION_COMMAND"><label>{$message.descWd_escalation_command|escape}</label> + <p>wd_escalation_command (string) *</th> <td> - <p>watchdog プロセスが相互監視を受信する為のポート番号です。 </p> + <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_DEVICE"><label>{$message.descHeartbeat_device|escape}</label> + <p>heartbeat_device (string) *</th> + <td> + <p>ハートビートの送受信に用いるネットワークデバイス名を指定します。 複数のデバイスが設定可能です。 + 数値の部分はデバイスの番号です。 デバイス毎に 0 からの連番にします。 + 1つのデバイスに複数のハートビート送信先(<a href="HEARTBEAT_DESTINATION">heartbeat_destiationN</a>)を設定する場合は、 + 重複するデバイス名を異なる番号で指定してください。 </p> + </td> + </tr> + + <tr> + <th id="HEARTBEAT_DESTINATION"><label>{$message.descHeartbeat_destination|escape}</label> + <p>heartbeat_destination (string) *</th> + <td> + <p><a href="#HEARTBEAT_DEVICE">heartbeat_deviceX</a> に指定したデバイスから送るハートビート信号の宛先を、 + ホスト名か IP で指定します。 + 数値の部分はデバイスの番号です。 デバイス毎に 0 からの連番にします。 </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> @@ -1970,10 +2097,10 @@ black_function_list = 'nextval,setval,lastval,currval' memqcache_cache_block_size のブロックに分けて利用します。 検索結果のキャッシュはこのブロックに入るだけ詰め込まれます。 ただし、キャッシュは複数のブロックにまたがって格納されないので、 - memqcache_cache_block_sizeを検索結果が超えると、キャッシュに格納できなくなります。 + memqcache_cache_block_size を検索結果が超えると、キャッシュに格納できなくなります。 </p> <p> - memqcache_cache_block_sizeは、512 以上の値でなければなりません。 + memqcache_cache_block_size は、512 以上の値でなければなりません。 </p> </td> </tr> diff --git a/templates/pgconfig.tpl b/templates/pgconfig.tpl index 0d79bfc..8422b60 100644 --- a/templates/pgconfig.tpl +++ b/templates/pgconfig.tpl @@ -18,33 +18,40 @@ function resetData(){ document.pgconfig.submit(); } -function del(num){ - if(window.confirm(msgDeleteConfirm)){ - document.pgconfig.action.value= "delete"; - document.pgconfig.num.value = num; - document.pgconfig.submit(); - } -} function addNode() { document.pgconfig.action.value= "add"; document.pgconfig.submit(); } - -function cancelNode() { - document.pgconfig.action.value= "cancel"; - document.pgconfig.submit(); -} - function addOtherWatchdog() { document.pgconfig.action.value= "add_wd"; document.pgconfig.submit(); } +function addHeartbeatDevice() { + document.pgconfig.action.value= "add_heartbeat_device"; + document.pgconfig.submit(); +} +function cancelNode() { + document.pgconfig.action.value= "cancel"; + document.pgconfig.submit(); +} function cancelOtherWatchdog() { document.pgconfig.action.value= "cancel_wd"; document.pgconfig.submit(); } +function cancelHeartbeatDevice() { + document.pgconfig.action.value= "cancel_heartbeat_device"; + document.pgconfig.submit(); +} + +function deleteNode(num){ + if(window.confirm(msgDeleteConfirm)){ + document.pgconfig.action.value= "delete"; + document.pgconfig.num.value = num; + document.pgconfig.submit(); + } +} function delOtherWatchdog(num){ if(window.confirm(msgDeleteConfirm)){ document.pgconfig.action.value= "delete_wd"; @@ -52,7 +59,13 @@ function delOtherWatchdog(num){ document.pgconfig.submit(); } } - +function delHeartbeatDevice(num){ + if(window.confirm(msgDeleteConfirm)){ + document.pgconfig.action.value= "delete_heartbeat_device"; + document.pgconfig.num.value = num; + document.pgconfig.submit(); + } +} // --> </script> @@ -363,15 +376,15 @@ function delOtherWatchdog(num){ {if isset($isAdd) && $isAdd == true} <tfoot> <tr> - <td colspan="4"> - <input type="button" name="cancel" value="{$message.strCancel|escape}" onclick="cancelNode()" /></td> + <td colspan="4"> + <input type="button" name="cancel" value="{$message.strCancel|escape}" onclick="cancelNode()" /></td> </tr> </tfoot> {else} <tfoot> <tr> - <td colspan="4"> - <input type="button" name="add" value="{$message.strAdd|escape}" onclick="addNode()" /></td> + <td colspan="4"> + <input type="button" name="add" value="{$message.strAdd|escape}" onclick="addNode()" /></td> </tr> </tfoot> {/if} @@ -379,14 +392,15 @@ function delOtherWatchdog(num){ {foreach from=$params.backend_hostname key=node_num item=v} <tr> - <td rowspan="{if paramExists('backend_flag')}5{else}4{/if}">node {$node_num}</td> + <td rowspan="{if paramExists('backend_flag')}5{else}4{/if}"> + <span class="param_group">node {$node_num}</span></td> <th{if isset($error.backend_hostname.$node_num)} class="error"{/if}> <label>{$message.descBackend_hostname|escape}</label> <br />backend_hostname{$node_num} (string)</th> <td><input type="text" name="backend_hostname[]" value="{$params.backend_hostname.$node_num|escape}" /></td> <td rowspan="{if paramExists('backend_flag')}5{else}4{/if}"> <input type="button" name="delete" value="{$message.strDelete|escape}" - onclick="del({$node_num})" /></td> + onclick="deleteNode({$node_num})" /></td> </tr> <tr> @@ -428,7 +442,8 @@ function delOtherWatchdog(num){ {if isset($isAdd) && $isAdd == true} <tr> - <td rowspan="{if paramExists('backend_flag')}5{else}4{/if}">node [new]</td> + <td rowspan="{if paramExists('backend_flag')}5{else}4{/if}"> + <span class="param_group">node {$node_num + 1}</span></td> <th><label>{$message.descBackend_hostname|escape}</label> <br />backend_hostname{$smarty.section.num.index} (string)</th> <td><input type="text" name="backend_hostname[]" value="" /></td> @@ -1229,141 +1244,269 @@ function delOtherWatchdog(num){ </tr> </thead> <tbody> + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Enabling</th></tr> <tr> - <th{if isset($error.use_watchdog)} class="error"{/if}> + <th{if isset($error.use_watchdog)} class="error"{/if} colspan="2"> <label>{$message.descUse_watchdog|escape}</label> <br />use_watchdog (bool) *</th> <td colspan="2"><input type="checkbox" name="use_watchdog" id="use_watchdog" value="true" {if $params.use_watchdog== 'on'}checked="checked"{/if} /></td> </tr> - <tr><th class="category" colspan="3">Connection to up stream servers</th></tr> + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Connection to up stream servers</th></tr> <tr> - <th{if isset($error.trusted_servers)} class="error"{/if}> + <th{if isset($error.trusted_servers)} class="error"{/if} colspan="2"> <label>{$message.descTrusted_servers|escape}</label> <br />trusted_servers (string) *</th> <td colspan="2"><input type="text" name="trusted_servers" value="{$params.trusted_servers|escape}"/></td> </tr> <tr> - <th{if isset($error.ping_path)} class="error"{/if}> + <th{if isset($error.ping_path)} class="error"{/if} colspan="2"> <label>{$message.descPing_path|escape}</label> <br />ping_path (string) *</th> <td colspan="2"><input type="text" name="ping_path" value="{$params.ping_path|escape}"/></td> </tr> - <tr><th class="category" colspan="3">Lifecheck of pgpol-II</th></tr> - - <tr> - <th{if isset($error.wd_interval)} class="error"{/if}> - <label>{$message.descWd_interval|escape}</label> - <br />wd_interval (integer) *</th> - <td colspan="2"><input type="text" name="wd_interval" value="{$params.wd_interval|escape}"/></td> - </tr> - - <tr> - <th{if isset($error.wd_life_point)} class="error"{/if}> - <label>{$message.descWd_life_point|escape}</label> - <br />wd_life_point(integer) *</th> - <td colspan="2"><input type="text" name="wd_life_point" value="{$params.wd_life_point|escape}"/></td> - </tr> - - <tr> - <th{if isset($error.wd_lifecheck_query)} class="error"{/if}> - <label>{$message.descWd_lifecheck_query|escape}</label> - <br />wd_lifecheck_query (string) *</th> - <td colspan="2"><input type="text" name="wd_lifecheck_query" value="{$params.wd_lifecheck_query|escape}"/></td> - </tr> + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Watchdog communication Settings</th></tr> - {if paramExists('wd_lifecheck_dbname')} <tr> - <th{if isset($error.wd_lifecheck_dbname)} class="error"{/if}> - <label>{$message.descWd_lifecheck_dbname|escape}</label> - <br />wd_lifecheck_dbname (string) *</th> - <td colspan="2"><input type="text" name="wd_lifecheck_dbname" value="{$params.wd_lifecheck_dbname|escape}"/></td> + <th{if isset($error.wd_hostname)} class="error"{/if} colspan="2"> + <label>{$message.descWd_hostname|escape}</label> + <br />wd_hostname (string) *</th> + <td colspan="2"><input type="text" name="wd_hostname" value="{$params.wd_hostname|escape}"/></td> </tr> <tr> - <th{if isset($error.wd_lifecheck_user)} class="error"{/if}> - <label>{$message.descWd_lifecheck_user|escape}</label> - <br />wd_lifecheck_user (string) *</th> - <td colspan="2"><input type="text" name="wd_lifecheck_user" value="{$params.wd_lifecheck_user|escape}"/></td> + <th{if isset($error.wd_port)} class="error"{/if} colspan="2"> + <label>{$message.descWd_port|escape}</label> + <br />wd_port (integer) *</th> + <td colspan="2"><input type="text" name="wd_port" value="{$params.wd_port|escape}"/></td> </tr> <tr> - <th{if isset($error.wd_lifecheck_password)} class="error"{/if}> - <label>{$message.descWd_lifecheck_password|escape}</label> - <br />wd_lifecheck_password (string) *</th> - <td colspan="2"><input type="text" name="wd_lifecheck_password" value="{$params.wd_lifecheck_password|escape}"/></td> + <th{if isset($error.wd_authkey)} class="error"{/if} colspan="2"> + <label>{$message.descWd_authkey|escape}</label> + <br />wd_authkey (string) *</th> + <td colspan="2"><input type="text" name="wd_authkey" value="{$params.wd_authkey|escape}"/></td> </tr> - {/if} - <tr><th class="category" colspan="3">Virtual IP address</th></tr> + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Virtual IP control Setting</th></tr> <tr> - <th{if isset($error.delegate_IP)} class="error"{/if}> + <th{if isset($error.delegate_IP)} class="error"{/if} colspan="2"> <label>{$message.descDelegate_IP|escape}</label> <br />delegate_IP (string) *</th> <td colspan="2"><input type="text" name="delegate_IP" value="{$params.delegate_IP|escape}"/></td> </tr> <tr> - <th{if isset($error.ifconfig_path)} class="error"{/if}> + <th{if isset($error.ifconfig_path)} class="error"{/if} colspan="2"> <label>{$message.descIfconfig_path|escape}</label> <br />ifconfig_path (string) *</th> <td colspan="2"><input type="text" name="ifconfig_path" value="{$params.ifconfig_path|escape}"/></td> </tr> <tr> - <th{if isset($error.if_up_cmd)} class="error"{/if}> + <th{if isset($error.if_up_cmd)} class="error"{/if} colspan="2"> <label>{$message.descIf_up_cmd|escape}</label> <br />if_up_cmd (string) *</th> <td colspan="2"><input type="text" name="if_up_cmd" value="{$params.if_up_cmd|escape}"/></td> </tr> <tr> - <th{if isset($error.if_down_cmd)} class="error"{/if}> + <th{if isset($error.if_down_cmd)} class="error"{/if} colspan="2"> <label>{$message.descIf_down_cmd|escape}</label> <br />if_down_cmd (string) *</th> <td colspan="2"><input type="text" name="if_down_cmd" value="{$params.if_down_cmd|escape}"/></td> </tr> <tr> - <th{if isset($error.arping_path)} class="error"{/if}> + <th{if isset($error.arping_path)} class="error"{/if} colspan="2"> <label>{$message.descArping_path|escape}</label> <br />arping_path (string) *</th> <td colspan="2"><input type="text" name="arping_path" value="{$params.arping_path|escape}"/></td> </tr> <tr> - <th{if isset($error.arping_cmd)} class="error"{/if}> + <th{if isset($error.arping_cmd)} class="error"{/if} colspan="2"> <label>{$message.descArping_cmd|escape}</label> <br />arping_cmd (string) *</th> <td colspan="2"><input type="text" name="arping_cmd" value="{$params.arping_cmd|escape}"/></td> </tr> - <tr><th class="category" colspan="3">Server itself to be monitored</th></tr> + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Behaivor on escalation Setting</th></tr> <tr> - <th{if isset($error.wd_hostname)} class="error"{/if}> - <label>{$message.descWd_hostname|escape}</label> - <br />wd_hostname (string) *</th> - <td colspan="2"><input type="text" name="wd_hostname" value="{$params.wd_hostname|escape}"/></td> + <th{if isset($error.clear_memqcache_on_escalation)} class="error"{/if} colspan="2"> + <label>{$message.descClear_memqcache_on_escalation|escape}</label> + <br />clear_memqcache_on_escalation (bool)</th> + <td><input type="checkbox" name="clear_memqcache_on_escalation" + id="clear_memqcache_on_escalation" value="true" + {if $params.clear_memqcache_on_escalation== 'on'}checked="checked"{/if} /></td> </tr> <tr> - <th{if isset($error.wd_port)} class="error"{/if}> - <label>{$message.descWd_port|escape}</label> - <br />wd_port (integer) *</th> - <td colspan="2"><input type="text" name="wd_port" value="{$params.wd_port|escape}"/></td> + <th{if isset($error.wd_escalation_command)} class="error"{/if} colspan="2"> + <label>{$message.descWd_escalation_command|escape}</label> + <br />wd_escalation_command (string) *</th> + <td colspan="2"><input type="text" name="wd_escalation_command" value="{$params.wd_escalation_command|escape}"/></td> + </tr> + + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Lifecheck Setting (common)</th></tr> + + {if paramExists('heartbeat_device')} + <tr> + <th{if isset($error.wd_lifecheck_method)} class="error"{/if} colspan="2"> + <label>{$message.descWd_lifecheck_method|escape}</label> + <br />wd_lifecheck_method (string) *</th> + <td colspan="2"> + <input type="text" name="wd_lifecheck_method" value="{$params.wd_lifecheck_method|escape}"/></td> + </tr> + {/if} + + <tr> + <th{if isset($error.wd_interval)} class="error"{/if} colspan="2"> + <label>{$message.descWd_interval|escape}</label> + <br />wd_interval (integer) *</th> + <td colspan="2"><input type="text" name="wd_interval" value="{$params.wd_interval|escape}"/></td> </tr> - <tr><th class="category" colspan="3">Servers to monitor</th></tr> + {* --------------------------------------------------------------------- *} + {if paramExists('heartbeat_device')} + <tr><th class="category" colspan="4">Lifecheck Setting (heartbeat mode)</th></tr> + + <tr> + <th{if isset($error.wd_heartbeat_port)} class="error"{/if} colspan="2"> + <label>{$message.descWd_heartbeat_port|escape}</label> + <br />wd_heartbeat_port (integer) *</th> + <td colspan="2"> + <input type="text" name="wd_heartbeat_port" value="{$params.wd_heartbeat_port|escape}"/></td> + </tr> + + <tr> + <th{if isset($error.wd_heartbeat_keepalive)} class="error"{/if} colspan="2"> + <label>{$message.descWd_heartbeat_keepalive|escape}</label> + <br />wd_heartbeat_keepalive (integer) *</th> + <td colspan="2"> + <input type="text" name="wd_heartbeat_keepalive" value="{$params.wd_heartbeat_keepalive|escape}"/></td> + </tr> + + <tr> + <th{if isset($error.wd_heartbeat_deadtime)} class="error"{/if} colspan="2"> + <label>{$message.descWd_heartbeat_deadtime|escape}</label> + <br />wd_heartbeat_deadtime (integer) *</th> + <td colspan="2"> + <input type="text" name="wd_heartbeat_deadtime" value="{$params.wd_heartbeat_deadtime|escape}"/></td> + </tr> + + {if paramExists('heartbeat_device')} + {foreach from=$params.heartbeat_device key=device_num item=v} + <tr> + <th rowspan="2"><span class="param_group">device {$device_num}</span></th> + <th{if isset($error.heartbeat_device[num])} class="error"{/if}> + <label>{$message.descHeartbeat_device|escape}</label> + <br />heartbeat_device{$device_num} (string)</th> + <td><input type="text" name="heartbeat_device[]" + value="{$params.heartbeat_device.$device_num|escape}" /></td> + <td rowspan="2"> + <input type="button" name="delete" value="{$message.strDelete|escape}" + onclick="delHeartbeatDevice({$device_num})" /></td> + </tr> + + <tr> + <th{if isset($error.heartbeat_destination[num])} class="error"{/if}> + <label>{$message.descHeartbeat_destination|escape}</label> + <br />heartbeat_destination{$device_num|escape} (integer)</th> + <td><input type="text" name="heartbeat_destination[]" + value="{$params.heartbeat_destination.$device_num|escape}" /></td> + </tr> + {/foreach} + + {if isset($isAddHeartbeatDevice) && $isAddHeartbeatDevice == true} + <tr> + <th rowspan="2"><span class="param_group">device {$device_num + 1}</span></th> + <th><label>{$message.descHeartbeat_device|escape}</label> + <br />heartbeat_device{$smarty.section.device_num.index} (string)</th> + <td><input type="text" name="heartbeat_destination[]" value="" /></td> + </tr> + + <tr> + <th><label>{$message.descHeartbeat_destination|escape}</label> + <br />heartbeat_destination{$smarty.section.device_num.index|escape} (integer)</th> + <td><input type="text" name="heartbeat_device[]" value="" /></td> + </tr> + + <tr class="tr_add_button"> + <td colspan="4"> + <input type="button" name="cancel" value="{$message.strCancel|escape}" + onclick="cancelHeartbeatDevice()" /></td> + </tr> + {else} + <tr class="tr_add_button"> + <td colspan="4"> + <input type="button" name="add" value="{$message.strAdd|escape}" + onclick="addHeartbeatDevice()" /></td> + </tr> + {/if} + {/if} + {/if} + + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Lifecheck Setting (query mode)</th></tr> + + <tr> + <th{if isset($error.wd_life_point)} class="error"{/if} colspan="2"> + <label>{$message.descWd_life_point|escape}</label> + <br />wd_life_point(integer) *</th> + <td colspan="2"><input type="text" name="wd_life_point" value="{$params.wd_life_point|escape}"/></td> + </tr> + + <tr> + <th{if isset($error.wd_lifecheck_query)} class="error"{/if} colspan="2"> + <label>{$message.descWd_lifecheck_query|escape}</label> + <br />wd_lifecheck_query (string) *</th> + <td colspan="2"> + <input type="text" name="wd_lifecheck_query" value="{$params.wd_lifecheck_query|escape}"/></td> + </tr> + + {if paramExists('wd_lifecheck_dbname')} + <tr> + <th{if isset($error.wd_lifecheck_dbname)} class="error"{/if} colspan="2"> + <label>{$message.descWd_lifecheck_dbname|escape}</label> + <br />wd_lifecheck_dbname (string) *</th> + <td colspan="2"><input type="text" name="wd_lifecheck_dbname" value="{$params.wd_lifecheck_dbname|escape}"/></td> + </tr> + + <tr> + <th{if isset($error.wd_lifecheck_user)} class="error"{/if} colspan="2"> + <label>{$message.descWd_lifecheck_user|escape}</label> + <br />wd_lifecheck_user (string) *</th> + <td colspan="2"><input type="text" name="wd_lifecheck_user" value="{$params.wd_lifecheck_user|escape}"/></td> + </tr> + + <tr> + <th{if isset($error.wd_lifecheck_password)} class="error"{/if} colspan="2"> + <label>{$message.descWd_lifecheck_password|escape}</label> + <br />wd_lifecheck_password (string) *</th> + <td colspan="2"><input type="text" name="wd_lifecheck_password" value="{$params.wd_lifecheck_password|escape}"/></td> + </tr> + {/if} + + {* --------------------------------------------------------------------- *} + <tr><th class="category" colspan="4">Other pgpool Connection Settings</th></tr> {foreach from=$params.other_pgpool_hostname key=host_num item=v} <tr> + <th rowspan="3"><span class="param_group">other {$host_num}</span></th> <th{if isset($error.other_pgpool_hostname[num])} class="error"{/if}> <label>{$message.descOther_pgpool_hostname|escape}</label> <br />other_pgpool_hostname{$host_num} (string)</th> @@ -1391,6 +1534,7 @@ function delOtherWatchdog(num){ {if isset($isAddWd) && $isAddWd == true} <tr> + <th rowspan="3"><span class="param_group">other {$host_num + 1}</span></th> <th><label>{$message.descOther_pgpool_hostname|escape}</label> <br />other_pgpool_hostname{$smarty.section.num.index} (string)</th> <td><input type="text" name="other_pgpool_hostname[]" value="" /></td> @@ -1413,15 +1557,15 @@ function delOtherWatchdog(num){ {if isset($isAddWd) && $isAddWd == true} <tfoot> <tr> - <td colspan="3"> - <input type="button" name="cancel" value="{$message.strCancel|escape}" onclick="cancelOtherWatchdog()" /></td> + <td colspan="4"> + <input type="button" name="cancel" value="{$message.strCancel|escape}" onclick="cancelOtherWatchdog()" /></td> </tr> </tfoot> {else} <tfoot> <tr> - <td colspan="3"> - <input type="button" name="add" value="{$message.strAdd|escape}" onclick="addOtherWatchdog()" /></td> + <td colspan="4"> + <input type="button" name="add" value="{$message.strAdd|escape}" onclick="addOtherWatchdog()" /></td> </tr> </tfoot> {/if} @@ -1607,9 +1751,10 @@ function delOtherWatchdog(num){ {* --------------------------------------------------------------------- * * Form End * * --------------------------------------------------------------------- *} - <p> - <input type="button" name="btnSubmit" value="{$message.strUpdate|escape}" onclick="update()"/> - <input type="button" name="btnReset" value="{$message.strReset|escape}" onclick="resetData()"/> + <hr style="margin: 30px auto"> + <p align="center"> + <input type="button" name="btnSubmit" value=" {$message.strUpdate|escape} " onclick="update()"/> + <input type="button" name="btnReset" value=" {$message.strReset|escape} " onclick="resetData()"/> </p> </form> |