Liberty でのヘルス管理ポリシー
環境でモニターしたいヘルス条件およびそれらの条件が満たされた時に実行するアクションなどのヘルス・ポリシーを定義することができます。
このタスクについて
ヘルス・ポリシーは、他の Liberty フィーチャーと同様に構成されます。server.xml ファイル構成内で、新しいエレメント・タイプ <healthPolicy> が、単一のヘルス・ポリシーを定義するために使用されます。複数のポリシーが必要な場合は、server.xml ファイルに複数のヘルス・ポリシー・エレメントを追加できます。
手順
例
この例では、ヘルス・ポリシーは、クラスター mycluster1 内のすべてのサーバーとホスト myHost 上のすべてのサーバーで過剰なメモリー使用量についてモニターすることを指定しています。このポリシーは、指定されたしきい値に基づいて excessiveMemoryUsage 条件をモニターします。このポリシーは、ヘルス管理コントローラーに対し、過剰なメモリー使用が発生しているサーバーを保守モードにし、そのサーバーからのヒープ・ダンプを要求するよう指示します。
<healthPolicy id="myHealthPolicy" >
<cluster clusterName="mycluster1"/>
<host hostName="myHost"/>
<excessiveMemoryUsage heapSizePercentage="85" timePeriod="5m"/>
<action action="enterMaintenanceMode"/>
<action action="generateHeapDump"/>
</healthPolicy>
ヘルス・ポリシーを追加すると、集合コントローラーの messages.log ファイルに、次のメッセージが任意の順序で表示されます。
CWWKV0609I: The health policy myHealthPolicy is added.
CWWKV0603I: The health condition com.ibm.ws.health.manager.healthPolicy.condition.excessiveMemoryUsage is being monitored on target member_host_name,path_to_usr_directory,member_name.
CWWKV0607I: The health policy myHealthPolicy is activated for member_host_name,path_to_usr_directory,member_name.
注: メッセージ CWWKV0603I および CWWKV0607I は、集合内にターゲット・エレメントで識別されるメンバー・サーバーが少なくとも 1 つ存在する場合に表示されます。
ヘルス・ポリシーを変更すると、集合コントローラーの messages.log ファイルに、次のメッセージが任意の順序で表示されます。
CWWKV0610I: The health policy myHealthPolicy is removed.
CWWKV0604I: The health condition com.ibm.ws.health.manager.healthPolicy.condition.excessiveMemoryUsage is no longer being monitored on target member_host_name,path_to_usr_directory,member_name.
CWWKV0609I: The health policy myHealthPolicy is added.
CWWKV0603I: The health condition com.ibm.ws.health.manager.healthPolicy.condition.excessiveMemoryUsage is being monitored on target member_host_name,path_to_usr_directory,member_name.