1<!-- doc/src/sgml/config.sgml -->
2
3<sect1 id="runtime-config-health-check">
4 <!--
5 <title>Health Check</title>
6 -->
7 <title>ヘルスチェック</title>
8
9 <para>
10  <!--
11  <productname>Pgpool-II</productname> periodically connects to the configured
12  PostgreSQL backends to detect any error on the servers or networks.
13  This error check procedure is called "health check".
14  If an error is detected, <productname>Pgpool-II</productname> performs failover
15  or degeneration depending on the configurations.
16  -->
17  <productname>Pgpool-II</productname>はサーバやネットワークの障害を検知するために、設定されたバックエンドに定期的に接続を試みます。
18  この障害チェックの手続きを「ヘルスチェック」と言います。
19  障害が検知されると、<productname>Pgpool-II</productname>は設定に基づいてフェイルオーバや縮退運転を試みます。
20  <caution>
21   <para>
22    <!--
23    Health check requires one extra connection to each backend node,
24    so <literal>max_connections</> in the <filename>postgresql.conf</filename>
25    needs to be adjusted accordingly.
26    -->
27    ヘルスチェックは各バックエンドノードへの余分の接続を1つ必要としますので、<filename>postgresql.conf</filename>の<literal>max_connections</>もそれに応じて調整する必要があります。
28   </para>
29  </caution>
30 </para>
31
32 <variablelist>
33
34  <varlistentry id="guc-health-check-timeout" xreflabel="health_check_timeout">
35   <term><varname>health_check_timeout</varname> (<type>integer</type>)
36    <indexterm>
37     <!--
38     <primary><varname>health_check_timeout</varname> configuration parameter</primary>
39     -->
40     <primary><varname>health_check_timeout</varname> 設定パラメータ</primary>
41    </indexterm>
42   </term>
43   <listitem>
44    <para>
45     <!--
46     Specifies the timeout in seconds to give up connecting to the backend
47     <productname>PostgreSQL</> if the TCP connect does not succeed within this time.
48     -->
49     TCP接続が時間内に成功せずにバックエンドの<productname>PostgreSQL</>への接続を諦めるまでのタイムアウト値を秒単位で指定します。
50    </para>
51    <para>
52     <!--
53     This parameter serves to prevent the health check from waiting for a
54     long time when the network cable is unplugged, for example.
55     Default value is 20. Setting it to 0, disables the timeout (waits until TCP/IP timeout).
56     -->
57     このパラメータは、ネットワークケーブルが抜けた際などにヘルスチェックが長時間待たされるのを防止します。
58     デフォルトは20秒です。0を指定するとタイムアウト処理をしません (TCP/IP のタイムアウトまで待ちます)。
59    </para>
60    <para>
61     <!--
62     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
63     -->
64     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
65    </para>
66   </listitem>
67  </varlistentry>
68
69  <varlistentry id="guc-health-check-period" xreflabel="health_check_period">
70   <term><varname>health_check_period</varname> (<type>integer</type>)
71    <indexterm>
72     <!--
73     <primary><varname>health_check_period</varname> configuration parameter</primary>
74     -->
75     <primary><varname>health_check_period</varname> 設定パラメータ</primary>
76    </indexterm>
77   </term>
78   <listitem>
79    <para>
80     <!--
81     Specifies the interval between the health checks in seconds.
82     Default is 0, which means health check is disabled.
83     -->
84     ヘルスチェックの間隔を秒単位で指定します。
85     デフォルトは0で、これはヘルスチェックが無効であることを意味します。
86    </para>
87    <para>
88     <!--
89     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
90     -->
91     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
92    </para>
93   </listitem>
94  </varlistentry>
95
96  <varlistentry id="guc-health-check-user" xreflabel="health_check_user">
97   <term><varname>health_check_user</varname> (<type>string</type>)
98    <indexterm>
99     <!--
100     <primary><varname>health_check_user</varname> configuration parameter</primary>
101     -->
102     <primary><varname>health_check_user</varname> 設定パラメータ</primary>
103    </indexterm>
104   </term>
105   <listitem>
106    <para>
107     <!--
108     Specifies the <productname>PostgreSQL</> user name to perform health check.
109     The same user must exist in all the <productname>PostgreSQL</> backends.
110     Otherwise, health check results in an error.
111     -->
112     ヘルスチェックを行う<productname>PostgreSQL</>ユーザ名を指定します。
113     同じユーザ名が全ての<productname>PostgreSQL</>バックエンドに存在していなければなりません。
114     さもないと、ヘルスチェックがエラーとなります。
115    </para>
116    <para>
117     <!--
118     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
119     -->
120     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
121    </para>
122   </listitem>
123  </varlistentry>
124
125  <varlistentry id="guc-health-check-password" xreflabel="health_check_password">
126   <term><varname>health_check_password</varname> (<type>string</type>)
127    <indexterm>
128     <!--
129     <primary><varname>health_check_password</varname> configuration parameter</primary>
130     -->
131     <primary><varname>health_check_password</varname> 設定パラメータ</primary>
132    </indexterm>
133   </term>
134   <listitem>
135    <para>
136     <!--
137     Specifies the password for the <productname>PostgreSQL</> user name configured in
138     <xref linkend="guc-health-check-user"> to perform health check.
139     The user and password must be same in all the <productname>PostgreSQL</> backends.
140     Otherwise, health check results in an error.
141     -->
142     <xref linkend="guc-health-check-user">で設定したヘルスチェックを行う<productname>PostgreSQL</>ユーザ名のパスワードを指定します。
143      ユーザとパスワードは全ての<productname>PostgreSQL</>バックエンドで同じである必要があります。
144      さもないと、ヘルスチェックがエラーとなります。
145    </para>
146    <para>
147     <!--
148     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
149     -->
150     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
151    </para>
152   </listitem>
153  </varlistentry>
154
155  <varlistentry id="guc-health-check-database" xreflabel="health_check_database">
156   <term><varname>health_check_database</varname> (<type>string</type>)
157    <indexterm>
158     <!--
159     <primary><varname>health_check_database</varname> configuration parameter</primary>
160     -->
161     <primary><varname>health_check_database</varname> 設定パラメータ</primary>
162    </indexterm>
163   </term>
164   <listitem>
165    <para>
166     <!--
167     Specifies the <productname>PostgreSQL</> database name to perform health check.
168     The default is <literal>''</literal>(empty), in which <literal>"postgres"</literal>
169     database is checked first, then <literal>"template1"</literal> database is tried.
170     This is the same behavior as <productname>Pgpool-II</> <emphasis>V3.4</> or before.
171     -->
172     ヘルスチェックを行う対象の<productname>PostgreSQL</>データベース名を指定します。
173     デフォルトは<literal>''</literal>で、この場合は最初に<literal>postgres</literal>データベースが試され、その後で<literal>template1</literal>データベースが試されます。
174     これは<productname>Pgpool-II</> <emphasis>V3.4</>以前の挙動と同じです。
175    </para>
176    <para>
177     <!--
178     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
179     -->
180     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
181    </para>
182   </listitem>
183  </varlistentry>
184
185  <varlistentry id="guc-health-check-max-retries" xreflabel="health_check_max_retries">
186   <term><varname>health_check_max_retries</varname> (<type>integer</type>)
187    <indexterm>
188     <!--
189     <primary><varname>health_check_max_retries</varname> configuration parameter</primary>
190     -->
191     <primary><varname>health_check_max_retries</varname> 設定パラメータ</primary>
192    </indexterm>
193   </term>
194   <listitem>
195    <para>
196     <!--
197     Specifies the maximum number of retries to do before giving up and
198     initiating failover when health check fails.
199     -->
200     ヘルスチェックに失敗したときに、諦めてフェイルオーバを始める前にリトライする最大回数を指定します。
201     <tip>
202      <para>
203       <!--
204       This setting can be useful in spotty networks, when it is expected that
205       health checks will fail occasionally even when the master node is fine.
206       -->
207       この設定は動作にむらのあるネットワーク環境において、マスターノードが正常であるにも関わらず、たまにヘルスチェックが失敗することが予想される場合に有用です。
208      </para>
209     </tip>
210     <tip>
211      <para>
212       <!--
213       It is advised that <xref linkend="guc-fail-over-on-backend-error"> must be disabled,
214       if you want to enable <varname>health_check_max_retries</>.
215       -->
216       <varname>health_check_max_retreis</>を有効にする場合は、<xref linkend="guc-fail-over-on-backend-error">を無効にするのが望ましいです。
217      </para>
218     </tip>
219     <!--
220     Default is 0, which means do not retry.
221     -->
222     デフォルト値は0で、この場合はリトライをしません。
223    </para>
224    <para>
225     <!--
226     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
227     -->
228     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
229    </para>
230   </listitem>
231  </varlistentry>
232
233  <varlistentry id="guc-health-check-retry-delay" xreflabel="health_check_retry_delay">
234   <term><varname>health_check_retry_delay</varname> (<type>integer</type>)
235    <indexterm>
236     <!--
237     <primary><varname>health_check_retry_delay</varname> configuration parameter</primary>
238     -->
239     <primary><varname>health_check_retry_delay</varname> 設定パラメータ</primary>
240    </indexterm>
241   </term>
242   <listitem>
243    <para>
244     <!--
245     Specifies the amount of time in seconds to sleep between
246     health check retries (not used unless <xref linkend="guc-health-check-max-retries"> is > 0).
247     If 0, then retries are immediate without delay.
248     -->
249     ヘルスチェックのリトライ間の時間間隔を秒単位で指定します(<xref linkend="guc-health-check-max-retries"> > 0でなければ有効になりません)。
250      0を指定すると、待ち時間はなくリトライは直ちに行われます。
251    </para>
252    <para>
253     <!--
254     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
255     -->
256     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
257    </para>
258   </listitem>
259  </varlistentry>
260
261  <varlistentry id="guc-connect-timeout" xreflabel="connect_timeout">
262   <term><varname>connect_timeout</varname> (<type>integer</type>)
263    <indexterm>
264     <!--
265     <primary><varname>connect_timeout</varname> configuration parameter</primary>
266     -->
267     <primary><varname>connect_timeout</varname> 設定パラメータ</primary>
268    </indexterm>
269   </term>
270   <listitem>
271    <para>
272     <!--
273     Specifies the amount of time in milliseconds before giving up connecting
274     to backend using <function>connect()</> system call.
275     Default is 10000 ms (10 second). The flaky network user may want to increase the value.
276     0 means no timeout.
277     -->
278     <function>connect()</>システムコールを使ったバックエンドへの接続を諦めるまでの時間をミリ秒単位で指定します。
279     デフォルトは10000ミリ秒(10秒)です。
280     不安定なネットワークを使う場合、この値を大きくすると良いでしょう。
281     0を指定すると、タイムアウトしません。
282     <note>
283      <para>
284       <!--
285       <varname>connect_timeout</varname> value is not only used for a health check,
286       but also for creating ordinary connection pools.
287       -->
288       <varname>connect_timeout</varname>の値はヘルスチェックだけではなく通常の接続プールを生成するときにも使われます。
289      </para>
290     </note>
291    </para>
292    <para>
293     <!--
294     This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
295     -->
296     このパラメータは<productname>Pgpool-II</>の設定を再読み込みすることで変更可能です。
297    </para>
298   </listitem>
299  </varlistentry>
300
301 </variablelist>
302</sect1>
303