9.4.5 Managementアクション実行用プロパティファイルの設定
Managementアクションの定義,メッセージIDとManagementアクションとのマッピングなどは,Managementアクション実行用プロパティファイル(maction.properties)に定義します。maction.propertiesについては,マニュアル「Cosminexus アプリケーションサーバ リファレンス 定義編(サーバ定義)」の「10.11 maction.properties(Managementアクション実行用プロパティファイル)」を参照してください。
- <この項の構成>
- (1) ファイルの格納場所
- (2) ファイルの設定例
- (3) 注意事項
(1) ファイルの格納場所
maction.propertiesの格納場所を次に示します。
- Windowsの場合
<Cosminexusのインストールディレクトリ>¥manager¥config¥maction.properties
- UNIXの場合
/opt/Cosminexus/manager/config/maction.properties
(2) ファイルの設定例
Windowsの場合のManagementアクション実行用プロパティファイルの設定例を次に示します。
# Managementアクションの定義
maction.restart.command=c¥:¥¥tmp¥¥command1.bat
maction.restart.timeout=12
maction.restart.timeout.forced_stop=true
maction.restart.exclusive_time=60
maction.restart.max_executable_actions=1
# メッセージIDとManagementアクションのマッピング
maction.message.KDJE11111-E.mactions=restart
maction.message.KDJE22222-E.mactions=restart
# 論理サーバとManagementアクションのマッピング
maction.server.j2ee1.mactions=restart
maction.server.j2ee2.mactions=restart
maction.server.j2eeClstr1.mactions=restart |
この設定例では,Managementアクションを識別するID(ManagementアクションID)として,「restart」を定義しています。「restart」のManagementアクションの動作および設定について説明します。
- Managementアクション実行コマンドとして「command1.bat」というコマンドファイルを実行します。
- Managementアクション実行コマンドのタイムアウトは,「12」秒とします。
- Managementアクション実行コマンドのタイムアウトが発生すると,コマンドを強制終了します。
- Managementアクションの抑止時間は「60」秒,Managementアクションの同時実行数は,「1」とします。※
- J2EEサーバ「j2ee1」,「j2ee2」および「j2eeClstr1」から,メッセージ「KDJE11111-E」と「KDJE22222-E」が出力された場合に,このManagementアクションを実行します。
- 注※
- Managementアクションは,ManagementアクションIDで区別され,複数のサーバや異なるメッセージIDに対して同一のManagementアクションを実行できます。抑止時間や同時実行数を設定してManagementアクションの実行を制御することで,Managementアクションの集約や重複実行の抑止ができます。実行制御については,「9.3 Managementアクションの実行制御とは」を参照してください。
(3) 注意事項
Managementアクション実行用プロパティファイルに関する注意事項を次に示します。
- プロパティの優先順位
次に示すキーで指定する論理サーバやクラスタには,「J2EEサーバ < J2EEサーバクラスタ < サービスユニット < 物理ティア」という包含関係があります。
- maction.server.<論理サーバ名>.mactions
- maction.unit.<Webシステム名>.<サービスユニット名>.mactions
- maction.tier.<Webシステム名>.<物理ティア種別名>.mactions
このため,J2EEサーバクラスタとそのJ2EEサーバクラスタの構成要素となるJ2EEサーバのように,包含関係を持つ論理サーバそれぞれに対して別々のManagementアクションを定義した場合,次に示す優先順位で,どれか一つのManagementアクションを実行します。
- Managementイベントを発行したJ2EEサーバ
- Managementイベントを発行したJ2EEサーバを含むJ2EEサーバクラスタ
- Managementイベントを発行したJ2EEサーバを含むサービスユニット
- Managementイベントを発行したJ2EEサーバを含む物理ティア
なお,Webシステム,サービスユニットや物理ティアは,Smart Composer機能を使用してシステムを構築する場合の概念です。Smart Composer機能については,マニュアル「Cosminexus アプリケーションサーバ システム構築・運用ガイド」の「1.5 Smart Composer機能の概要」を参照してください。
- Managementアクションの指定順序
次に示す二つのキーでManagementアクションの指定順序が異なる場合は,maction.message.<メッセージID>.mactionsキーでの指定順序を優先します。
- maction.message.<メッセージID>.mactions
メッセージIDとManagementアクションとをマッピングするキーです。
- maction.server.<論理サーバ名>.mactions
論理サーバとManagementアクションとをマッピングするキーです。
- (例)
- この例では,「act1」が優先されます。
- maction.message.KDJE99999-E.mactions=act1,act2
- maction.server.J2EE01.mactions=act3,act2,act1