pgpool2.git / summary / log / commit / refs

commit    30d5efb83f5c5bf9c62ccd6523747c542ecc213f
Author:   Bo Peng <pengbo@sraoss.co.jp>
Date:     Thu Oct 10 07:36:43 2019 +0000

    Doc: Update document "8.3. Pgpool-II + Watchdog Setup Example".


doc.ja/src/sgml/example-cluster.sgml | 30 +++++++++++++++--------------- doc/src/sgml/example-cluster.sgml | 31 ++++++++++++++++--------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/doc.ja/src/sgml/example-cluster.sgml b/doc.ja/src/sgml/example-cluster.sgml index 84dc68e3f..cdc70b557 100644 --- a/doc.ja/src/sgml/example-cluster.sgml +++ b/doc.ja/src/sgml/example-cluster.sgml @@ -150,8 +150,8 @@ </row> <row> <entry>Pgpool-II起動ユーザ</entry> - <entry>root</entry> - <entry>通常のユーザで<productname>Pgpool-II</productname>を起動する場合の設定方法は<xref linkend="TUTORIAL-WATCHDOG-START-STOP">をご参照ください。</entry> + <entry>postgres (Pgpool-II 4.1以降)</entry> + <entry>Pgpool-II 4.0 及び 4.0 以前のバージョンでは、デフォルトではrootでPgpool-IIを起動する</entry> </row> <row> <entry>Pgpool-II動作モード</entry> @@ -376,7 +376,7 @@ RPMからインストールした場合、すべての<productname>Pgpool-II</productname>の設定ファイルは<filename>/etc/pgpool-II</filename>にあります。今回はストリーミングレプリケーションモードのテンプレートとして<filename>pgpool.conf.sample-stream</filename>サンプルファイルを使用します。 </para> <programlisting> - [全サーバ]# cp /etc/pgpool-II/pgpool.conf.sample-stream /etc/pgpool-II/pgpool.conf + [全サーバ]# cp -p /etc/pgpool-II/pgpool.conf.sample-stream /etc/pgpool-II/pgpool.conf </programlisting> <para> <productname>Pgpool-II</productname>が全てのIPアドレスから接続を受け付けるように、<xref linkend="GUC-LISTEN-ADDRESSES">パラメータに<literal>'*'</literal>を設定します。 @@ -981,25 +981,25 @@ exit 0 <para> 仮想IPの起動/停止、ARPリクエストの送信を行う設定パラメータ<xref linkend="GUC-IF-UP-CMD">、<xref linkend="GUC-IF-DOWN-CMD">、<xref linkend="GUC-ARPING-CMD">に、ネットワーク環境に合わせてネットワークインターフェース名を設定します。 - 今回の例で使ったネットワークインターフェースは「enp0s8」となっています。 + 今回の例で使ったネットワークインターフェースは「enp0s8」となっています。 + <varname>if_up/down_cmd</varname>や<varname>arping_cmd</varname>を実行するにはroot権限が必要となりますので、 + 一般ユーザが実行できるように<command>ip/arping</command>コマンドに<literal>setuid</literal>を設定するか、 + <productname>Pgpool-II</productname>起動ユーザ、デフォルトでは<literal>postgres</literal>ユーザ (<productname>Pgpool-II</productname> 4.1以降) がパスワードなしに<command>sudo</command>を実行できるように設定する必要があります。 + ここでは、<command>sudo</command>を介して実行するように設定します。RPMからインストールした場合、<literal>postgres</literal>ユーザがパスワードなしに<command>sudo</command>を介して<command>ip/arping</command>を実行できるように設定済みです。 </para> <programlisting> - if_up_cmd = 'ip addr add $_IP_$/24 dev enp0s8 label enp0s8:0' - # startup delegate IP command - if_down_cmd = 'ip addr del $_IP_$/24 dev enp0s8' - # shutdown delegate IP command - arping_cmd = 'arping -U $_IP_$ -w 1 -I enp0s8' - # arping command +if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev enp0s8 label enp0s8:0' +if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev enp0s8' +arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I enp0s8' </programlisting> <para> - ipコマンドやarpingコマンドのパスがデフォルトのパスと異なる場合、環境に合わせて<xref linkend="GUC-IF-CMD-PATH">や<xref linkend="GUC-ARPING-PATH">を設定しておいてください。 + ipコマンドやarpingコマンドのパスがデフォルトのパスと異なる場合、環境に合わせて<xref linkend="GUC-IF-CMD-PATH">や<xref linkend="GUC-ARPING-PATH">を設定しておいてください。 + ただし、 <varname>if_up/down_cmd</varname>及び<varname>arping_cmd</varname>に指定したコマンドが"/"で始まる場合、 フルパスとみなし<varname>if_cmd_path</varname>及び<varname>arping_path</varname>の設定を無視します。 </para> <programlisting> - if_cmd_path = '/sbin' - # path to the directory where if_up/down_cmd exists - arping_path = '/usr/sbin' - # arping command path +if_cmd_path = '/sbin' +arping_path = '/usr/sbin' </programlisting> <para> 各watchdog が稼働するサーバ情報を設定しておきます。 diff --git a/doc/src/sgml/example-cluster.sgml b/doc/src/sgml/example-cluster.sgml index de945ec6d..329c68ef8 100644 --- a/doc/src/sgml/example-cluster.sgml +++ b/doc/src/sgml/example-cluster.sgml @@ -153,8 +153,8 @@ </row> <row> <entry>Pgpool-II start user</entry> - <entry>root</entry> - <entry>See <xref linkend="TUTORIAL-WATCHDOG-START-STOP"> to startup Pgpool-II with non-root user</entry> + <entry>postgres (Pgpool-II 4.1 or later)</entry> + <entry>Pgpool-II 4.0 or before, the default startup user is root</entry> </row> <row> <entry>Running mode</entry> @@ -393,7 +393,7 @@ In this example, we copy the sample configuration file for streaming replicaton mode. </para> <programlisting> - # cp /etc/pgpool-II/pgpool.conf.sample-stream /etc/pgpool-II/pgpool.conf + # cp -p /etc/pgpool-II/pgpool.conf.sample-stream /etc/pgpool-II/pgpool.conf </programlisting> <para> To allow Pgpool-II to accept all incoming connections, we set <varname>listen_addresses = '*'</varname>. @@ -1029,25 +1029,26 @@ exit 0 <para> To bring up/down the virtual IP and send the ARP requests, we set <xref linkend="GUC-IF-UP-CMD">, <xref linkend="GUC-IF-DOWN-CMD"> and <xref linkend="GUC-ARPING-CMD">. - The network interface used in this example is "enp0s8". + The network interface used in this example is "enp0s8". + Since root privilege is required to execute <varname>if_up/down_cmd</varname> or + <varname>arping_cmd</varname> command, use setuid on these command or allow + <productname>Pgpool-II</productname> startup user, <literal>postgres</literal> user (Pgpool-II 4.1 or later) to run <command>sudo</command> command without a password. + If installed from RPM, the <literal>postgres</literal> user has been configured to run + <command>ip/arping</command> via <command>sudo</command> without a password. </para> <programlisting> - if_up_cmd = 'ip addr add $_IP_$/24 dev enp0s8 label enp0s8:0' - # startup delegate IP command - if_down_cmd = 'ip addr del $_IP_$/24 dev enp0s8' - # shutdown delegate IP command - arping_cmd = 'arping -U $_IP_$ -w 1 -I enp0s8' - # arping command +if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev enp0s8 label enp0s8:0' +if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev enp0s8' +arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I enp0s8' </programlisting> <para> Set <xref linkend="GUC-IF-CMD-PATH"> and <xref linkend="GUC-ARPING-PATH"> according to the - command path. + command path. + If <varname>if_up/down_cmd</varname> or <varname>arping_cmd</varname> starts with "/", these parameters will be ignored. </para> <programlisting> - if_cmd_path = '/sbin' - # path to the directory where if_up/down_cmd exists - arping_path = '/usr/sbin' - # arping command path +if_cmd_path = '/sbin' +arping_path = '/usr/sbin' </programlisting> <para> Specify the hostname and port number of each <productname>Pgpool-II</productname> server. [parent: 60da2166e514]