1<!-- doc/src/sgml/start.sgml -->
2
3<chapter id="tutorial-start">
4 <!--
5 <title>Getting Started</title>
6 -->
7 <title>さあ始めましょう</title>
8
9 <sect1 id="tutorial-install">
10  <!--
11  <title>Installation</title>
12  -->
13  <title>インストール</title>
14
15  <para>
16   <!--
17   In this section we assume that you have already
18   installed <productname>Pgpool-II</productname> following an
19   instruction described in <xref linkend="admin">.
20   Alternatively you can use <xref linkend="PGPOOL-SETUP"> to
21   create a temporary installation
22   of <productname>Pgpool-II</productname>
23   and <productname>PostgreSQL</productname>.
24   -->
25   この節では、<xref linkend="admin">の説明に基づいて、すでに<productname>Pgpool-II</productname>をインストール済みであると見なしています。
26    他の方法としては、<xref linkend="PGPOOL-SETUP">を使って<productname>Pgpool-II</productname>と<productname>PostgreSQL</productname>を一時的にインストールすることもできます。
27  </para>
28 </sect1>
29
30 <sect1 id="tutorial-replication">
31  <!--
32  <title>Your First Replication</title>
33  -->
34  <title>はじめてのレプリケーション</title>
35
36  <para>
37   <!--
38   In this section we are going to explain how to manage a
39   <productname>PostgreSQL</productname> cluster with streaming
40   replication using <productname>Pgpool-II</productname>, which is
41   one of most common setup.
42   -->
43   この節では、<productname>Pgpool-II</productname>を使って、もっとも一般的な設定の一つである、<productname>PostgreSQL</productname>クラスターをストリーミングレプリケーション構成で管理する方法を説明します。
44  </para>
45
46  <para>
47   <!--
48   Before going further, you should properly set
49   up <filename>pgpool.conf</filename> with streaming replication
50   mode. For this at least
51   following two directives must be set:
52   -->
53   先に進む前に、ストリーミングレプリケーションモードで<filename>pgpool.conf</filename>を設定しましょう。
54   このためには、少なくとも次の2つの項目を設定しなければなりません。
55   <programlisting>
56    master_slave_mode = on
57    master_slave_sub_mode = 'stream'
58   </programlisting>
59  </para>
60  <para>
61   <!--
62   If you plan to use <command>pgpool_setup</command>, type:
63   -->
64   <command>pgpool_setup</command>を使うということであれば、次のようにタイプして下さい。
65   <programlisting>
66    pgpool_setup
67   </programlisting>
68   <!--
69   This will create
70   a <productname>Pgpool-II</productname> with streaming
71   replication mode installation,
72   primary <productname>PostgreSQL</productname> installation, and
73   a async standby <productname>PostgreSQL</productname>
74   installation.
75   -->
76   これにより、ストリーミングレプリケーション設定の<productname>Pgpool-II</productname>、<productname>PostgreSQL</productname>プライマリサーバのインストール、それに<productname>PostgreSQL</productname>の非同期スタンバイのインストールが行われます。
77  </para>
78  <para>
79   <!--
80   From now on, we assume that you
81   use <command>pgpool_setup</command> to create the installation
82   under current directory. Please note that the current directory
83   must be empty before executing <command>pgpool_setup</command>.
84   -->
85   ここからは、<command>pgpool_setup</command>を使ってカレントディレクトリ以下にインストールを行うことを前提とします。
86  </para>
87  <para>
88   <!--
89   To start the whole system, type:
90   -->
91   システム全体を起動するには、次のようにタイプして下さい。
92   <programlisting>
93    ./startall
94   </programlisting>
95  </para>
96  <para>
97   <!--
98   Once the system starts, you can check the cluster status by
99   issuing a pseudo SQL command called "show pool_node" to any of
100   databases. <command>pgpool_setup</command> automatically creates
101   "test" database. We use the database. Note that the port number
102   is 11000, which is the default port number assigned
103   to <productname>Pgpool-II</productname>
104   by <command>pgpool_setup</command>.
105   -->
106   システムが起動すれば、任意のデータベースに擬似SQLコマンドの"show pool_node"を発行して、クラスタの状態を確認することができます。
107   <command>pgpool_setup</command>は、自動的に"test"データベースを作ります。
108   このデータベースを使います。
109   <command>pgpool_setup</command>により、<productname>Pgpool-II</productname>にデフォルトポート番号として11000がアサインされていることに注意してください。
110   <programlisting>
111    $ psql -p 11000 -c "show pool_nodes" test
112    node_id | hostname | port  | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay
113    ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
114    0       | /tmp     | 11002 | up     | 0.500000  | primary | 0          | false             | 0
115    1       | /tmp     | 11003 | up     | 0.500000  | standby | 0          | true              | 0
116    (2 rows)
117   </programlisting>
118   <!--
119   The result shows that the "status" column is "up", which means
120   the
121   <productname>PostgreSQL</productname> is up and running, which
122   is good.
123   -->
124   この結果は、"status"カラムが"up"であることを示しています。
125   これは、<productname>PostgreSQL</productname>が稼働中で、問題ないということです。
126  </para>
127 </sect1>
128
129 <sect1 id="tutorial-testing-load-balance">
130  <!--
131  <title>Testing Load Balance</title>
132  -->
133  <title>負荷分散を試してみる</title>
134  <para>
135   <!--
136   <productname>Pgpool-II</productname> allows read query load
137   balancing. It is enabled by default. To see the effect, let's
138   use <command>pgbench -S</command> command.
139   -->
140   <productname>Pgpool-II</productname>では、読み込みクエリの負荷分散が可能です。
141   デフォルトでこの機能は有効です。
142   その効果を確かめるために、<command>pgbench -S</command>コマンドを使ってみましょう。
143   <programlisting>
144    $ pgbench -p 11000 -c 10 -S -T 10 test
145    starting vacuum...end.
146    transaction type: &lt;builtin: select only>
147    scaling factor: 1
148    query mode: simple
149    number of clients: 10
150    number of threads: 1
151    duration: 10 s
152    number of transactions actually processed: 148044
153    latency average = 0.676 ms
154    tps = 14802.897506 (including connections establishing)
155    tps = 14810.213749 (excluding connections establishing)
156
157    $ psql -p 11000 -c "show pool_nodes" test
158    node_id | hostname | port  | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay
159    ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
160    0       | /tmp     | 11002 | up     | 0.500000  | primary | 75152      | true              | 0
161    1       | /tmp     | 11003 | up     | 0.500000  | standby | 72893      | false             | 0
162    (2 rows)
163   </programlisting>
164   <!--
165   "select_cnt" column shows how many SELECT are dispatched to each
166   node. Since with the default
167   configuration, <productname>Pgpool-II</productname> tries to
168   dispatch equal number of SELECT, the column shows almost same
169   numbers.
170   -->
171   "select_cnt"カラムは、いくつSELECTが各々のノードに送られたかを示します。
172   設定がデフォルトで、<productname>Pgpool-II</productname>は同じ数のSELECTを送ろうとするので、そのカラムはほぼ同じ値を示しています。
173  </para>
174  <para>
175   <!--
176   <productname>Pgpool-II</productname> offers more sophisticated
177   strategy for load
178   balancing. See <xref linkend="runtime-config-load-balancing">
179   for more details.
180   -->
181   <productname>Pgpool-II</productname>では、負荷分散の更に洗練された戦略の利用が可能です。
182   詳細は<xref linkend="runtime-config-load-balancing">をご覧ください。
183  </para>
184 </sect1>
185
186 <sect1 id="tutorial-testing-replication">
187  <!--
188  <title>Testing Replication</title>
189  -->
190  <title>レプリケーションを試してみる</title>
191
192  <para>
193   <!--
194   Let's test the replication functionality using a benchmark
195   tool <command>pgbench</command>, which comes with the
196   standard <productname>PostgreSQL</productname> installation.
197   Type following to create the benchmark tables.
198   -->
199   <productname>PostgreSQL</productname>に同梱されているベンチマークツールの<command>pgbench</command>を使って、レプリケーション機能を試してみましょう。
200   <programlisting>
201    $ pgbench -i -p 11000 test
202   </programlisting>
203   <!--
204   To see if the replication works correctly, directly connect to
205   the primary and the standby server to see if they return
206   identical results.
207   -->
208   レプリケーションが正しく動いているかどうか確かめるために、直接プライマリとスタンバイサーバに接続して、両方が同じ結果を返すかどうか見てみます。
209   <programlisting>
210    $ psql -p 11002 test
211    \dt
212    List of relations
213    Schema |       Name       | Type  |  Owner
214    --------+------------------+-------+---------
215    public | pgbench_accounts | table | t-ishii
216    public | pgbench_branches | table | t-ishii
217    public | pgbench_history  | table | t-ishii
218    public | pgbench_tellers  | table | t-ishii
219    (4 rows)
220    \q
221    $ psql -p 11003 test
222    \dt
223    List of relations
224    Schema |       Name       | Type  |  Owner
225    --------+------------------+-------+---------
226    public | pgbench_accounts | table | t-ishii
227    public | pgbench_branches | table | t-ishii
228    public | pgbench_history  | table | t-ishii
229    public | pgbench_tellers  | table | t-ishii
230    (4 rows)
231   </programlisting>
232   <!--
233   The primary server (port 11002) and the standby server (port
234   11003) return identical results. Next, let's run pgbench for a
235   while and check to results.
236   -->
237   プライマリサーバ(ポート11002)とスタンバイサーバ(ポート11003)は、同一の結果を返しています。
238   次に、pgbenchをしばらく走らせて、結果を見てみます。
239   <programlisting>
240    $ pgbench -p 11000 -T 10 test
241    starting vacuum...end.
242    transaction type: &lt;builtin: TPC-B (sort of)&gt;
243    scaling factor: 1
244    query mode: simple
245    number of clients: 1
246    number of threads: 1
247    duration: 10 s
248    number of transactions actually processed: 2171
249    latency average = 4.692 ms
250    tps = 213.147520 (including connections establishing)
251    tps = 213.258008 (excluding connections establishing)
252
253    $ psql -p 11002 -c "SELECT sum(abalance) FROM pgbench_accounts" test
254    sum
255    --------
256    192112
257    (1 row)
258
259    $ psql -p 11003 -c "SELECT sum(abalance) FROM pgbench_accounts" test
260    sum
261    --------
262    192112
263    (1 row)
264   </programlisting>
265   <!--
266   Again, the results are identical.
267   -->
268   ここでも結果は同じでした。
269  </para>
270 </sect1>
271
272 <sect1 id="tutorial-testing-failover">
273  <!--
274  <title>Testing Fail Over</title>
275  -->
276  <title>フェイルオーバを試してみる</title>
277
278  <para>
279   <!--
280   <productname>Pgpool-II</productname> allows an automatic fail
281   over when <productname>PostgreSQL</productname> server goes
282   down. In this case <productname>Pgpool-II</productname> sets the
283   status of the server to "down" and continue the database
284   operation using remaining servers.
285   -->
286   <productname>PostgreSQL</productname>サーバが停止した際に、<productname>Pgpool-II</productname>は自動フェイルオーバさせることができます。
287   この場合、<productname>Pgpool-II</productname>はステータスを"down"にして、残ったサーバでデータベースの運用を継続します。
288   <programlisting>
289    $ pg_ctl -D data1 stop
290    waiting for server to shut down.... done
291    server stopped
292    $ psql -p 11000 -c "show pool_nodes" test
293    node_id | hostname | port  | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay
294    ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
295    0       | /tmp     | 11002 | up     | 0.500000  | primary | 2172       | true              | 0
296    1       | /tmp     | 11003 | down   | 0.500000  | standby | 0          | false             | 0
297    (2 rows)
298
299    $ psql -p 11000 -c "SELECT sum(abalance) FROM pgbench_accounts" test
300    sum
301    --------
302    192112
303    (1 row)
304   </programlisting>
305   <!--
306   The standby node was shut down by pg_ctl
307   command. <productname>Pgpool-II</productname> detects it and
308   detaches the standby node. "show pool_nodes" command shows that
309   the standby node is in down status. You can continue to use the
310   cluster without the standby node:
311   -->
312   スタンバイノードをpg_ctlコマンドで停止しました。
313   <productname>Pgpool-II</productname>はそのことを検出し、そのスタンバイノードを切り離します。
314   "show pool_nodes"コマンドは、スタンバイノードがダウンしていることを表示します。
315   このスタンバイノードなしで、クラスタの運用を継続できます。
316   <programlisting>
317    $ psql -p 11000 -c "SELECT sum(abalance) FROM pgbench_accounts" test
318    sum
319    --------
320    192112
321    (1 row)
322   </programlisting>
323   <!--
324   What happens if the primary server goes down? In this case, one
325   of remaining standby server is promoted to new primary
326   server. For this testing, we start from the state in which both
327   nodes are up.
328   -->
329   プライマリサーバが落ちたらどうなるでしょう?
330   この場合、残ったスタンバイサーバの一つが新しいプライマリサーバへと昇格します。
331   テストのため、両方のノードが稼働中である状態から始めます。
332   <programlisting>
333    $ psql -p 11000 -c "show pool_nodes" test
334    node_id | hostname | port  | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay
335    ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
336    0       | /tmp     | 11002 | up     | 0.500000  | primary | 2173       | true              | 0
337    1       | /tmp     | 11003 | up     | 0.500000  | standby | 0          | false             | 0
338    (2 rows)
339
340    $ pg_ctl -D data0 stop
341    waiting for server to shut down.... done
342    server stopped
343    $ psql -p 11000 -c "show pool_nodes" test
344    node_id | hostname | port  | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay
345    ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
346    0       | /tmp     | 11002 | down   | 0.500000  | standby | 2173       | false             | 0
347    1       | /tmp     | 11003 | up     | 0.500000  | primary | 0          | true              | 0
348    (2 rows)
349   </programlisting>
350   <!--
351   Now the primary node is changed from 0 to 1. What happens
352   inside? When the node 0 goes
353   down, <productname>Pgpool-II</productname> detects it and
354   executes "fail_over_script" defined
355   in <filename>pgpool.conf</filename>.  Here is the content of the
356   file.
357   -->
358   プライマリノードが0から1へと変わりました。
359   内部では何が起きたのでしょう?
360   ノード0がダウンした時、<productname>Pgpool-II</productname>はそのことを検出し、<filename>pgpool.conf</filename>に定義された"fail_over_script"を実行します。
361   その内容を以下に示します。
362   <programlisting>
363    #! /bin/sh
364    # Execute command by failover.
365    # special values:  %d = node id
366    #                  %h = host name
367    #                  %p = port number
368    #                  %D = database cluster path
369    #                  %m = new master node id
370    #                  %M = old master node id
371    #                  %H = new master node host name
372    #                  %P = old primary node id
373    #                  %R = new master database cluster path
374    #                  %r = new master port number
375    #                  %% = '%' character
376    failed_node_id=$1
377    failed_host_name=$2
378    failed_port=$3
379    failed_db_cluster=$4
380    new_master_id=$5
381    old_master_id=$6
382    new_master_host_name=$7
383    old_primary_node_id=$8
384    new_master_port_number=$9
385    new_master_db_cluster=${10}
386    mydir=/home/t-ishii/tmp/Tutorial
387    log=$mydir/log/failover.log
388    pg_ctl=/usr/local/pgsql/bin/pg_ctl
389    cluster0=$mydir/data0
390    cluster1=$mydir/data1
391
392    date >> $log
393    echo "failed_node_id $failed_node_id failed_host_name $failed_host_name failed_port $failed_port failed_db_cluster $failed_db_cluster new_master_id $new_master_id old_master_id $old_master_id new_master_host_name $new_master_host_name old_primary_node_id $old_primary_node_id new_master_port_number $new_master_port_number new_master_db_cluster $new_master_db_cluster" >> $log
394
395    if [ a"$failed_node_id" = a"$old_primary_node_id" ];then	# master failed
396    ! 	new_primary_db_cluster=${mydir}/data"$new_master_id"
397    echo $pg_ctl -D $new_primary_db_cluster promote >>$log	# let standby take over
398    $pg_ctl -D $new_primary_db_cluster promote >>$log	# let standby take over
399    fi
400   </programlisting>
401   <!--
402   The script receives necessary information as parameters
403   from <productname>Pgpool-II</productname>. If the primary server
404   goes down, it executes "pg_ctl -D data1 promote", which should
405   promote the standby server to a new primary server.
406   -->
407   そのスクリプトは、パラメータとして必要な情報を<productname>Pgpool-II</productname>から受け取ります。
408   プライマリサーバが落ちた時に、"pg_ctl -D data1 promote"を実行し、スタンバイサーバは新しいプライマリサーバへと昇格します。
409  </para>
410 </sect1>
411
412 <sect1 id="tutorial-testing-online-recovery">
413  <!--
414  <title>Testing Online Recovery</title>
415  -->
416  <title>オンラインリカバリを試してみる</title>
417  <para>
418   <!--
419   <productname>Pgpool-II</productname> allows to recover a downed
420   node by technique called "Online Recovery". This copies data
421   from the primary node to a standby node so that it sync with the
422   primary. This may take long time and database may be updated
423   during the process. That's no problem because in the streaming
424   configuration, the standby will receive WAL log and applies it
425   to catch up the primary. To test online recovery, let's start
426   with previous cluster, where node 0 is in down state.
427   -->
428   <productname>Pgpool-II</productname>は、「オンラインリカバリ」という技術を使ってダウンしたノードを復旧させることができます。
429   これはプライマリノードからデータをスタンバイノードへとコピーし、プライマリと同期させます。
430   それには長い時間がかかることがあり、その間にデータが更新されるかもしれません。
431   これは問題になりません。なぜなら、ストリーミングレプリケーション構成では、スタンバイはWALログを受け取り、それを適用することによってプライマリに追い付くことができるからです。
432   オンラインリカバリをテストするために、ノード0が落ちている先ほどのクラスタから始めましょう。
433   <programlisting>
434    $ pcp_recovery_node -p 11001 0
435    Password:
436    pcp_recovery_node -- Command Successful
437
438    $ psql -p 11000 -c "show pool_nodes" test
439    node_id | hostname | port  | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay
440    ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
441    0       | /tmp     | 11002 | up     | 0.500000  | standby | 2173       | true              | 0
442    1       | /tmp     | 11003 | up     | 0.500000  | primary | 0          | false             | 0
443    (2 rows)
444   </programlisting>
445   <!--
446   <xref linkend="pcp-recovery-node"> is one of control commands
447   coming with <productname>Pgpool-II</productname>
448   installation. The argument -p is to specify the port number
449   assigned to the command, which is 11001 set
450   by <command>pgpool_setup</command>. The second argument is the
451   target node id. After executing the command, node 0 returned to
452   "up" status.
453   -->
454   <xref linkend="pcp-recovery-node">は、インストールされた<productname>Pgpool-II</productname>に含まれる管理コマンドの一つです。
455    引数の-pは、コマンドにアサインされたポート番号です。
456    <command>pgpool_setup</command>は11001に設定しています。
457    次の引数はターゲットになるノードIDです。
458    コマンドを実行すると、ノード0は"up"状態に復帰します。
459  </para>
460  <para>
461   <!--
462   The script executed by <command>pcp_recovery_node</command> is
463   specified as "recovery_1st_stage_command"
464   in <filename>pgpool.conf</filename>. Here is the file installed
465   by <command>pgpool_setup</command>.
466   -->
467   <command>pcp_recovery_node</command>が実行するスクリプトは、<filename>pgpool.conf</filename>で"recovery_1st_stage_command"として指定されています。
468   <command>pgpool_setup</command>がインストールするファイルはこれです。
469   <programlisting>
470    #! /bin/sh
471    psql=/usr/local/pgsql/bin/psql
472    DATADIR_BASE=/home/t-ishii/tmp/Tutorial
473    PGSUPERUSER=t-ishii
474
475    master_db_cluster=$1
476    recovery_node_host_name=$2
477    DEST_CLUSTER=$3
478    PORT=$4
479
480    log=$DATADIR_BASE/log/recovery.log
481
482    $psql -p $PORT -c "SELECT pg_start_backup('Streaming Replication', true)" postgres
483
484    echo "source: $master_db_cluster dest: $DEST_CLUSTER" > $log
485
486    rsync -C -a -c --delete --exclude postgresql.conf --exclude postmaster.pid \
487    --exclude postmaster.opts --exclude pg_log \
488    --exclude recovery.conf --exclude recovery.done \
489    --exclude pg_xlog \
490    $master_db_cluster/ $DEST_CLUSTER/
491
492    rm -fr $DEST_CLUSTER/pg_xlog
493    mkdir $DEST_CLUSTER/pg_xlog
494    chmod 700 $DEST_CLUSTER/pg_xlog
495    rm $DEST_CLUSTER/recovery.done
496    cat > $DEST_CLUSTER/recovery.conf &lt;&lt;REOF
497    standby_mode          = 'on'
498    primary_conninfo      = 'port=$PORT user=$PGSUPERUSER'
499    recovery_target_timeline='latest'
500    REOF
501
502    $psql -p $PORT -c "SELECT pg_stop_backup()" postgres
503   </programlisting>
504  </para>
505 </sect1>
506
507 <sect1 id="tutorial-arch">
508  <!--
509  <title>Architectural Fundamentals</title>
510  -->
511  <title>基礎的な構造</title>
512
513  <para>
514   <!--
515   <productname>Pgpool-II</productname> is a proxy server sitting
516   between clients and <productname>PostgreSQL</productname>.
517   <productname>Pgpool-II</productname> understands the wire level
518   protocol used by <productname>PostgreSQL</productname> called
519   "frontend and backend protocol". For more details of the
520   protocol, see the <productname>PostgreSQL</productname> manual.
521   No modified <productname>PostgreSQL</productname> is required to
522   use <productname>Pgpool-II</productname> (more precisely, you
523   will need a few extensions to use full functions
524   of <productname>Pgpool-II</productname>). So <productname>Pgpool-II</productname>
525   can cope with variety of <productname>PostgreSQL</productname>
526   versions. In theory, even the earliest version
527   of <productname>PostgreSQL</productname> can be used
528   with <productname>Pgpool-II</productname>. Same thing can be
529   said to client side. As long as it follows the
530   protocol, <productname>Pgpool-II</productname> happily accept
531   connections from it, no matter what kind of languages or drivers
532   it uses.
533   -->
534   <productname>Pgpool-II</productname>は、クライアントと<productname>PostgreSQL</productname>の間に位置するproxyサーバです。
535   <productname>Pgpool-II</productname>は、"frontend and backend protocol"と呼ばれるネットワーク上のプロトコルを理解します。
536   プロトコルの詳細については、<productname>PostgreSQL</productname>のマニュアルをご覧ください。
537   <productname>Pgpool-II</productname>を利用するにあたって、<productname>PostgreSQL</productname>を変更する必要はありません。
538   (正確には、<productname>Pgpool-II</productname>のすべての機能を使うためには、少数の拡張をインストールする必要があります)
539   したがって、<productname>Pgpool-II</productname>は色々なバージョンの<productname>PostgreSQL</productname>と協調することができます。
540   理論的には、最初期のバージョンの<productname>PostgreSQL</productname>さえ、<productname>Pgpool-II</productname>で使用できます。
541   クライアント側についても同じことが言えます。
542   プロトコルに従う限り、どのような言語やドライバを使おうと、<productname>Pgpool-II</productname>は問題なく接続を受け付けます。
543  </para>
544  <para>
545   <!--
546   <productname>Pgpool-II</productname> consists of multiple
547   process. There is a main process, which is the parent process of
548   all other process. It is responsible for forking child process
549   each of which accepts connections from clients. There are some
550   worker process those are forked from the main process as well,
551   which is responsible for detecting streaming replication
552   delay. There is also a special process called "pcp process",
553   which is solely used for management
554   of <productname>Pgpool-II</productname>
555   itself. <productname>Pgpool-II</productname> has a built-in high
556   availability function called "watchdog". Watchdog consists of
557   some process. For more details of watchdog,
558   see <xref linkend="tutorial-watchdog">.
559   -->
560   <productname>Pgpool-II</productname>は複数のプロセスから構成されます。
561   他のすべてのプロセスの親となるメインプロセスがあります。
562   メインプロセスは、クライアントからのコネクションを受け付ける子プロセスをforkする役割があります。
563   また、メインプロセスからforkされるいくつかのワーカープロセスがあります。
564   ワーカープロセスは、ストリーミングレプリケーションの遅延を検出する役目があります。
565   また、「PCPCプロセス」と呼ばれる特殊なプロセスがあります。これは、<productname>Pgpool-II</productname>の管理専用に使用されます。
566   <productname>Pgpool-II</productname>には、組み込みの"watchdog"と呼ばれる組み込みの高可用性機能があります。
567   watchdogはいくつかのプロセスから構成されています。
568   watchdogの詳細については<xref linkend="tutorial-watchdog">をご覧ください。
569  </para>
570  <para>
571   <figure>
572    <!--
573    <title>Process architecure of <productname>Pgpool-II</productname></title>
574    -->
575    <title><productname>Pgpool-II</productname>のプロセス構造</title>
576    <mediaobject>
577     <imageobject>
578      <imagedata fileref="process-diagram.gif">
579     </imageobject>
580    </mediaobject>
581   </figure>
582  </para>
583
584 </sect1>
585
586</chapter>
587