この設定例では、3台の<productname>Pgpool-II</productname>を使って<productname>PostgreSQL</productname>(プライマリ1台、スタンバイ2台)を管理し、単一障害点やスプリットブレインの起きない堅牢なクラスタを運用することが可能です。
</para>
<para>
- この設定例では<emphasis><productname>PostgreSQL</productname> 17</emphasis>を使っていますが、
- 各種スクリプトは<productname>PostgreSQL</productname> 10以降での動作確認を行っています。
+ この設定例では<emphasis><productname>PostgreSQL</productname> 18</emphasis>を使っています。
</para>
<sect2 id="example-cluster-requirement">
<title>前提条件</title>
<title>全体構成</title>
<para>
今回は、Linuxサーバを3台用意し、それぞれのホスト名は<literal>server1</literal>、<literal>server2</literal>、<literal>server3</literal>とします。
- 使用するOSはすべて<emphasis>Rocky Linux 9</emphasis>とします。
+ 使用するOSはすべて<emphasis>Rocky Linux 10</emphasis>とします。
それぞれのサーバに<productname>PostgreSQL</productname>と<productname>Pgpool-II</productname>をインストールします。
3台の<productname>PostgreSQL</productname>がストリーミングレプリケーション構成になります。全体構成図は以下の通りです。
</para>
<tbody>
<row>
<entry>PostgreSQLバージョン</entry>
- <entry>17.0</entry>
+ <entry>18.0</entry>
<entry>-</entry>
</row>
<row>
</row>
<row>
<entry>$PGDATA</entry>
- <entry>/var/lib/pgsql/17/data</entry>
+ <entry>/var/lib/pgsql/18/data</entry>
<entry>-</entry>
</row>
<row>
<tbody>
<row>
<entry>Pgpool-IIバージョン</entry>
- <entry>4.6.0</entry>
+ <entry>4.6.1</entry>
<entry>-</entry>
</row>
<row>
<productname>PostgreSQL</productname>のインストールは<productname>PostgreSQL</productname>コミュニティのリポジトリを使います。
</para>
<programlisting>
-[全サーバ]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+[全サーバ]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm
[全サーバ]# dnf -qy module disable postgresql
-[全サーバ]# dnf install -y postgresql17-server
+[全サーバ]# dnf install -y postgresql18-server
</programlisting>
<para>
exclude=pgpool*
+[pgdg18]
+...
+exclude=pgpool*
+
[pgdg17]
...
exclude=pgpool*
[pgdg13]
...
-exclude=pgpool*
-
-[pgdg12]
-...
exclude=pgpool*
</programlisting>
</para>
<programlisting>
-[全サーバ]# dnf install -y https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-9-x86_64/pgpool-II-release-4.6-1.noarch.rpm
-[全サーバ]# dnf install -y --enablerepo=crb pgpool-II-pg17-*
+[全サーバ]# dnf install -y https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-10-x86_64/pgpool-II-release-4.6-1.noarch.rpm
+[全サーバ]# dnf install -y --enablerepo=crb pgpool-II-pg18-*
</programlisting>
</sect2>
<title>firewallの設定</title>
<para>
<productname>Pgpool-II</productname>や<productname>PostgreSQL</productname>に接続する際には、ファイアーウォールによって目的のポートが開けられていなければなりません。
- <systemitem>Rocky Linux 9/RHEL 9</systemitem>の場合、以下のように設定します。
+ <systemitem>Rocky Linux 10/RHEL 10</systemitem>の場合、以下のように設定します。
</para>
<programlisting>
[全サーバ]# firewall-cmd --permanent --zone=public --add-service=postgresql
</para>
<para>
まず、データベースクラスタの初期化を行います。
- <productname>PostgreSQL</productname> 17ではデータベースクラスタのデフォルトの作成先は<filename>/var/lib/pgsql/17/data</filename>で、<literal>postgres</literal>ユーザの設定ファイル<filename>~/.bash_profile</filename>で環境変数<varname>PGDATA</varname>に指定されています。
+ <productname>PostgreSQL</productname> 18ではデータベースクラスタのデフォルトの作成先は<filename>/var/lib/pgsql/18/data</filename>で、<literal>postgres</literal>ユーザの設定ファイル<filename>~/.bash_profile</filename>で環境変数<varname>PGDATA</varname>に指定されています。
必要に応じて変更してください。
</para>
<para>
<command>initdb</command>コマンドを実行して、データベースクラスタの初期化を行います。
- 必要に応じて、<literal>--encoding</literal>や<literal>--locale</literal><ulink url="https://www.postgresql.org/docs/17/app-initdb.html">オプション</ulink>を指定して、データベースのエンコーディングやロケールを設定してください。
+ 必要に応じて、<literal>--encoding</literal>や<literal>--locale</literal><ulink url="https://www.postgresql.org/docs/18/app-initdb.html">オプション</ulink>を指定して、データベースのエンコーディングやロケールを設定してください。
</para>
<programlisting>
[root@server1 ~]# su - postgres
-[postgres@server1 ~]$ /usr/pgsql-17/bin/initdb
+[postgres@server1 ~]$ /usr/pgsql-18/bin/initdb
</programlisting>
<para>
最後に、<literal>server1</literal>で<productname>PostgreSQL</productname>を起動します。
</para>
<programlisting>
-[postgres@server1 ~]$ /usr/pgsql-17/bin/pg_ctl start
+[postgres@server1 ~]$ /usr/pgsql-18/bin/pg_ctl start
</programlisting>
</sect3>
backend_hostname0 = 'server1'
backend_port0 = 5432
backend_weight0 = 1
-backend_data_directory0 = '/var/lib/pgsql/17/data'
+backend_data_directory0 = '/var/lib/pgsql/18/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_hostname1 = 'server2'
backend_port1 = 5432
backend_weight1 = 1
-backend_data_directory1 = '/var/lib/pgsql/17/data'
+backend_data_directory1 = '/var/lib/pgsql/18/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_hostname2 = 'server3'
backend_port2 = 5432
backend_weight2 = 1
-backend_data_directory2 = '/var/lib/pgsql/17/data'
+backend_data_directory2 = '/var/lib/pgsql/18/data'
backend_flag2 = 'ALLOW_TO_FAILOVER'
</programlisting>
<programlisting>
[root@server1 ~]# vi /etc/pgpool-II/failover.sh
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
[root@server1 ~]# vi /etc/pgpool-II/follow_primary.sh
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
</programlisting>
<para>
基本的には<emphasis>PGHOME</emphasis>を環境に合わせて変更すれば、動作します。
</para>
<programlisting>
-[root@server1 ~]# vi /var/lib/pgsql/17/data/recovery_1st_stage
+[root@server1 ~]# vi /var/lib/pgsql/18/data/recovery_1st_stage
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
-[root@server1 ~]# vi /var/lib/pgsql/17/data/pgpool_remote_start
+[root@server1 ~]# vi /var/lib/pgsql/18/data/pgpool_remote_start
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
</programlisting>
<productname>PostgreSQL</productname>プライマリサーバがまだ起動していない場合は、まず次のコマンドを実行して<productname>PostgreSQL</productname>起動します。
</para>
<programlisting>
-[root@server1 ~]# su - postgres -c "/usr/pgsql-17/bin/pg_ctl start"
+[root@server1 ~]# su - postgres -c "/usr/pgsql-18/bin/pg_ctl start"
</programlisting>
<para>
<literal>server1</literal>、<literal>server2</literal>および<literal>server3</literal>で以下のコマンドを実行し、<productname>Pgpool-II</productname>を起動します。
フェイルオーバするかどうか確認してみます。
</para>
<programlisting>
-[root@server1 ~]# su - postgres -c "/usr/pgsql-17/bin/pg_ctl -m immediate stop"
+[root@server1 ~]# su - postgres -c "/usr/pgsql-18/bin/pg_ctl -m immediate stop"
</programlisting>
<para>
<literal>ノード1</literal>を停止した後に、フェイルオーバが発生し、<literal>server2</literal>が
レプリケーションを行う点はネイティブレプリケーションモードと同じです。
</para>
<para>
- この設定例では<productname>PostgreSQL</productname> 15を使っていますが、
- 各種スクリプトは<productname>PostgreSQL</productname> 10以降での動作確認を行っています。
+ この設定例では<productname>PostgreSQL</productname> 18を使っています。
</para>
<sect2 id="example-replication-mode-structure">
この設定例では、Pgpool-II 1台、PostgreSQL 3台を用いて、Pgpool-IIのレプリケーション機能を説明します。
</para>
<para>
- 物理サーバを3台用意し、それぞれのホスト名は 「server1」、「server2」、「server3」 とします。使用するOSはすべてCentOS 7.9とします。
+ 物理サーバを3台用意し、それぞれのホスト名は 「server1」、「server2」、「server3」 とします。使用するOSはすべてRocky Linux 10とします。
それぞれのサーバにPostgreSQLをインストールし、その中の1台にPgpool-IIをインストールします。
</para>
<para>
<tbody>
<row>
<entry>PostgreSQLバージョン</entry>
- <entry>15.0</entry>
+ <entry>18.0</entry>
<entry>-</entry>
</row>
<row>
</row>
<row>
<entry>$PGDATA</entry>
- <entry>/var/lib/pgsql/15/data</entry>
+ <entry>/var/lib/pgsql/18/data</entry>
<entry>-</entry>
</row>
<row>
<tbody>
<row>
<entry>Pgpool-IIバージョン</entry>
- <entry>4.3.0</entry>
+ <entry>4.6.1</entry>
<entry>-</entry>
</row>
<row>
<productname>PostgreSQL</productname>のインストールは<productname>PostgreSQL</productname>コミュニティのリポジトリを使います。
</para>
<programlisting>
-[全サーバ]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
-[全サーバ]# yum install -y postgresql15-server
+[全サーバ]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+[全サーバ]# yum install -y postgresql18-server
</programlisting>
<para>
exclude=pgpool*
-[pgdg15]
+[pgdg18]
...
exclude=pgpool*
-[pgdg14]
+[pgdg17]
...
exclude=pgpool*
-[pgdg13]
+[pgdg16]
...
exclude=pgpool*
-[pgdg12]
+[pgdg15]
...
exclude=pgpool*
-[pgdg11]
+[pgdg14]
...
exclude=pgpool*
-[pgdg10]
+[pgdg13]
...
exclude=pgpool*
</programlisting>
<productname>Pgpool-II</productname>をインストールします。
</para>
<programlisting>
-[全サーバ]# yum install -y https://www.pgpool.net/yum/rpms/4.4/redhat/rhel-7-x86_64/pgpool-II-release-4.4-1.noarch.rpm
-[全サーバ]# yum install -y pgpool-II-pg15-*
+[全サーバ]# yum install -y https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-10-x86_64/pgpool-II-release-4.6-1.noarch.rpm
+[全サーバ]# yum install -y pgpool-II-pg18-*
</programlisting>
</sect2>
<para>
<productname>Pgpool-II</productname>や<productname>PostgreSQL</productname>に接続する際には、
ファイアーウォールによって目的のポートが開けられていなければなりません。
- <systemitem>CentOS/RHEL7</systemitem>の場合、以下のように設定します。
+ <systemitem>Rocky Linux 10/RHEL 10</systemitem>の場合、以下のように設定します。
</para>
<programlisting>
[全サーバ]# firewall-cmd --permanent --zone=public --add-service=postgresql
</para>
<programlisting>
[server1]# su - postgres
-[server1]$ /usr/pgsql-15/bin/initdb -E UTF8 --no-locale
+[server1]$ /usr/pgsql-18/bin/initdb -E UTF8 --no-locale
</programlisting>
<para>
次に<literal>server1</literal>にて、設定ファイル<filename>$PGDATA/postgresql.conf</filename>を以下のように編集します。
server1で以下のコマンドを実行し、PostgreSQLを起動します。
</para>
<programlisting>
-[server1]$ /usr/pgsql-15/bin/pg_ctl start
+[server1]$ /usr/pgsql-18/bin/pg_ctl start
</programlisting>
<para>
backend_hostname0 = 'server1'
backend_port0 = 5432
backend_weight0 = 1
-backend_data_directory0 = '/var/lib/pgsql/15/data'
+backend_data_directory0 = '/var/lib/pgsql/18/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_hostname1 = 'server2'
backend_port1 = 5432
backend_weight1 = 1
-backend_data_directory1 = '/var/lib/pgsql/15/data'
+backend_data_directory1 = '/var/lib/pgsql/18/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_hostname2 = 'server3'
backend_port2 = 5432
backend_weight2 = 1
-backend_data_directory2 = '/var/lib/pgsql/15/data'
+backend_data_directory2 = '/var/lib/pgsql/18/data'
backend_flag2 = 'ALLOW_TO_FAILOVER'
</programlisting>
</sect3>
これらのファイルをmainノード(<literal>server1</literal>)のデータベースクラスタ配下に配置します。
</para>
<programlisting>
-[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_1st_stage.sample /var/lib/pgsql/15/data/recovery_1st_stage.sh
-[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_2nd_stage.sample /var/lib/pgsql/15/data/recovery_2nd_stage.sh
-[server1]# cp -p /etc/pgpool-II/sample_scripts/pgpool_remote_start.sample /var/lib/pgsql/15/data/pgpool_remote_start
-[server1]# chown postgres:postgres /var/lib/pgsql/15/data/{recovery_1st_stage.sh,recovery_2nd_stage.sh,pgpool_remote_start}
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_1st_stage.sample /var/lib/pgsql/18/data/recovery_1st_stage.sh
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_2nd_stage.sample /var/lib/pgsql/18/data/recovery_2nd_stage.sh
+[server1]# cp -p /etc/pgpool-II/sample_scripts/pgpool_remote_start.sample /var/lib/pgsql/18/data/pgpool_remote_start
+[server1]# chown postgres:postgres /var/lib/pgsql/18/data/{recovery_1st_stage.sh,recovery_2nd_stage.sh,pgpool_remote_start}
</programlisting>
<para>
基本的には<emphasis>PGHOME</emphasis>を環境に合わせて変更すれば、動作します。
</para>
<programlisting>
-[server1]# vi /var/lib/pgsql/15/data/recovery_1st_stage.sh
+[server1]# vi /var/lib/pgsql/18/data/recovery_1st_stage.sh
...
-PGHOME=/usr/pgsql-15
+PGHOME=/usr/pgsql-18
...
-[server1]# vi /var/lib/pgsql/15/data/recovery_2nd_stage.sh
+[server1]# vi /var/lib/pgsql/18/data/recovery_2nd_stage.sh
...
-PGHOME=/usr/pgsql-15
+PGHOME=/usr/pgsql-18
...
-[server1]# vi /var/lib/pgsql/15/data/pgpool_remote_start
+[server1]# vi /var/lib/pgsql/18/data/pgpool_remote_start
...
-PGHOME=/usr/pgsql-15
+PGHOME=/usr/pgsql-18
...
</programlisting>
pgbenchを使って、レプリケーション機能を試してみましょう。
</para>
<programlisting>
-[server1]# /usr/pgsql-15/bin/createdb test -U postgres -p 9999
-[server1]# /usr/pgsql-15/bin/pgbench -h server1 -U postgres -i -p 9999 test
+[server1]# /usr/pgsql-18/bin/createdb test -U postgres -p 9999
+[server1]# /usr/pgsql-18/bin/pgbench -h server1 -U postgres -i -p 9999 test
</programlisting>
<para>
<productname>Pgpool-II</productname>のレプリケーション機能が正しく動いているかどうか確かめるために、
それぞれのノードに接続して、同じ結果を返すかどうか見てみます。
</para>
<programlisting>
-[server1]# /usr/pgsql-15/bin/psql -h server1 -U postgres -p 5432 test
+[server1]# /usr/pgsql-18/bin/psql -h server1 -U postgres -p 5432 test
test=# \d
List of relations
Schema | Name | Type | Owner
public | pgbench_tellers | table | postgres
(4 rows)
-[server1]# /usr/pgsql-15/bin/psql -h server2 -U postgres -p 5432 test
+[server1]# /usr/pgsql-18/bin/psql -h server2 -U postgres -p 5432 test
test=# \d
List of relations
Schema | Name | Type | Owner
public | pgbench_tellers | table | postgres
(4 rows)
-[server1]# /usr/pgsql-15/bin/psql -h server3 -U postgres -p 5432 test
+[server1]# /usr/pgsql-18/bin/psql -h server3 -U postgres -p 5432 test
test=# \d
List of relations
Schema | Name | Type | Owner
次に、pgbenchをしばらく走らせて、結果を見てみます。
</para>
<programlisting>
-[server1]# /usr/pgsql-15/bin/pgbench -h server1 -U postgres -p 9999 -T 10 test
+[server1]# /usr/pgsql-18/bin/pgbench -h server1 -U postgres -p 9999 -T 10 test
</programlisting>
<para>
すべてのPostgreSQLは、同一の結果を返しています。
</para>
<programlisting>
-[server1]# /usr/pgsql-15/bin/psql -h server1 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
+[server1]# /usr/pgsql-18/bin/psql -h server1 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
Password for user postgres:
sum
--------
-99710
(1 row)
-[server1]# /usr/pgsql-15/bin/psql -h server2 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
+[server1]# /usr/pgsql-18/bin/psql -h server2 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
Password for user postgres:
sum
--------
-99710
(1 row)
-[server1]# /usr/pgsql-15/bin/psql -h server3 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
+[server1]# /usr/pgsql-18/bin/psql -h server3 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
Password for user postgres:
sum
--------
mainノードの切り替えを確認してみます。
</para>
<programlisting>
-[server1]# su - postgres -c "/usr/pgsql-15/bin/pg_ctl -m i stop"
+[server1]# su - postgres -c "/usr/pgsql-18/bin/pg_ctl -m i stop"
</programlisting>
<para>
<literal>ノード0</literal>を停止した後に、ノード0が切り離されて、mainノードの切り替えが発生することを確認します。
</para>
<para>
<!--
- <productname>Pgpool-II</productname> community provides RPM packages for RHEL9/8/7
+ <productname>Pgpool-II</productname> community provides RPM packages for RHEL10/9/8
and the operating system which is compatible with RHEL.
You can download package files from
<ulink url="https://www.pgpool.net/yum/">official Pgpool-II repository</ulink>.
-->
- <productname>Pgpool-II</productname>コミュニティはRHEL9/8/7および互換OS向けにRPMパッケージを提供しています。
+ <productname>Pgpool-II</productname>コミュニティはRHEL10/9/8および互換OS向けにRPMパッケージを提供しています。
パッケージファイルは<ulink url="https://www.pgpool.net/yum/">Pgpool-IIの公式リポジトリ</ulink>から入手できます。
</para>
<para>
</row>
<row>
<entry>pgpool-II-pgXX-debugsource</entry>
- <entry>RHEL8/9の場合のみ。デバッグ情報が含まれる</entry>
+ <entry>RHEL10/9/8の場合のみ。デバッグ情報が含まれる</entry>
</row>
<row>
<entry>pgpool-II-pgXX-extensions-debuginfo</entry>
- <entry>RHEL8/9の場合のみ。デバッグ情報が含まれる</entry>
+ <entry>RHEL10/9/8の場合のみ。デバッグ情報が含まれる</entry>
</row>
<row>
<entry>pgpool-II-pgXX-devel</entry>
<productname>Pgpool-II</productname> provides separate packages for each PostgreSQL version.
"XX" in the above package is a two-digit number representing the version of PostgreSQL.
Choose <productname>Pgpool-II</productname> RPM corresponding to your PostgreSQL version.
- (For example, if you are using PostgreSQL 17, you need to install <filename>pgpool-II-pg17</filename>)
+ (For example, if you are using PostgreSQL 18, you need to install <filename>pgpool-II-pg18</filename>)
-->
<productname>Pgpool-II</productname>は<productname>PostgreSQL</productname>のライブラリと拡張のディレクトリが必要です。
そのディレクトリへのパスは<productname>PostgreSQL</productname>のバージョンごとに異なっているので、<productname>Pgpool-II</productname>はPostgreSQLバージョンごとにパッケージを提供しています。
- 上記パッケージの「XX」はPostgreSQLのバージョンを表す2桁の数値です。<productname>PostgreSQL</productname>バージョンに対応する<productname>Pgpool-II</productname>のRPMを選んでください。(例えば、PostgreSQL 17を利用している場合は、<filename>pgpool-II-pg17</filename>を使用してください)
+ 上記パッケージの「XX」はPostgreSQLのバージョンを表す2桁の数値です。<productname>PostgreSQL</productname>バージョンに対応する<productname>Pgpool-II</productname>のRPMを選んでください。(例えば、PostgreSQL 18を利用している場合は、<filename>pgpool-II-pg18</filename>を使用してください)
</para>
<sect2 id="before-installing">
exclude=pgpool*
+[pgdg18]
+...
+exclude=pgpool*
+
[pgdg17]
...
exclude=pgpool*
[pgdg13]
...
-exclude=pgpool*
-
-[pgdg12]
-...
-exclude=pgpool*
-
-[pgdg11]
-...
exclude=pgpool*
</programlisting>
</sect2>
</para>
<para>
<!--
- The following commands assume that you are using Pgpool-II 4.6.x for PostgreSQL 17 on RHEL9.
+ The following commands assume that you are using Pgpool-II 4.6.x for PostgreSQL 18 on RHEL10.
If you are using other versions, replace "pgXX" with your PostgreSQL version.
-->
- 以下の手順はRHEL9に<productname>PostgreSQL 17</productname>に対応した<productname>Pgpool-II 4.6.x</productname>をインストールすることが前提となります。
+ 以下の手順はRHEL10に<productname>PostgreSQL 18</productname>に対応した<productname>Pgpool-II 4.6.x</productname>をインストールすることが前提となります。
他のバージョンの<productname>PostgreSQL</productname>を利用している場合は、<productname>PostgreSQL</productname>のバージョンに応じて「pgXX」を適宜置き換えてください。
</para>
<para>
<!--
First, install the repository corresponding to your <productname>Pgpool-II</productname>
version and distribution.
- For REHL7/9, see <ulink url="https://www.pgpool.net/mediawiki/index.php/Yum_Repository">here</ulink>.
+ For REHL9/8, see <ulink url="https://www.pgpool.net/mediawiki/index.php/Yum_Repository">here</ulink>.
-->
まず、Pgpool-IIバージョンとディストリビューションに対応するレポジトリをインストールします。
- REHL7/8の場合は、<ulink url="https://www.pgpool.net/mediawiki/index.php/Yum_Repository">こちら</ulink>を参照してください。
+ REHL9/8の場合は、<ulink url="https://www.pgpool.net/mediawiki/index.php/Yum_Repository">こちら</ulink>を参照してください。
</para>
<programlisting>
-dnf install https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-9-x86_64/pgpool-II-release-4.6-1.noarch.rpm
+dnf install https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-10-x86_64/pgpool-II-release-4.6-1.noarch.rpm
</programlisting>
<para>
<!--
次に、<productname>Pgpool-II</productname>をインストールします。
</para>
<programlisting>
-dnf install pgpool-II-pg17
+dnf install pgpool-II-pg18
</programlisting>
<para>
<!--
</para>
</note>
<programlisting>
-dnf install pgpool-II-pg17-extensions pgpool-II-pg17
+dnf install pgpool-II-pg18-extensions pgpool-II-pg18
</programlisting>
<para>
<!--
必要に応じて、開発者向けのオプションパッケージdebuginfoおよびdevelパッケージをインストールします。
</para>
<programlisting>
-dnf install pgpool-II-pg17-debuginfo pgpool-II-pg17-devel
+dnf install pgpool-II-pg18-debuginfo pgpool-II-pg18-devel
</programlisting>
</sect2>
<title>Pgpool-IIの起動と停止</title>
<para>
<!--
- On RHEL7,8/CentOS7,8, do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
+ On RHEL10/9/8, do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
-->
- RHEL7/8/9では、<productname>Pgpool-II</productname>の自動起動を設定する場合、以下を実行してください。
+ RHEL10/9/8では、<productname>Pgpool-II</productname>の自動起動を設定する場合、以下を実行してください。
<programlisting>
systemctl enable pgpool.service
</programlisting>
</para>
<para>
<!--
- Here is an example for CentOS/RHEL7 when access
+ Here is an example for Rocky Linux/RHEL10 when access
to <productname>PostgreSQL</productname> is required.
-->
- CentOS/RHEL7において、<productname>PostgreSQL</productname>にアクセスが必要な場合の例を示します。
+ Rocky Linux/RHEL10において、<productname>PostgreSQL</productname>にアクセスが必要な場合の例を示します。
<programlisting>
firewall-cmd --permanent --zone=public --add-service=postgresql
firewall-cmd --reload
servers to create a robust cluster system and avoid the single point of failure or split brain.
</para>
<para>
- <emphasis><productname>PostgreSQL</productname> 17</emphasis> is used in this configuration example.
- All scripts have been tested with <productname>PostgreSQL</productname> 10 and later.
+ <emphasis><productname>PostgreSQL</productname> 18</emphasis> is used in this configuration example.
</para>
<sect2 id="example-cluster-requirement">
<title>Requirements</title>
<sect2 id="example-cluster-structure">
<title>Cluster System Configuration</title>
<para>
- We use three servers with <emphasis>Rocky Linux 9</emphasis> installed and
+ We use three servers with <emphasis>Rocky Linux 10</emphasis> installed and
the hostnames of the three servers are <literal>server1</literal>
<literal>server2</literal> and <literal>server3</literal> respectively.
We install <productname>PostgreSQL</productname> and <productname>Pgpool-II</productname> on each server.
<tbody>
<row>
<entry>PostgreSQL Version</entry>
- <entry>17.0</entry>
+ <entry>18.0</entry>
<entry>-</entry>
</row>
<row>
</row>
<row>
<entry>$PGDATA</entry>
- <entry>/var/lib/pgsql/17/data</entry>
+ <entry>/var/lib/pgsql/18/data</entry>
<entry>-</entry>
</row>
<row>
<tbody>
<row>
<entry>Pgpool-II Version</entry>
- <entry>4.6.0</entry>
+ <entry>4.6.1</entry>
<entry>-</entry>
</row>
<row>
Install <productname>PostgreSQL</productname> from <productname>PostgreSQL</productname> YUM repository.
</para>
<programlisting>
-[all servers]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+[all servers]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm
[all servers]# dnf -qy module disable postgresql
-[all servers]# dnf install -y postgresql17-server
+[all servers]# dnf install -y postgresql18-server
</programlisting>
<para>
Since <productname>Pgpool-II</productname> related packages are also included in <productname>PostgreSQL</productname> YUM repository,
...
exclude=pgpool*
+[pgdg18]
+...
+exclude=pgpool*
+
[pgdg17]
...
exclude=pgpool*
[pgdg13]
...
-exclude=pgpool*
-
-[pgdg12]
-...
exclude=pgpool*
</programlisting>
</para>
<programlisting>
[all servers]# dnf install -y https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-9-x86_64/pgpool-II-release-4.6-1.noarch.rpm
-[all servers]# dnf install -y --enablerepo=crb pgpool-II-pg17-*
+[all servers]# dnf install -y --enablerepo=crb pgpool-II-pg18-*
</programlisting>
</sect2>
<sect3 id="example-cluster-before-starting-firewall">
<title>Setting up firewall</title>
<para>
- When connect to <productname>Pgpool-II</productname> and <productname>PostgreSQL</productname> servers, the target port must be accessible by enabling firewall management softwares. Following is an example for <systemitem>Rocky Linux 8/RHEL 8</systemitem>.
+ When connect to <productname>Pgpool-II</productname> and <productname>PostgreSQL</productname> servers, the target port must be accessible by enabling firewall management softwares. Following is an example for <systemitem>Rocky Linux 10/RHEL 10</systemitem>.
</para>
<programlisting>
[all servers]# firewall-cmd --permanent --zone=public --add-service=postgresql
<para>
First, initialize the database cluster.
- In <productname>PostgreSQL</productname> 17, the default directory
- for creating the database cluster is <filename>/var/lib/pgsql/17/data</filename>,
+ In <productname>PostgreSQL</productname> 18, the default directory
+ for creating the database cluster is <filename>/var/lib/pgsql/18/data</filename>,
and this is specified in the environment variable <varname>PGDATA</varname>
in the <filename>~/.bash_profile</filename> of the <literal>postgres</literal>
user. Modify it if you want to change the default path.
</para>
<para>
Run <command>initdb</command> to initialize the database cluster.
- Specify <ulink url="https://www.postgresql.org/docs/17/app-initdb.html">options</ulink>
+ Specify <ulink url="https://www.postgresql.org/docs/18/app-initdb.html">options</ulink>
such as <literal>--encoding</literal> and <literal>--locale</literal>
if you need to configure the database encoding and locale settings.
</para>
<programlisting>
[root@server1 ~]# su - postgres
-[postgres@server1 ~]$ /usr/pgsql-17/bin/initdb
+[postgres@server1 ~]$ /usr/pgsql-18/bin/initdb
</programlisting>
<para>
Start <productname>PostgreSQL</productname> on <literal>server1</literal>.
</para>
<programlisting>
-[postgres@server1 ~]$ /usr/pgsql-17/bin/pg_ctl start
+[postgres@server1 ~]$ /usr/pgsql-18/bin/pg_ctl start
</programlisting>
</sect3>
backend_hostname0 = 'server1'
backend_port0 = 5432
backend_weight0 = 1
-backend_data_directory0 = '/var/lib/pgsql/17/data'
+backend_data_directory0 = '/var/lib/pgsql/18/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_hostname1 = 'server2'
backend_port1 = 5432
backend_weight1 = 1
-backend_data_directory1 = '/var/lib/pgsql/17/data'
+backend_data_directory1 = '/var/lib/pgsql/18/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_hostname2 = 'server3'
backend_port2 = 5432
backend_weight2 = 1
-backend_data_directory2 = '/var/lib/pgsql/17/data'
+backend_data_directory2 = '/var/lib/pgsql/18/data'
backend_flag2 = 'ALLOW_TO_FAILOVER'
</programlisting>
<para>
<programlisting>
[root@server1 ~]# vi /etc/pgpool-II/failover.sh
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
[root@server1 ~]# vi /etc/pgpool-II/follow_primary.sh
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
</programlisting>
Basically, it should work if you change <emphasis>PGHOME</emphasis> according to PostgreSQL installation directory.
</para>
<programlisting>
-[root@server1 ~]# vi /var/lib/pgsql/17/data/recovery_1st_stage
+[root@server1 ~]# vi /var/lib/pgsql/18/data/recovery_1st_stage
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
-[root@server1 ~]# vi /var/lib/pgsql/17/data/pgpool_remote_start
+[root@server1 ~]# vi /var/lib/pgsql/18/data/pgpool_remote_start
...
-PGHOME=/usr/pgsql-17
+PGHOME=/usr/pgsql-18
...
</programlisting>
using the following command.
</para>
<programlisting>
-[root@server1 ~]# su - postgres -c "/usr/pgsql-17/bin/pg_ctl start"
+[root@server1 ~]# su - postgres -c "/usr/pgsql-18/bin/pg_ctl start"
</programlisting>
<para>
Start <productname>Pgpool-II</productname> on <literal>server1</literal>,
automatically.
</para>
<programlisting>
-[root@server1 ~]# su - postgres -c "/usr/pgsql-17/bin/pg_ctl -m immediate stop"
+[root@server1 ~]# su - postgres -c "/usr/pgsql-18/bin/pg_ctl -m immediate stop"
</programlisting>
<para>
After stopping <productname>PostgreSQL</productname> on
the visibility consistency among nodes.
</para>
<para>
- <productname>PostgreSQL</productname> 14 is used in this configuration example.
- All scripts have been tested with <productname>PostgreSQL</productname> 10 and later.
+ <productname>PostgreSQL</productname> 18 is used in this configuration example.
</para>
<sect2 id="example-replication-mode-structure">
replication.
</para>
<para>
- In this example we use 3 servers with CentOS 7.9 installed.
+ In this example we use 3 servers with Rocky Linux 10 installed.
Let these servers be <literal>server1</literal>,
<literal>server2</literal>, <literal>server3</literal>.
We install <productname>PostgreSQL</productname> on all servers and
<tbody>
<row>
<entry>PostgreSQL Version</entry>
- <entry>14.0</entry>
+ <entry>18.0</entry>
<entry>-</entry>
</row>
<row>
</row>
<row>
<entry>$PGDATA</entry>
- <entry>/var/lib/pgsql/14/data</entry>
+ <entry>/var/lib/pgsql/18/data</entry>
<entry>-</entry>
</row>
<row>
Install <productname>PostgreSQL</productname> from <productname>PostgreSQL</productname> YUM repository.
</para>
<programlisting>
-[all servers]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
-[all servers]# yum install -y postgresql14-server
+[all servers]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+[all servers]# yum install -y postgresql18-server
</programlisting>
<para>
...
exclude=pgpool*
-[pgdg14]
+[pgdg18]
...
exclude=pgpool*
-[pgdg13]
+[pgdg17]
...
exclude=pgpool*
-[pgdg12]
+[pgdg16]
...
exclude=pgpool*
-[pgdg11]
+[pgdg15]
...
exclude=pgpool*
-[pgdg10]
+[pgdg14]
...
exclude=pgpool*
-[pgdg96]
+[pgdg13]
+...
+exclude=pgpool*
...
exclude=pgpool*
</programlisting>
Install <productname>Pgpool-II</productname> using Pgpool-II YUM repository.
</para>
<programlisting>
-[all servers]# yum install -y https://www.pgpool.net/yum/rpms/4.4/redhat/rhel-7-x86_64/pgpool-II-release-4.4-1.noarch.rpm
-[all servers]# yum install -y pgpool-II-pg14-*
+[all servers]# yum install -y https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-10-x86_64/pgpool-II-release-4.6-1.noarch.rpm
+[all servers]# yum install -y pgpool-II-pg18-*
</programlisting>
</sect2>
<sect3 id="example-replication-mode-firewall">
<title>Configure firewall</title>
<para>
- When connect to <productname>Pgpool-II</productname> and <productname>PostgreSQL</productname> servers, the target port must be accessible by enabling firewall management softwares. Following is an example for <systemitem>CentOS/RHEL7</systemitem>.
+ When connect to <productname>Pgpool-II</productname> and <productname>PostgreSQL</productname> servers, the target port must be accessible by enabling firewall management softwares. Following is an example for <systemitem>Rocky Linux 10</systemitem>.
</para>
<programlisting>
[all servers]# firewall-cmd --permanent --zone=public --add-service=postgresql
</para>
<programlisting>
[server1]# su - postgres
-[server1]$ /usr/pgsql-14/bin/initdb -E UTF8 --no-locale
+[server1]$ /usr/pgsql-18/bin/initdb -E UTF8 --no-locale
</programlisting>
<para>
Then edit <filename>$PGDATA/postgresql.conf</filename> on server1.
Run the following command to start PostgreSQL server.
</para>
<programlisting>
-[server1]$ /usr/pgsql-14/bin/pg_ctl start
+[server1]$ /usr/pgsql-18/bin/pg_ctl start
</programlisting>
<para>
backend_hostname0 = 'server1'
backend_port0 = 5432
backend_weight0 = 1
-backend_data_directory0 = '/var/lib/pgsql/14/data'
+backend_data_directory0 = '/var/lib/pgsql/18/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_hostname1 = 'server2'
backend_port1 = 5432
backend_weight1 = 1
-backend_data_directory1 = '/var/lib/pgsql/14/data'
+backend_data_directory1 = '/var/lib/pgsql/18/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_hostname2 = 'server3'
backend_port2 = 5432
backend_weight2 = 1
-backend_data_directory2 = '/var/lib/pgsql/14/data'
+backend_data_directory2 = '/var/lib/pgsql/18/data'
backend_flag2 = 'ALLOW_TO_FAILOVER'
</programlisting>
</sect3>
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/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}
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_1st_stage.sample /var/lib/pgsql/18/data/recovery_1st_stage
+[server1]# cp -p /etc/pgpool-II/sample_scripts/replication_mode_recovery_2nd_stage.sample /var/lib/pgsql/18/data/recovery_2nd_stage
+[server1]# cp -p /etc/pgpool-II/sample_scripts/pgpool_remote_start.sample /var/lib/pgsql/18/data/pgpool_remote_start
+[server1]# chown postgres:postgres /var/lib/pgsql/18/data/{recovery_1st_stage,recovery_2nd_stage,pgpool_remote_start}
</programlisting>
<para>
Basically, it should work if you change <emphasis>PGHOME</emphasis> according to PostgreSQL installation directory.
</para>
<programlisting>
-[server1]# vi /var/lib/pgsql/14/data/recovery_1st_stage
+[server1]# vi /var/lib/pgsql/18/data/recovery_1st_stage
...
-PGHOME=/usr/pgsql-14
+PGHOME=/usr/pgsql-18
...
-[server1]# vi /var/lib/pgsql/14/data/recovery_2nd_stage
+[server1]# vi /var/lib/pgsql/18/data/recovery_2nd_stage
...
-PGHOME=/usr/pgsql-14
+PGHOME=/usr/pgsql-18
...
-[server1]# vi /var/lib/pgsql/14/data/pgpool_remote_start
+[server1]# vi /var/lib/pgsql/18/data/pgpool_remote_start
...
-PGHOME=/usr/pgsql-14
+PGHOME=/usr/pgsql-18
...
</programlisting>
Next, let's verify the replication functionality using a benchmark tool pgbench.
</para>
<programlisting>
-[server1]# /usr/pgsql-14/bin/createdb test -U postgres -p 9999
-[server1]# /usr/pgsql-14/bin/pgbench -h server1 -U postgres -i -p 9999 test
+[server1]# /usr/pgsql-18/bin/createdb test -U postgres -p 9999
+[server1]# /usr/pgsql-18/bin/pgbench -h server1 -U postgres -i -p 9999 test
</programlisting>
<para>
To check if the replication works correctly, directly connect to each PostgreSQL
server to see if they return identical results.
</para>
<programlisting>
-[server1]# /usr/pgsql-14/bin/psql -h server1 -U postgres -p 5432 test
+[server1]# /usr/pgsql-18/bin/psql -h server1 -U postgres -p 5432 test
test=# \d
List of relations
Schema | Name | Type | Owner
public | pgbench_tellers | table | postgres
(4 rows)
-[server1]# /usr/pgsql-14/bin/psql -h server2 -U postgres -p 5432 test
+[server1]# /usr/pgsql-18/bin/psql -h server2 -U postgres -p 5432 test
test=# \d
List of relations
Schema | Name | Type | Owner
public | pgbench_tellers | table | postgres
(4 rows)
-[server1]# /usr/pgsql-14/bin/psql -h server3 -U postgres -p 5432 test
+[server1]# /usr/pgsql-18/bin/psql -h server3 -U postgres -p 5432 test
test=# \d
List of relations
Schema | Name | Type | Owner
Next, let's run pgbench for a while and check to results.
</para>
<programlisting>
-[server1]# /usr/pgsql-14/bin/pgbench -h server1 -U postgres -p 9999 -T 10 test
+[server1]# /usr/pgsql-18/bin/pgbench -h server1 -U postgres -p 9999 -T 10 test
</programlisting>
<para>
All PostgreSQL servers return identical results.
</para>
<programlisting>
-[server1]# /usr/pgsql-14/bin/psql -h server1 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
+[server1]# /usr/pgsql-18/bin/psql -h server1 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
Password for user postgres:
sum
--------
-99710
(1 row)
-[server1]# /usr/pgsql-14/bin/psql -h server2 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
+[server1]# /usr/pgsql-18/bin/psql -h server2 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
Password for user postgres:
sum
--------
-99710
(1 row)
-[server1]# /usr/pgsql-14/bin/psql -h server3 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
+[server1]# /usr/pgsql-18/bin/psql -h server3 -U postgres -p 5432 test -c "SELECT sum(abalance) FROM pgbench_accounts"
Password for user postgres:
sum
--------
and verify the switchover of the main node.
</para>
<programlisting>
-[server1]# su - postgres -c "/usr/pgsql-14/bin/pg_ctl -m i stop"
+[server1]# su - postgres -c "/usr/pgsql-18/bin/pg_ctl -m i stop"
</programlisting>
<para>
After stopping <productname>PostgreSQL</productname> on <literal>server1</literal>,
If you are going to install from the source code, please check <xref linkend="install-source">.
</para>
<para>
- <productname>Pgpool-II</productname> community provides RPM packages for RHEL9/8/7
+ <productname>Pgpool-II</productname> community provides RPM packages for RHEL10/9/8
and the operating system which is compatible with RHEL.
You can download package files from
<ulink url="https://www.pgpool.net/yum/">official Pgpool-II repository</ulink>.
</row>
<row>
<entry>pgpool-II-pgXX-debugsource</entry>
- <entry>Only for RHEL8/9. Debug symbols for debugging</entry>
+ <entry>Only for RHEL10/9/8. Debug symbols for debugging</entry>
</row>
<row>
<entry>pgpool-II-pgXX-extensions-debuginfo</entry>
- <entry>Only for RHEL8/9. Debug symbols for debugging</entry>
+ <entry>Only for RHEL10/9/8. Debug symbols for debugging</entry>
</row>
<row>
<entry>pgpool-II-pgXX-devel</entry>
<productname>Pgpool-II</productname> provides separate packages for each PostgreSQL version.
"XX" in the above package is a two-digit number representing the version of PostgreSQL.
Choose <productname>Pgpool-II</productname> RPM corresponding to your PostgreSQL version.
- (For example, if you are using PostgreSQL 17, you need to install <filename>pgpool-II-pg17</filename>)
+ (For example, if you are using PostgreSQL 18, you need to install <filename>pgpool-II-pg18</filename>)
</para>
<sect2 id="before-installing">
...
exclude=pgpool*
+[pgdg18]
+...
+exclude=pgpool*
+
[pgdg17]
...
exclude=pgpool*
[pgdg13]
...
-exclude=pgpool*
-
-[pgdg12]
-...
-exclude=pgpool*
-
-[pgdg11]
-...
exclude=pgpool*
</programlisting>
</sect2>
</para>
<para>
- The following commands assume that you are using Pgpool-II 4.6.x for PostgreSQL 17 on RHEL9.
+ The following commands assume that you are using Pgpool-II 4.6.x for PostgreSQL 18 on RHEL10.
If you are using other versions, replace "pgXX" with your PostgreSQL version.
</para>
<para>
First, install the repository corresponding to your <productname>Pgpool-II</productname>
version and distribution.
- For REHL7/8, see <ulink url="https://www.pgpool.net/mediawiki/index.php/Yum_Repository">here</ulink>.
+ For REHL9/8, see <ulink url="https://www.pgpool.net/mediawiki/index.php/Yum_Repository">here</ulink>.
</para>
<programlisting>
-dnf install https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-9-x86_64/pgpool-II-release-4.6-1.noarch.rpm
+dnf install https://www.pgpool.net/yum/rpms/4.6/redhat/rhel-10-x86_64/pgpool-II-release-4.6-1.noarch.rpm
</programlisting>
<para>
Then, install <productname>Pgpool-II</productname>.
</para>
<programlisting>
-dnf install pgpool-II-pg17
+dnf install pgpool-II-pg18
</programlisting>
<para>
- To use online recovery feature, install <filename>pgpool-II-pg17-extensions</filename>
+ To use online recovery feature, install <filename>pgpool-II-pg18-extensions</filename>
on <emphasis>all PostgreSQL servers</emphasis>.
Because <filename>pgpool-II-pgXX-extensions</filename> depends on
<filename>pgpool-II-pgXX</filename> package,
</para>
</note>
<programlisting>
-dnf install pgpool-II-pg17-extensions pgpool-II-pg17
+dnf install pgpool-II-pg18-extensions pgpool-II-pg18
</programlisting>
<para>
Optionally you can install debuginfo and devel packages for developers if necessary.
</para>
<programlisting>
-dnf install pgpool-II-pg17-debuginfo pgpool-II-pg17-devel
+dnf install pgpool-II-pg18-debuginfo pgpool-II-pg18-devel
</programlisting>
</sect2>
<sect2 id="start-rpm">
<title>Starting/stopping Pgpool-II</title>
<para>
- On RHEL9/8/7, do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
+ On RHEL10/9/8, do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
<programlisting>
systemctl enable pgpool.service
</programlisting>
</para>
<para>
- Here is an example for CentOS/RHEL7 when access
+ Here is an example for Rocky Linux/RHEL10 when access
to <productname>PostgreSQL</productname> is required.
<programlisting>