Enhance online recovery document.
authorTatsuo Ishii <ishii@postgresql.org>
Fri, 4 May 2018 02:35:26 +0000 (11:35 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Fri, 4 May 2018 02:35:26 +0000 (11:35 +0900)
Clarify that 2nd stage command is only required in native replication
mode.

doc.ja/src/sgml/online-recovery.sgml
doc.ja/src/sgml/ref/pcp_recovery_node.sgml
doc/src/sgml/online-recovery.sgml
doc/src/sgml/ref/pcp_recovery_node.sgml

index 1be23c02e21d74f2d9468a4d106626d299cd6abb..73c69f09533173b239a51200b46e3221fa7ef907 100644 (file)
@@ -8,22 +8,37 @@
 
   <para>
 <!--
-    <productname>Pgpool-II</productname> can synchronize database nodes and attach
-       a node without stopping the service.
-    This feature is called <acronym>"online recovery"</acronym>.
+    <productname>Pgpool-II</productname> can synchronize database
+    nodes and attach a node without stopping the service.  This
+    feature is called <acronym>"online recovery"</acronym>.  Online
+    recovery can be executed by
+    using <xref linkend="pcp-recovery-node"> command.
 -->
 <productname>Pgpool-II</productname> はサービスを止めることなくデータベースノードを同期させ、ノードを復帰させることができます。
 この機能は「<acronym>オンラインリカバリ</acronym>」と呼ばれます。
-  </para>
+オンラインリカバリは<xref linkend="pcp-recovery-node">コマンドで実行できます。
+ </para>
   <para>
 <!--
-    For online recovery, the recovery target node must be detached from <productname>Pgpool-II</>.
-    If you wish to add a <productname>PostgreSQL</> server node dynamically, reload the
+    For online recovery, the recovery target node must be in detached
+    state. This means the node must be either manually detached by
+    <xref linkend="pcp-detach-node"> or automatically detached
+    by <productname>Pgpool-II</productname> as a consequnece of
+    failover.
+-->
+オンラインリカバリを実施するためには、リカバリ対象のノードは<productname>Pgpool-II</productname>から切り離された状態になっていなければなりません。
+このことは、そのノードが、<xref linkend="pcp-detach-node">で手動で切り離された状態にあるか、フェイルオーバの結果、<productname>Pgpool-II</productname>により自動的に切り離された状態にあるかのいずれかでなければならないことを意味します。
+</para>
+<para>
+<!--
+    If you wish to add a <productname>PostgreSQL</productname> server
+    node dynamically, reload the
     <filename>pgpool.conf</filename> after adding the
-    <xref linkend="guc-backend-hostname"> and its associated parameters.
-    This will register the new server to <productname>Pgpool-II</productname> as a detached backend node.
+    <xref linkend="guc-backend-hostname"> and its associated
+    parameters.  This will register the new server
+    to <productname>Pgpool-II</productname> as a detached backend
+    node.
 -->
-オンラインリカバリを実施するためには、リカバリ対象のノードは<productname>Pgpool-II</>から切り離されている必要があります。
 新しい<productname>PostgreSQL</>サーバを動的に追加したい場合には、<xref linkend="guc-backend-hostname">および関連パラメータを追加した後に<filename>pgpool.conf</filename>を再読み込みします。
 これにより新しいサーバが切り離された状態のバックエンドノードとして<productname>Pgpool-II</productname>に登録されます。
   </para>
@@ -60,13 +75,39 @@ PostgreSQLのPITRを使っている場合は適用されません。
 
   <para>
 <!--
+    Online recovery is performed in two phases. The first phase is
+    called "first stage" and the second phase is called "second
+    stage". You need to provide scripts for each
+    stage. Only <xref linkend="guc-replication-mode"> requires the
+    second stage.  For other modes including streaming replication
+    mode the second stage is not performed and you don't need to
+    provide a script for the stage
+    in <xref linkend="guc-recovery-2nd-stage-command">. i.e. you can
+    safely leave it as an empty string.
+
     Online recovery is performed in two phases. Connections from cliens are
     not allowd in second phase of online recovery while the data can be
     updated or retrieved during the first phase.
     <productname>Pgpool-II</productname> performs the follows steps in online recovery:
 -->
 オンラインリカバリは2段階に分けて実施されます。
+第1段階は「ファーストステージ」、第2段階は「セカンドステージ」と呼ばれます。
+それぞれのステージ用にスクリプトを用意する必要があります。
+<xref linkend="guc-replication-mode">の時のみセカンドステージが必要です。
+ストリーミングレプリケーションモードを含むその他のモードでは、セカンドステージは実施されず、<xref linkend="guc-recovery-2nd-stage-command">用のスクリプトを用意する必要はありません。
+つまり、そのエントリを空文字にしておいても問題ありません。
+</para>
+<para>
+<!--
+    Connections from cliens are not allowd only in the second stage
+    while the data can be updated or retrieved during the first statge.
+-->
 ファーストステージではデータの更新や読み取りができますが、セカンドステージではクライアントからの接続は許されていません。
+</para>
+  <para>
+<!--
+    <productname>Pgpool-II</productname> performs the follows steps in online recovery:
+-->
 オンラインリカバリでは<productname>Pgpool-II</productname>は以下の手順を実施します。
   </para>
   <itemizedlist>
@@ -89,12 +130,12 @@ PostgreSQLのPITRを使っている場合は適用されません。
 <!--
         Wait until all client connections have disconnected.
 -->
-全てのクライアント接続が切断されるまで待機
+全てのクライアント接続が切断されるまで待機(<xref linkend="guc-replication-mode">のみ)。
       </para>
     </listitem>
     <listitem>
       <para>
-        CHECKPOINT.
+        CHECKPOINT(<xref linkend="guc-replication-mode">のみ)。
       </para>
     </listitem>
     <listitem>
@@ -102,7 +143,7 @@ PostgreSQLのPITRを使っている場合は適用されません。
 <!--
         Second stage of online recovery.
 -->
-オンラインリカバリのセカンドステージ。
+オンラインリカバリのセカンドステージ(<xref linkend="guc-replication-mode">のみ)
       </para>
     </listitem>
     <listitem>
@@ -126,7 +167,8 @@ postmasterの起動(<literal>pgpool_remote_start</literal>の実施)
   <note>
     <para>
 <!--
-      There is a restriction in the online recovery. If
+      There is a restriction in the online recovery in
+      <xref linkend="guc-replication-mode">. If
       <productname>Pgpool-II</productname> itself is installed
       on multiple hosts, online recovery does not work correctly,
       because <productname>Pgpool-II</productname> has to stop all
@@ -135,7 +177,7 @@ postmasterの起動(<literal>pgpool_remote_start</literal>の実施)
       only one of them will have received the online recovery command and will
       block the connections from clients.
 -->
-オンラインリカバリには制限事項があります。
+<xref linkend="guc-replication-mode">でのオンラインリカバリには制限事項があります。
 <productname>Pgpool-II</productname>が複数のホストにインストールされている場合、<productname>Pgpool-II</productname>はオンラインリカバリの2ndステージの間全てのクライアントを止める必要があるため、オンラインリカバリは正しく動作しません。
 複数の<productname>Pgpool-II</productname>ホストがある場合、そのうちの1台のみがオンラインリカバコマンドを受け取り、クライアントからの接続をブロックします。
     </para>
index 9fc7ee65bc1a42f23ed5602099a80e2dcbe3d526..ebdcb7e055ae141a065e5ca0167a48556881dd9a 100644 (file)
@@ -40,8 +40,10 @@ Pgpool-II documentation
   <command>pcp_recovery_node</command>
   <!--
   attaches the given backend node with recovery.
+  See <xref linkend="runtime-online-recovery"> to set up necessary parameters of pgpool.conf.
   -->
   は <productname>Pgpool-II</productname> のノードのデータを再同期させた上で復帰させます。
+  pgpool.confに必要なパラメータを設定する方法の詳細については、<xref linkend="runtime-online-recovery">をご覧ください。
   </para>
  </refsect1>
 
index 3cb329bf76f2309619c5f781ac5a7498a8b2d012..e2ecc154b2c41157995c12360023967e8bd585f3 100644 (file)
@@ -4,16 +4,27 @@
   <title>Online Recovery</title>
 
   <para>
-    <productname>Pgpool-II</productname> can synchronize database nodes and attach
-       a node without stopping the service.
-    This feature is called <acronym>"online recovery"</acronym>.
+    <productname>Pgpool-II</productname> can synchronize database
+    nodes and attach a node without stopping the service.  This
+    feature is called <acronym>"online recovery"</acronym>.  Online
+    recovery can be executed by
+    using <xref linkend="pcp-recovery-node"> command.
   </para>
   <para>
-    For online recovery, the recovery target node must be detached from <productname>Pgpool-II</>.
-    If you wish to add a <productname>PostgreSQL</> server node dynamically, reload the
+    For online recovery, the recovery target node must be in detached
+    state. This means the node must be either manually detached by
+    <xref linkend="pcp-detach-node"> or automatically detached
+    by <productname>Pgpool-II</productname> as a consequnece of
+    failover.
+  </para>
+  <para>
+    If you wish to add a <productname>PostgreSQL</productname> server
+    node dynamically, reload the
     <filename>pgpool.conf</filename> after adding the
-    <xref linkend="guc-backend-hostname"> and its associated parameters.
-    This will register the new server to <productname>Pgpool-II</productname> as a detached backend node.
+    <xref linkend="guc-backend-hostname"> and its associated
+    parameters.  This will register the new server
+    to <productname>Pgpool-II</productname> as a detached backend
+    node.
   </para>
 <!--
   <caution>
 -->
   <note>
     <para>
-      The recovery target <productname>PostgreSQL</> server must not be running for performing the online recovery.
-      If the target <productname>PostgreSQL</> server has already started, you must shut it down before
-      starting the online recovery.
+      The recovery target <productname>PostgreSQL</> server must not
+      be running for performing the online recovery.  If the
+      target <productname>PostgreSQL</> server has already started,
+      you must shut it down before starting the online recovery.
     </para>
   </note>
 
   <para>
-    Online recovery is performed in two phases. Connections from cliens are
-    not allowd only in second phase of online recovery while the data can be
-    updated or retrieved during the first phase.
+    Online recovery is performed in two phases. The first phase is
+    called "first stage" and the second phase is called "second
+    stage". You need to provide scripts for each
+    stage. Only <xref linkend="guc-replication-mode"> requires the
+    second stage.  For other modes including streaming replication
+    mode the second stage is not performed and you don't need to
+    provide a script for the stage
+    in <xref linkend="guc-recovery-2nd-stage-command">. i.e. you can
+    safely leave it as an empty string.
+  </para>
+  <para>
+    Connections from cliens are not allowd only in the second stage
+    while the data can be updated or retrieved during the first statge.
+  </para>
+  <para>
     <productname>Pgpool-II</productname> performs the follows steps in online recovery:
   </para>
   <itemizedlist>
     </listitem>
     <listitem>
       <para>
-        First stage of online recovery.
+        Execute first stage of online recovery.
       </para>
     </listitem>
     <listitem>
       <para>
-        Wait until all client connections have disconnected.
+        Wait until all client connections have disconnected (only
+        in <xref linkend="guc-replication-mode">).
       </para>
     </listitem>
     <listitem>
       <para>
-        CHECKPOINT.
+        CHECKPOINT (only in <xref linkend="guc-replication-mode">).
+        specified).
       </para>
     </listitem>
     <listitem>
       <para>
-        Second stage of online recovery.
+        Execute second stage of online recovery (only
+        in <xref linkend="guc-replication-mode">).
       </para>
     </listitem>
     <listitem>
   </itemizedlist>
   <note>
     <para>
-      There is a restriction in the online recovery. If
+      There is a restriction in the online recovery in
+      <xref linkend="guc-replication-mode">. If
       <productname>Pgpool-II</productname> itself is installed
       on multiple hosts, online recovery does not work correctly,
       because <productname>Pgpool-II</productname> has to stop all
       </term>
       <listitem>
         <para>
-          Specifies a command to be run by master(primary) node at the
+          Specifies a command to be run by master (primary) node at the
           first stage of online recovery. The command file must be placed in the
           database cluster directory for security reasons.
           For example, if <varname>recovery_1st_stage_command</varname> = <literal>
         <itemizedlist>
           <listitem>
             <para>
-              Path to the database cluster of the master(primary) node.
+              Path to the database cluster of the master (primary) node.
             </para>
           </listitem>
           <listitem>
           </listitem>
           <listitem>
             <para>
-              Port number of the master(primary) node.
+              Port number of the master (primary) node.
             </para>
           </listitem>
         </itemizedlist>
@@ -213,13 +241,16 @@ rsync used in the command is killed by signal 2 for example.
       <listitem>
 
         <para>
-          Specifies a command to be run by master(primary) node at the
-          second stage of online recovery. The command file must be placed in the
-          database cluster directory for security reasons.
-          For example, if <varname>recovery_2nd_stage_command</varname> = <literal>
-          'sync-command'</literal>, then <productname>Pgpool-II</productname> will
-          look for the command scrit in <literal>$PGDATA</literal> directory and will
-          try to execute <command>$PGDATA/sync-command</command>.
+          Specifies a command to be run by master node at the second
+          stage of online recovery. This parameter only neccessary for
+          <xref linkend="guc-replication-mode">. The command file must
+          be placed in the database cluster directory for security
+          reasons.  For example,
+          if <varname>recovery_2nd_stage_command</varname> = <literal>
+          'sync-command'</literal>,
+          then <productname>Pgpool-II</productname> will look for the
+          command scrit in <literal>$PGDATA</literal> directory and
+          will try to execute <command>$PGDATA/sync-command</command>.
         </para>
         <para>
           <varname>recovery_2nd_stage_command</varname> receives following 4 parameters:
index 819a84e57ff7994e5f349c7645e797a4c7990e86..a52f1bc1bd48b079b767808a9d0445a4f0a427b0 100644 (file)
@@ -31,8 +31,9 @@ Pgpool-II documentation
  <refsect1 id="R1-PCP-RECOVERY-NODE-1">
   <title>Description</title>
   <para>
-  <command>pcp_node_info</command>
+  <command>pcp_recovery_node</command>
   attaches the given backend node with recovery.
+  See <xref linkend="runtime-online-recovery"> to set up necessary parameters of pgpool.conf.
   </para>
  </refsect1>