Show Table of Contents
A.3. keepalived のインストールおよび設定
以下の手順を 2 つの HAProxy ノードで実行します。
- keepalived をインストールします。
#
yum install -y keepalived - keepalived を設定します。
#
vim /etc/keepalived/keepalived.conf以下の設定には、HAProxy のプロセスをチェックするスクリプトがあります。インスタンスはeth0をネットワークインターフェースとして使用し、haproxyをマスターサーバー、haproxy2をバックアップサーバーとして設定します。また、インスタンスは仮想 IP アドレス 192.168.0.100 を割り当てます。vrrp_script chk_haproxy { script "killall -0 haproxy" # check the haproxy process interval 2 # every 2 seconds weight 2 # add 2 points if OK } vrrp_instance VI_1 { interface eth0 # interface to monitor state MASTER # MASTER on haproxy, BACKUP on haproxy2 virtual_router_id 51 priority 101 # 101 on haproxy, 100 on haproxy2 virtual_ipaddress { 192.168.0.100 # virtual ip address } track_script { chk_haproxy } } - keepalived を有効化し、開始します。
#
systemctl enable keepalived#systemctl start keepalived

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.