Update doc about "Setting up PostgreSQL standby" in "8.2. Pgpool-II + Watchdog Setup...
authorTaiki Koshino <koshino@sraoss.co.jp>
Wed, 17 Sep 2025 07:15:11 +0000 (16:15 +0900)
committerTaiki Koshino <koshino@sraoss.co.jp>
Wed, 17 Sep 2025 07:15:11 +0000 (16:15 +0900)
Add a note that when setting up a standby without online recovery, do not write primary_conninfo to postgresql.auto.conf.

Discussion: https://github.com/pgpool/pgpool2/issues/67
Backpatch-through: v4.2

doc.ja/src/sgml/example-cluster.sgml
doc/src/sgml/example-cluster.sgml

index f5c01ac4fccdc972177b7fe9d4e970e16f140fc3..9cbfb3ce50e885fd4d381c664fac2b32fc901f09 100644 (file)
@@ -402,16 +402,38 @@ wal_log_hints = on
     <itemizedlist>
      <listitem>
       <para>
-       スタンバイで<command>pg_basebackup</command>を実行して、プライマリのデータディレクトリのバックアップを生成します。(この方法を利用する場合は、手動でレプリケーションスロットを作成してください。)
+       <productname>Pgpool-II</productname>のオンラインリカバリ機能(<xref linkend="runtime-online-recovery">)を使用して、スタンバイサーバを自動的にセットアップします。
       </para>
      </listitem>
      <listitem>
       <para>
-       <productname>Pgpool-II</productname>のオンラインリカバリ機能(<xref linkend="runtime-online-recovery">)を使用して、スタンバイサーバを自動的にセットアップします。
+       スタンバイで<command>pg_basebackup</command>を実行して、プライマリのデータディレクトリのバックアップを生成します。
       </para>
      </listitem>
     </itemizedlist>
    </para>
+   <note>
+    <para>
+     オンラインリカバリを使用せず手動でスタンバイをセットアップする場合は次の注意点があります。
+     <itemizedlist>
+      <listitem>
+       <para>
+        手動でレプリケーションスロットを作成する必要があります。
+       </para>
+      </listitem>
+     </itemizedlist>
+     <itemizedlist>
+      <listitem>
+       <para>
+        pg_basebackup を実行する際には -R オプションを指定しないでください。<varname>primary_conninfo</varname>、 <varname>recovery_target_timeline</varname>、 <varname>primary_slot_name</varname> は <filename>postgresql.auto.conf</filename> ではなく、<filename>$PGDATA/myrecovery.conf</filename> に記載し、<filename>postgresql.conf</filename> に以下を追記してください。
+       </para>
+      </listitem>
+     </itemizedlist>
+     <programlisting>
+include_if_exists = 'myrecovery.conf'
+     </programlisting>
+    </para>
+   </note>
    <para>
     この設定例では、<productname>Pgpool-II</productname>の構成が完了した後に、<xref linkend="example-cluster-verify-standby">で<productname>Pgpool-II</productname>のオンラインリカバリを使用してスタンバイサーバをセットアップします。
    </para>
index 2811af8edac3fcfe23d0a9df12832ec0644531a7..580626901d78ca213898d93b9d49a1d4703534ac 100644 (file)
@@ -417,18 +417,43 @@ wal_log_hints = on
     <itemizedlist>
      <listitem>
       <para>
-       use <command>pg_basebackup</command> to backup the data directory of the primary from the standby.
+       use <productname>Pgpool-II</productname>'s online recovery feature
+       (<xref linkend="runtime-online-recovery">) to automatically
+       setup a standby server.
       </para>
      </listitem>
      <listitem>
       <para>
-       use <productname>Pgpool-II</productname>'s online recovery feature
-       (<xref linkend="runtime-online-recovery">) to automatically
-       setup a standby server.
+       use <command>pg_basebackup</command> to backup the data directory of the primary from the standby.
       </para>
      </listitem>
     </itemizedlist>
    </para>
+
+   <note>
+    <para>
+     If you manually set up standby without using online recovery, please note the following:
+     <itemizedlist>
+      <listitem>
+       <para>
+        You must manually create the replication slots.
+       </para>
+      </listitem>
+     </itemizedlist>
+     <itemizedlist>
+      <listitem>
+       <para>
+        Do not specify the -R option when running pg_basebackup.
+        Write <varname>primary_conninfo</varname>, <varname>recovery_target_timeline</varname>, and <varname>primary_slot_name</varname> in <filename>$PGDATA/myrecovery.conf</filename>, not in <filename>postgresql.auto.conf</filename>, and add the following to <filename>postgresql.conf</filename>.
+       </para>
+      </listitem>
+     </itemizedlist>
+     <programlisting>
+include_if_exists = 'myrecovery.conf'
+     </programlisting>
+    </para>
+   </note>
+
    <para>
     In this example, we use <productname>Pgpool-II</productname>'s
     online recovery to setup the standby server