Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
Keepalivedのソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
Keepalived
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:ネットワーク]] [[en:Keepalived]] [https://www.keepalived.org/ Keepalived] は、Virtual Router Redundancy Protocol(VRRP)を使用して高可用性機能とロードバランシングを提供する、Linux 仮想サーバー(LVS)クラスター用のフェイルオーバーおよび監視デーモンです。 == インストール == {{pkg|keepalived}} パッケージを [[インストール]] してください。 {{ic|keepalived.service}} を [[有効化]] してください。 == 設定 == このサービスは {{ic|/etc/keepalived/keepalived.conf}} で設定されます。 === マスターとバックアップのフェイルオーバー設定 === 以下は、仮想 IP アドレスを共有する 2 つのサーバー/ルーターで高可用性クラスターを設定する基本的な設定を提供します。両方とも keepalived を実行している必要があります。 ホスト A で: {{hc|/etc/keepalived/keepalived.conf|<nowiki> vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 101 priority 20 advert_int 1 authentication { auth_type PASS auth_pass pass1234 } virtual_ipaddress { 172.16.0.100 } } </nowiki>}} ホスト B で: {{hc|/etc/keepalived/keepalived.conf|<nowiki> vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 101 priority 15 advert_int 1 authentication { auth_type PASS auth_pass pass1234 } virtual_ipaddress { 172.16.0.100 } } </nowiki>}} この state は、サービスが開始され、マスターの役割を引き継ぐ最も高い優先度を持つホストを決定する前に、ホストの初期役割を設定します。この設定により、より高い優先度を持つホスト A が VIP(仮想 IP アドレス)を管理し、ホスト A が応答しなくなった場合にのみ、ホスト B が VIP を引き継ぎます。デフォルトの切り替えまでの時間は 1 秒です。 === モニタリング付きのフェイルオーバーセットアップ === 以下は、keepalived と同じホストで動作するサービス(sshd)のフェイルオーバークラスターを提供します。 ホスト A で: {{hc|/etc/keepalived/keepalived.conf|<nowiki> global_defs { notification_email { admin@example.net } notification_email_from lb1@example.net smtp_server mail.example.net smtp_connect_timeout 30 } # enter failed state when the sshd process is down vrrp_track_process track_sshd { process sshd delay 1 } vrrp_instance VI_1 { state BACKUP nopreempt interface eth0 virtual_router_id 101 priority 20 advert_int 1 authentication { auth_type AH auth_pass key12345 } virtual_ipaddress { 172.16.0.100 } track_process { track_sshd } smtp_alert } </nowiki>}} ホスト B で: {{hc|/etc/keepalived/keepalived.conf|<nowiki> global_defs { notification_email { admin@example.net } notification_email_from lb2@example.net smtp_server mail.example.net smtp_connect_timeout 30 } # enter failed state when the sshd process is down vrrp_track_process track_sshd { process sshd delay 1 } vrrp_instance VI_1 { state BACKUP nopreempt interface eth0 virtual_router_id 101 priority 15 advert_int 1 authentication { auth_type AH auth_pass key12345 } virtual_ipaddress { 172.16.0.100 } track_process { track_sshd } smtp_alert } </nowiki>}} このセットアップは、フェイルオーバーホスト自体で動作する sshd サービスに対して、より動的なクラスターを提供します。両方のサーバーはバックアップ状態で開始し、nopreempt オプションにより、優先度が高いサーバーが障害後に戻ってきた場合でも、優先度が低いサーバーがマスターの役割を保持することができます。これにより、以前のマスターサーバーが再び動作を開始した際に VIP への接続が中断されるのを防ぎます。この設定には、ターゲットサービスがクラッシュした場合にサーバーの優先度を下げるプロセスの追跡も含まれています。 === Failover with load-balancing === Keepalived also provides load balancing with a number of possible algorithms (see {{man|5|keepalived.conf}}). This would be a simple example for HTTP load balancing that can be added to the above configuration: {{hc|/etc/keepalived/keepalived.conf|<nowiki> virtual_server 172.16.0.100 80 { delay_loop 6 lb_algo rr lb_kind NAT protocol TCP real_server 172.16.1.20 80 { TCP_CHECK { connect_timeout 10 } } real_server 172.16.1.21 80 { TCP_CHECK { connect_timeout 10 } } real_server 172.16.1.22 80 { TCP_CHECK { connect_timeout 10 } } real_server 172.16.1.23 80 { TCP_CHECK { connect_timeout 10 } } } </nowiki>}} Alternatively, keepalived can also be used for failover with [[HAproxy]] acting as the loadbalancer. == Security considerations == The VRRP protocol used by keepalived does not provide significant security against attackers who are already on the same subnet. The main benefit of using authentication in this service is to protect against accidentally adding servers that disrupt an existing cluster. When using {{ic|auth_type PASS}}, the password is sent in plaintext over the local subnet with every multicast packet. Using {{ic|auth_type AH}} (IP Authentication Header) will provide slightly better resilience against attacks but basic disruption and attacks such as ARP spoofing are still possible. Use network restrictions to protect the VRRP traffic if security is a high priority for you, e.g. use an isolated subnet for the cluster and block VRRP traffic from other networks in your firewall. == See also == * [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/load_balancer_administration/index Load Balancer Administration] * [https://louwrentius.com/configuring-attacking-and-securing-vrrp-on-linux.html Configuring, Attacking and Securing VRRP on Linux]
このページで使用されているテンプレート:
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:Man
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
Keepalived
に戻る。
検索
検索
Keepalivedのソースを表示
話題を追加