From: Bo Peng Date: Thu, 10 Oct 2019 07:36:43 +0000 (+0900) Subject: Doc: Update document "8.3. Pgpool-II + Watchdog Setup Example". X-Git-Tag: V4_2_0_ALPHA1~260 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=30d5efb83f5c5bf9c62ccd6523747c542ecc213f;p=pgpool2.git Doc: Update document "8.3. Pgpool-II + Watchdog Setup Example". --- 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 @@ Pgpool-II起動ユーザ - root - 通常のユーザでPgpool-IIを起動する場合の設定方法はをご参照ください。 + postgres (Pgpool-II 4.1以降) + Pgpool-II 4.0 及び 4.0 以前のバージョンでは、デフォルトではrootでPgpool-IIを起動する Pgpool-II動作モード @@ -376,7 +376,7 @@ RPMからインストールした場合、すべてのPgpool-IIの設定ファイルは/etc/pgpool-IIにあります。今回はストリーミングレプリケーションモードのテンプレートとしてpgpool.conf.sample-streamサンプルファイルを使用します。 - [全サーバ]# 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 Pgpool-IIが全てのIPアドレスから接続を受け付けるように、パラメータに'*'を設定します。 @@ -981,25 +981,25 @@ exit 0 仮想IPの起動/停止、ARPリクエストの送信を行う設定パラメータ、、に、ネットワーク環境に合わせてネットワークインターフェース名を設定します。 - 今回の例で使ったネットワークインターフェースは「enp0s8」となっています。 + 今回の例で使ったネットワークインターフェースは「enp0s8」となっています。 + if_up/down_cmdやarping_cmdを実行するにはroot権限が必要となりますので、 + 一般ユーザが実行できるようにip/arpingコマンドにsetuidを設定するか、 + Pgpool-II起動ユーザ、デフォルトではpostgresユーザ (Pgpool-II 4.1以降) がパスワードなしにsudoを実行できるように設定する必要があります。 + ここでは、sudoを介して実行するように設定します。RPMからインストールした場合、postgresユーザがパスワードなしにsudoを介してip/arpingを実行できるように設定済みです。 - 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' - ipコマンドやarpingコマンドのパスがデフォルトのパスと異なる場合、環境に合わせてやを設定しておいてください。 + ipコマンドやarpingコマンドのパスがデフォルトのパスと異なる場合、環境に合わせてやを設定しておいてください。 + ただし、 if_up/down_cmd及びarping_cmdに指定したコマンドが"/"で始まる場合、 フルパスとみなしif_cmd_path及びarping_pathの設定を無視します。 - 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' 各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 @@ Pgpool-II start user - root - See to startup Pgpool-II with non-root user + postgres (Pgpool-II 4.1 or later) + Pgpool-II 4.0 or before, the default startup user is root Running mode @@ -393,7 +393,7 @@ In this example, we copy the sample configuration file for streaming replicaton mode. - # 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 To allow Pgpool-II to accept all incoming connections, we set listen_addresses = '*'. @@ -1029,25 +1029,26 @@ exit 0 To bring up/down the virtual IP and send the ARP requests, we set , and . - 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 if_up/down_cmd or + arping_cmd command, use setuid on these command or allow + Pgpool-II startup user, postgres user (Pgpool-II 4.1 or later) to run sudo command without a password. + If installed from RPM, the postgres user has been configured to run + ip/arping via sudo without a password. - 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' Set and according to the - command path. + command path. + If if_up/down_cmd or arping_cmd starts with "/", these parameters will be ignored. - 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' Specify the hostname and port number of each Pgpool-II server.