Show Table of Contents
8.3. 接続状態変更によるリソースの移動
以下の 2 つのステップにしたがって、外部の接続が失われた場合にリソースが移動するようクラスターを設定します。
pingリソースをクラスターに追加します。pingリソースは同じ名前のシステムユーティリティーを使用して、マシン (DNS ホスト名または IPv4/IPv6 アドレスによって指定される) にアクセス可能であるかをテストし、その結果を使用してpingdと呼ばれるノード属性を維持します。- 接続が失われたときに別のノードにリソースを移動させるためのリソース場所制約を設定します。
表6.1「リソースのプロパティー」 では
ping リソースに設定できるプロパティを示します。
表8.1 ping リソースのプロパティ
| フィールド | 説明 |
|---|---|
dampen
| |
multiplier
| |
host_list
|
次のコマンド例は、
gateway.example.com への接続を検証する ping リソースを作成します。実際には、ネットワークゲートウェイやルーターへの接続を検証します。リソースがすべてのクラスターノードで実行されるよう、ping リソースをクローンとして設定します。
# pcs resource create ping ocf:pacemaker:ping dampen=5s multiplier=1000 host_list=gateway.example.com --clone
以下の例は、
Webserver という既存のリソースの場所制約ルールを設定します。これにより、Webserver リソースが現在実行されているホストが www.example.com へ ping できない場合に、 Webserver リソースを www.example.com へ ping できるホストに移動します。
# pcs constraint location Webserver rule score=-INFINITY pingd lt 1 or not_defined pingd
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.