<varname>if_up_cmd/if_down_cmd</varname>で実行するスクリプトをすべての<productname>Pgpool-II</productname>インスタンス上に作成します。
</para>
<para>
- この設定例では、サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_eip_if_cmd.sh.sample;hb=refs/heads/master">aws_eip_if_cmd.sh</ulink>を使用します。必要に応じて、編集してください。
+ この設定例では、サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_eip_if_cmd.sh.sample;hb=refs/heads/V4_4_STABLE">aws_eip_if_cmd.sh</ulink>を使用します。必要に応じて、編集してください。
</para>
<programlisting>
(すべてのPgpool-IIインスタンスで実行)
-# cp -p /etc/pgpool-II/aws_eip_if_cmd.sh{.sample,}
+# cp -p /etc/pgpool-II/sample_scripts/aws_eip_if_cmd.sh.sample /etc/pgpool-II/aws_eip_if_cmd.sh
</programlisting>
<para>
if_up_cmd/if_down_cmdで実行するスクリプトをすべてのPgpool-IIインスタンス上に作成します。
</para>
<para>
- この設定例では、サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_rtb_if_cmd.sh.sample;hb=refs/heads/master">aws_rtb_if_cmd.sh</ulink>を使用します。必要に応じて、編集してください。
+ この設定例では、サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_rtb_if_cmd.sh.sample;hb=refs/heads/V4_4_STABLE">aws_rtb_if_cmd.sh</ulink>を使用します。必要に応じて、編集してください。
</para>
<programlisting>
(すべてのPgpool-IIインスタンスで実行)
-# cp -p /etc/pgpool-II/aws_rtb_if_cmd.sh{.sample,}
+# cp -p /etc/pgpool-II/sample_scripts/aws_rtb_if_cmd.sh.sample /etc/pgpool-II/aws_rtb_if_cmd.sh
</programlisting>
</sect3>
<tbody>
<row>
<entry morerows='1'>自動フェイルオーバ</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/failover.sh.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/failover.sh.sample</ulink></entry>
<entry>フェイルオーバを実行するスクリプト。<xref linkend="GUC-FAILOVER-COMMAND">で使用します。</entry>
</row>
<row>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/follow_primary.sh.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/follow_primary.sh.sample</ulink></entry>
<entry>フェイルオーバ後、新しいプライマリサーバとスタンバイサーバを同期させるスクリプト。<xref linkend="GUC-FOLLOW-PRIMARY-COMMAND">で使用します。</entry>
</row>
<row>
<entry morerows='1'>オンラインリカバリ</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/recovery_1st_stage.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/recovery_1st_stage.sample</ulink></entry>
<entry>スタンバイサーバをリカバリするスクリプト。<xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND">で使用します。</entry>
</row>
<row>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/pgpool_remote_start.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/pgpool_remote_start.sample</ulink></entry>
<entry><xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> 後に、スタンバイノードを起動させるスクリプト。</entry>
</row>
<row>
<entry morerows='1'>Watchdog</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/escalation.sh.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/escalation.sh.sample</ulink></entry>
<entry>
Pgpool-IIのアクティブ/スタンバイ切り替え時に新アクティブ機以外で起動している
仮想IPを停止するスクリプト。<xref linkend="guc-wd-escalation-command">で使用します。
</para>
</note>
<para>
- サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_3_STABLE">failover.sh</ulink>及び
- <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_3_STABLE">follow_primary.sh</ulink>は
+ サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_4_STABLE">failover.sh</ulink>及び
+ <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_4_STABLE">follow_primary.sh</ulink>は
<filename>/etc/pgpool-II/</filename>配下にインストールされていますので、これらのファイルをコピーして作成します。
</para>
<programlisting>
-[全サーバ]# cp -p /etc/pgpool-II/failover.sh{.sample,}
-[全サーバ]# cp -p /etc/pgpool-II/follow_primary.sh{.sample,}
+[全サーバ]# cp -p /etc/pgpool-II/sample_scripts/failover.sh.sample /etc/pgpool-II/failover.sh
+[全サーバ]# cp -p /etc/pgpool-II/sample_scripts/follow_primary.sh.sample /etc/pgpool-II/follow_primary.sh
[全サーバ]# chown postgres:postgres /etc/pgpool-II/{failover.sh,follow_primary.sh}
</programlisting>
<para>
recovery_1st_stage_command = 'recovery_1st_stage'
</programlisting>
<para>
- オンラインリカバリ用のサンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_3_STABLE">recovery_1st_stage</ulink>
- 及び<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_3_STABLE">pgpool_remote_start</ulink>は
+ オンラインリカバリ用のサンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_4_STABLE">recovery_1st_stage</ulink>
+ 及び<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_4_STABLE">pgpool_remote_start</ulink>は
<filename>/etc/pgpool-II/</filename>配下にインストールされていますので、
これらのファイルをプライマリサーバ(<literal>server1</literal>)のデータベースクラスタ配下に配置します。
</para>
<programlisting>
-[server1]# cp -p /etc/pgpool-II/recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage
-[server1]# cp -p /etc/pgpool-II/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
+[server1]# cp -p /etc/pgpool-II/sample_scripts/recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage
+[server1]# cp -p /etc/pgpool-II/sample_scripts/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
[server1]# chown postgres:postgres /var/lib/pgsql/14/data/{recovery_1st_stage,pgpool_remote_start}
</programlisting>
<para>
# (change requires restart)
</programlisting>
<para>
- サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_3_STABLE">escalation.sh</ulink>は
+ サンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_4_STABLE">escalation.sh</ulink>は
<filename>/etc/pgpool-II/</filename>配下にインストールされています。
</para>
<programlisting>
-[全サーバ]# cp -p /etc/pgpool-II/escalation.sh{.sample,}
+[全サーバ]# cp -p /etc/pgpool-II/sample_scripts/escalation.sh.sample /etc/pgpool-II/escalation.sh
[全サーバ]# chown postgres:postgres /etc/pgpool-II/escalation.sh
</programlisting>
recovery_2nd_stage_command = 'recovery_2nd_stage.sh'
</programlisting>
<para>
- ネイティブレプリケーションモード/スナップショットアイソレーションモード専用のオンラインリカバリ用のサンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_1st_stage.sample;hb=refs/heads/V4_3_STABLE">replication_mode_recovery_1st_stage.sample</ulink>、
- <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_2nd_stage.sample;hb=refs/heads/V4_3_STABLE">replication_mode_recovery_2nd_stage.sample</ulink>
- 及び<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_3_STABLE">pgpool_remote_start.sample</ulink>は
+ ネイティブレプリケーションモード/スナップショットアイソレーションモード専用のオンラインリカバリ用のサンプルスクリプト<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_1st_stage.sample;hb=refs/heads/V4_4_STABLE">replication_mode_recovery_1st_stage.sample</ulink>、
+ <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_2nd_stage.sample;hb=refs/heads/V4_4_STABLE">replication_mode_recovery_2nd_stage.sample</ulink>
+ 及び<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_4_STABLE">pgpool_remote_start.sample</ulink>は
<filename>/etc/pgpool-II/</filename>配下にインストールされていますので、
これらのファイルをmainノード(<literal>server1</literal>)のデータベースクラスタ配下に配置します。
</para>
<programlisting>
-[server1]# cp -p /etc/pgpool-II/replication_mode_recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage.sh
-[server1]# cp -p /etc/pgpool-II/replication_mode_recovery_2nd_stage.sample /var/lib/pgsql/14/data/recovery_2nd_stage.sh
-[server1]# cp -p /etc/pgpool-II/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage.sh
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_2nd_stage.sample /var/lib/pgsql/14/data/recovery_2nd_stage.sh
+[server1]# cp -p /etc/pgpool-II/sample_scripts/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
[server1]# chown postgres:postgres /var/lib/pgsql/14/data/{recovery_1st_stage.sh,recovery_2nd_stage.sh,pgpool_remote_start}
</programlisting>
<para>
-->
RHELとその派生ディストリビューションでは、以下を一度行ってください。
<programlisting>
- dnf install https://www.pgpool.net/yum/rpms/4.3/redhat/rhel-8-x86_64/pgpool-II-release-4.3-1.noarch.rpm
+dnf install https://www.pgpool.net/yum/rpms/4.4/redhat/rhel-8-x86_64/pgpool-II-release-4.4-1.noarch.rpm
</programlisting>
<!--
Then:
-->
そして以下を実施してください。
<programlisting>
- dnf install pgpool-II-pg13
+dnf install pgpool-II-pg15
</programlisting>
<!--
Optionally you can install:
-->
- <literal>pg13</literal>は、<literal>PostgreSQL 13</literal>を意味しています。
+ <literal>pg15</literal>は、<literal>PostgreSQL 15</literal>を意味しています。
<productname>Pgpool-II</productname>は<productname>PostgreSQL</productname>のライブラリと拡張のディレクトリが必要です。
そのディレクトリへのパスは<productname>PostgreSQL</productname>のバージョンごとに異なっているので、<productname>PostgreSQL</productname>に対応するRPMを選んでください。
またRPMは、<ulink url="https://www.postgresql.org/download/linux/redhat/"><productname>PostgreSQL</productname>コミュニティRPM</ulink>を使用することを前提としています。
<programlisting>
- dnf install pgpool-II-pg13-debuginfo
+dnf install pgpool-II-pg15-debuginfo
</programlisting>
<!--
which makes it easier to retrieve debugging symbols from the core
インストールすることを推奨します。
開発向けのオプションパッケージがあります。
<programlisting>
- dnf install pgpool-II-pg13-devel
+dnf install pgpool-II-pg15-devel
</programlisting>
<!--
This installs header files which developers are interested in
-->
すべての<productname>PostgreSQL</productname>サーバに、以下をインストールしてください。
<programlisting>
- dnf install pgpool-II-pg13-extensions
+dnf install pgpool-II-pg15-extensions
</programlisting>
</para>
<title>Pgpool-IIの起動と停止</title>
<para>
<!--
- RHEL7/CentOS 7では、以下を一度行ってください。
+ On RHEL7,8/CentOS7,8, do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
-->
- <!--
- Do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
- -->
- <productname>Pgpool-II</productname>の自動起動を設定する場合、以下を実行してください。
+ RHEL7,8/CentOS7,8では、<productname>Pgpool-II</productname>の自動起動を設定する場合、以下を実行してください。
<programlisting>
- systemctl enable pgpool.service
+systemctl enable pgpool.service
</programlisting>
<!--
- After this, restart the whole system or do this. Please note that
- <productname>PostgreSQL</productname> servers must have been started
- before this.
+ After this, to start <productname>Pgpool-II</productname>,
+ run the following command or restart the whole system.
+ Please note that PostgreSQL servers must have been started before this.
-->
- この後システム全体を再起動するか、以下を実行してください。
+ この後<productname>Pgpool-II</productname>を起動するには、システム全体を再起動するか、以下を実行してください。
<productname>PostgreSQL</productname>サーバは、これよりも前に起動済みでなければならないことに注意してください。
<programlisting>
- systemctl start pgpool.service
+systemctl start pgpool.service
</programlisting>
<!--
To stop <productname>Pgpool-II</productname>, do this once.
- <productname>Pgpool-II</productname> must need to stop, before <productname>PostgreSQL</productname> is stopped.
+ Please note that <productname>Pgpool-II</productname> must need to stop,
+ before <productname>PostgreSQL</productname> is stopped.
-->
<productname>Pgpool-II</productname>を停止するには、以下を実行してください。<productname>PostgreSQL</productname>を停止する場合、<productname>Pgpool-II</productname>を先に停止する必要があります。
<programlisting>
- systemctl stop pgpool.service
+systemctl stop pgpool.service
</programlisting>
<!--
</para>
<para>
<!--
- On RHEL6/CentOS 6, do this once.
+ On RHEL6/CentOS6, do this once, if set the automatic startup of Pgpool-II.
-->
- RHEL6/CentOS 6では、以下を一度行ってください。
+ RHEL6/CentOS6では、<productname>Pgpool-II</productname>の自動起動を設定する場合、以下を実行してください。
<programlisting>
- chkconfig pgpool on
+chkconfig pgpool on
</programlisting>
<!--
- After this, restart the whole system or:
+ After this, to start <productname>Pgpool-II</productname>,
+ run the following command or restart the whole system.
+ Please note that PostgreSQL servers must have been started before this.
-->
- この後システム全体を再起動するか、以下を実行してください。
+ この後<productname>Pgpool-II</productname>を起動するには、システム全体を再起動するか、以下を実行してください。
+ <productname>PostgreSQL</productname>サーバは、これよりも前に起動済みでなければならないことに注意してください。
<programlisting>
- service start pgpool
+service start pgpool
</programlisting>
<!--
- Please note that <productname>PostgreSQL</productname> servers
- must have been started before this.
- -->
- <productname>PostgreSQL</productname>サーバは、これよりも前に起動済みでなければならないことに注意してください。
- <!--
- To stop <productname>Pgpool-II</productname>:
+ To stop <productname>Pgpool-II</productname> run the following command.
+ Please note that <productname>Pgpool-II</productname> must need to stop,
+ before <productname>PostgreSQL</productname> is stopped.
-->
- <productname>Pgpool-II</productname>を停止するには、次のようにしてください。
+ <productname>Pgpool-II</productname>を停止するには、以下を実行してください。<productname>PostgreSQL</productname>を停止する場合、<productname>Pgpool-II</productname>を先に停止する必要があります。
<programlisting>
- service stop pgpool
+service stop pgpool
</programlisting>
<!--
After this, you can stop <productname>PostgreSQL</productname>
servers.
-->
- この後、<productname>PostgreSQL</productname>サーバを停止しても構いません。
+この後、<productname>PostgreSQL</productname>サーバを停止しても構いません。
</para>
</sect2>
Create the script executed by if_up_cmd/if_down_cmd on each Pgpool-II instance.
</para>
<para>
- In this example, we use the sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_eip_if_cmd.sh.sample;hb=refs/heads/master">aws_eip_if_cmd.sh</ulink>. Modify it if necessary.
+ In this example, we use the sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_eip_if_cmd.sh.sample;hb=refs/heads/V4_4_STABLE">aws_eip_if_cmd.sh</ulink>. Modify it if necessary.
</para>
<programlisting>
(run the following command on each Pgpool-II instance)
-# cp -p /etc/pgpool-II/aws_eip_if_cmd.sh{.sample,}
+# cp -p /etc/pgpool-II/sample_scripts/aws_eip_if_cmd.sh.sample /etc/pgpool-II/aws_eip_if_cmd.sh
</programlisting>
</sect3>
<productname>Pgpool-II</productname> instance.
</para>
<para>
- In this example, we use the sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_rtb_if_cmd.sh.sample;hb=refs/heads/master">aws_rtb_if_cmd.sh</ulink>. Modify it if necessary.
+ In this example, we use the sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/aws_rtb_if_cmd.sh.sample;hb=refs/heads/V4_4_STABLE">aws_rtb_if_cmd.sh</ulink>. Modify it if necessary.
</para>
<programlisting>
(run the following command on each Pgpool-II instance)
-# cp -p /etc/pgpool-II/aws_rtb_if_cmd.sh{.sample,}
+# cp -p /etc/pgpool-II/sample_scripts/aws_rtb_if_cmd.sh.sample /etc/pgpool-II/aws_rtb_if_cmd.sh
</programlisting>
</sect3>
<tbody>
<row>
<entry morerows='1'>Failover</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/failover.sh.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/failover.sh.sample</ulink></entry>
<entry>Run by <xref linkend="GUC-FAILOVER-COMMAND"> to perform failover</entry>
</row>
<row>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/follow_primary.sh.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/follow_primary.sh.sample</ulink></entry>
<entry>Run by <xref linkend="GUC-FOLLOW-PRIMARY-COMMAND"> to synchronize the Standby with the new Primary after failover.</entry>
</row>
<row>
<entry morerows='1'>Online recovery</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/recovery_1st_stage.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/recovery_1st_stage.sample</ulink></entry>
<entry>Run by <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> to recovery a Standby node</entry>
</row>
<row>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/pgpool_remote_start.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/pgpool_remote_start.sample</ulink></entry>
<entry>Run after <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> to start the Standby node</entry>
</row>
<row>
<entry morerows='1'>Watchdog</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_3_STABLE">/etc/pgpool-II/escalation.sh.sample</ulink></entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_4_STABLE">/etc/pgpool-II/sample_scripts/escalation.sh.sample</ulink></entry>
<entry>Run by <xref linkend="guc-wd-escalation-command"> to switch the Active/Standby Pgpool-II safely</entry>
</row>
</tbody>
</para>
</note>
<para>
- Sample scripts <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_3_STABLE">failover.sh</ulink>
- and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_3_STABLE">follow_primary.sh</ulink>
+ Sample scripts <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/V4_4_STABLE">failover.sh</ulink>
+ and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/V4_4_STABLE">follow_primary.sh</ulink>
are installed in <filename>/etc/pgpool-II/</filename>. Create failover scripts using these sample files.
</para>
<programlisting>
-[all servers]# cp -p /etc/pgpool-II/failover.sh{.sample,}
-[all servers]# cp -p /etc/pgpool-II/follow_primary.sh{.sample,}
+[all servers]# cp -p /etc/pgpool-II/sample_scripts/failover.sh.sample /etc/pgpool-II/failover.sh
+[all servers]# cp -p /etc/pgpool-II/sample_scripts/follow_primary.sh.sample /etc/pgpool-II/follow_primary.sh
[all servers]# chown postgres:postgres /etc/pgpool-II/{failover.sh,follow_primary.sh}
</programlisting>
<para>
recovery_1st_stage_command = 'recovery_1st_stage'
</programlisting>
<para>
- Online recovery sample scripts<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_3_STABLE">recovery_1st_stage</ulink>
- and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_3_STABLE">pgpool_remote_start</ulink>
+ Online recovery sample scripts<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/V4_4_STABLE">recovery_1st_stage</ulink>
+ and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_4_STABLE">pgpool_remote_start</ulink>
are installed in <filename>/etc/pgpool-II/</filename>. Copy these files to the data directory of the primary server (server1).
</para>
<programlisting>
-[server1]# cp -p /etc/pgpool-II/recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage
-[server1]# cp -p /etc/pgpool-II/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
+[server1]# cp -p /etc/pgpool-II/sample_scripts/recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage
+[server1]# cp -p /etc/pgpool-II/sample_scripts/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
[server1]# chown postgres:postgres /var/lib/pgsql/14/data/{recovery_1st_stage,pgpool_remote_start}
</programlisting>
<para>
# (change requires restart)
</programlisting>
<para>
- The sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_3_STABLE">escalation.sh</ulink> is installed in <filename>/etc/pgpool-II/</filename>.
+ The sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/V4_4_STABLE">escalation.sh</ulink> is installed in <filename>/etc/pgpool-II/</filename>.
</para>
<programlisting>
-[all servers]# cp -p /etc/pgpool-II/escalation.sh{.sample,}
+[all servers]# cp -p /etc/pgpool-II/sample_scripts/escalation.sh.sample /etc/pgpool-II/escalation.sh
[all servers]# chown postgres:postgres /etc/pgpool-II/escalation.sh
</programlisting>
recovery_2nd_stage_command = 'recovery_2nd_stage'
</programlisting>
The sample scripts
- <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_1st_stage.sample;hb=refs/heads/V4_3_STABLE">replication_mode_recovery_1st_stage.sample</ulink>,
- <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_2nd_stage.sample;hb=refs/heads/V4_3_STABLE">replication_mode_recovery_2nd_stage.sample</ulink>
+ <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_1st_stage.sample;hb=refs/heads/V4_4_STABLE">replication_mode_recovery_1st_stage.sample</ulink>,
+ <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/replication_mode_recovery_2nd_stage.sample;hb=refs/heads/V4_4_STABLE">replication_mode_recovery_2nd_stage.sample</ulink>
and
- <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_3_STABLE">pgpool_remote_start.sample</ulink>
+ <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/V4_4_STABLE">pgpool_remote_start.sample</ulink>
are installed in <filename>/etc/pgpool-II/</filename>.
Create the scripts used by online recovery command from sample scripts and copy these files to the database cluster directory.
</para>
<programlisting>
-[server1]# cp -p /etc/pgpool-II/replication_mode_recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage
-[server1]# cp -p /etc/pgpool-II/replication_mode_recovery_2nd_stage.sample /var/lib/pgsql/14/data/recovery_2nd_stage
-[server1]# cp -p /etc/pgpool-II/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_1st_stage.sample /var/lib/pgsql/14/data/recovery_1st_stage
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_2nd_stage.sample /var/lib/pgsql/14/data/recovery_2nd_stage
+[server1]# cp -p /etc/pgpool-II/sample_scripts/pgpool_remote_start.sample /var/lib/pgsql/14/data/pgpool_remote_start
[server1]# chown postgres:postgres /var/lib/pgsql/14/data/{recovery_1st_stage,recovery_2nd_stage,pgpool_remote_start}
</programlisting>
<para>
<para>
For RHEL and its derivatives do following once:
<programlisting>
- dnf install https://www.pgpool.net/yum/rpms/4.3/redhat/rhel-8-x86_64/pgpool-II-release-4.3-1.noarch.rpm
+dnf install https://www.pgpool.net/yum/rpms/4.4/redhat/rhel-8-x86_64/pgpool-II-release-4.4-1.noarch.rpm
</programlisting>
Then:
<programlisting>
- dnf install pgpool-II-pg13
+dnf install pgpool-II-pg15
</programlisting>
- <literal>pg13</literal> means <literal>PostgreSQL
- 13</literal>. <productname>Pgpool-II</productname>
+ <literal>pg15</literal> means <literal>PostgreSQL
+ 15</literal>. <productname>Pgpool-II</productname>
needs <productname>PostgreSQL</productname>'s library and
extensions directory. Since the directory paths are different in
the particular <productname>PostgreSQL</productname> versions,
Optionally you can install:
<programlisting>
- dnf install pgpool-II-pg13-debuginfo
+dnf install pgpool-II-pg15-debuginfo
</programlisting>
which makes it easier to retrieve debugging symbols from the core
or the backtrace. We recommend to install it.
There is an optional package for developers.
<programlisting>
- dnf install pgpool-II-pg13-devel
+dnf install pgpool-II-pg15-devel
</programlisting>
This installs header files which developers are interested in.
</para>
On all the <productname>PostgreSQL</productname> servers you need
to install:
<programlisting>
- dnf install pgpool-II-pg13-extensions
+dnf install pgpool-II-pg15-extensions
</programlisting>
</para>
<sect2 id="start-rpm">
<title>Starting/stopping Pgpool-II</title>
<para>
- On RHEL7/CentOS 7, do this once.
- Do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
+ On RHEL7,8/CentOS7,8, do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
<programlisting>
- systemctl enable pgpool.service
+systemctl enable pgpool.service
</programlisting>
- After this, restart the whole system or do this. Please note that
- <productname>PostgreSQL</productname> servers must have been started
- before this.
+ After this, to start <productname>Pgpool-II</productname>,
+ run the following command or restart the whole system.
+ Please note that PostgreSQL servers must have been started before this.
<programlisting>
- systemctl start pgpool.service
+systemctl start pgpool.service
</programlisting>
To stop <productname>Pgpool-II</productname>, do this once.
- <productname>Pgpool-II</productname> must need to stop, before <productname>PostgreSQL</productname> is stopped.
+ Please note that <productname>Pgpool-II</productname> must need to stop,
+ before <productname>PostgreSQL</productname> is stopped.
<programlisting>
- systemctl stop pgpool.service
+systemctl stop pgpool.service
</programlisting>
After this, you can stop <productname>PostgreSQL</productname>
servers.
</para>
<para>
- On RHEL6/CentOS 6, do this once.
+ On RHEL6/CentOS6, do this once, if set the automatic startup of Pgpool-II.
<programlisting>
- chkconfig pgpool on
+chkconfig pgpool on
</programlisting>
- After this, restart the whole system or:
+ After this, to start <productname>Pgpool-II</productname>,
+ run the following command or restart the whole system.
+ Please note that PostgreSQL servers must have been started before this.
<programlisting>
- service start pgpool
+service start pgpool
</programlisting>
- Please note that <productname>PostgreSQL</productname> servers
- must have been started before this.
+ To stop <productname>Pgpool-II</productname> run the following command.
+ Please note that <productname>Pgpool-II</productname> must need to stop,
+ before <productname>PostgreSQL</productname> is stopped.
- To stop <productname>Pgpool-II</productname>:
<programlisting>
- service stop pgpool
+service stop pgpool
</programlisting>
After this, you can stop <productname>PostgreSQL</productname>
install -d %{buildroot}%{_datadir}/%{short_name}
install -d %{buildroot}%{_sysconfdir}/%{short_name}
-install -d %{buildroot}%{_sysconfdir}/%{short_name}/scripts
+install -d %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts
mv %{buildroot}%{_sysconfdir}/%{short_name}/failover.sh.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/failover.sh.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/failover.sh.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/follow_primary.sh.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/follow_primary.sh.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/follow_primary.sh.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/pgpool_remote_start.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/pgpool_remote_start.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/pgpool_remote_start.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/recovery_1st_stage.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/recovery_1st_stage.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/recovery_1st_stage.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/replication_mode_recovery_1st_stage.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/replication_mode_recovery_1st_stage.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_1st_stage.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/replication_mode_recovery_2nd_stage.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/replication_mode_recovery_2nd_stage.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_2nd_stage.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/escalation.sh.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/escalation.sh.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/escalation.sh.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/aws_eip_if_cmd.sh.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/aws_eip_if_cmd.sh.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/aws_eip_if_cmd.sh.sample
mv %{buildroot}%{_sysconfdir}/%{short_name}/aws_rtb_if_cmd.sh.sample \
- %{buildroot}%{_sysconfdir}/%{short_name}/scripts/aws_rtb_if_cmd.sh.sample
+ %{buildroot}%{_sysconfdir}/%{short_name}/sample_scripts/aws_rtb_if_cmd.sh.sample
cp %{buildroot}%{_sysconfdir}/%{short_name}/pcp.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pcp.conf
cp %{buildroot}%{_sysconfdir}/%{short_name}/pgpool.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pgpool.conf
cp %{buildroot}%{_sysconfdir}/%{short_name}/pool_hba.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pool_hba.conf
%{_sysconfdir}/%{short_name}/pcp.conf.sample
%{_sysconfdir}/%{short_name}/pool_hba.conf.sample
%defattr(755,postgres,postgres,-)
-%{_sysconfdir}/%{short_name}/scripts/failover.sh.sample
-%{_sysconfdir}/%{short_name}/scripts/follow_primary.sh.sample
-%{_sysconfdir}/%{short_name}/scripts/pgpool_remote_start.sample
-%{_sysconfdir}/%{short_name}/scripts/recovery_1st_stage.sample
-%{_sysconfdir}/%{short_name}/scripts/replication_mode_recovery_1st_stage.sample
-%{_sysconfdir}/%{short_name}/scripts/replication_mode_recovery_2nd_stage.sample
-%{_sysconfdir}/%{short_name}/scripts/escalation.sh.sample
-%{_sysconfdir}/%{short_name}/scripts/aws_eip_if_cmd.sh.sample
-%{_sysconfdir}/%{short_name}/scripts/aws_rtb_if_cmd.sh.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/failover.sh.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/follow_primary.sh.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/pgpool_remote_start.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/recovery_1st_stage.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_1st_stage.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/replication_mode_recovery_2nd_stage.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/escalation.sh.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/aws_eip_if_cmd.sh.sample
+%{_sysconfdir}/%{short_name}/sample_scripts/aws_rtb_if_cmd.sh.sample
%attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf
%attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/pool_passwd
%attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/pgpool_node_id