uCosminexus Batch Job Execution Server ログビューア 導入・運用ガイド
ここでは,Log Agentを自動起動および自動終了する場合の設定について説明します。
- 注意事項
- Log AgentをJP1/AJSと同じマシンに配置する場合,Log Agentは,JP1/AJSより前に起動し,JP1/AJSよりあとに停止することを推奨します。また,Log AgentとLog Managerを同じマシンに配置する場合,Log Manager,Log Agentの順に起動し,Log Agent,Log Managerの順に停止することを推奨します。
- <この節の構成>
- (1) AIXの場合
- (2) Linuxの場合
- (3) HP-UXの場合
- (4) Windowsの場合
(1) AIXの場合
インストールと環境設定の完了後,次に示す操作を実行します。
- mkitabコマンドで,/etc/inittabファイルに記述を追加します。
実行するコマンドを次に示します。
- Log Agent専用の実行ユーザーを作成していない場合
mkitab -i hntr2mon "bjexloga:2:wait:/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start"- Log Agent専用の実行ユーザーを作成している場合
ユーザー名には,chownコマンドで所有者に指定したユーザーのユーザー名を指定します。
mkitab -i hntr2mon "bjexloga:2:wait:su ユーザー名 -c /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start"- lsitabコマンドで,/etc/inittabファイルの設定内容を確認します。
実行するコマンドを次に示します。
コマンドの実行結果が表示されます。
lsitab -a
- 実行結果で,Log AgentのプロセスがJP1/AJSよりも前に起動する記述になっていることを確認します。
また,Log AgentをLog Managerと同じマシンに配置する場合は,Log AgentのプロセスがLog Managerよりもあとに起動する設定になっていることを確認します。
実行結果の例を次に示します。
次に,自動終了を設定します。
init:2:initdefault: brc::sysinit:/sbin/rc.boot 3 >/dev/console 2>&1 # Phase 3 of system boot : : hntr2mon:2:once:/opt/hitachi/HNTRLib2/etc/D002start bjexlogm:2:wait:/opt/hitachi/bjexlog/bjexlogmanager/bin/bjexlmgr start bjexloga:2:wait:/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start jp1base:2:wait:/etc/opt/jp1base/jbs_start jp1cons:2:wait:/etc/opt/jp1cons/jco_start jp1ajs2:2:wait:/etc/opt/jp1ajs2/jajs_start jp1_fts:2:wait:/etc/opt/jp1_fts/startup bjexpd:2:wait:/opt/hitachi/bjex/sbin/bjexpdctl start
- /etc/rc.shutdownファイルに,終了時の処理を追加します。
JP1/AJSの記述よりあと,かつLog Manager の記述より前に,次の記述を追加します。
test -x /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent && /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop
(2) Linuxの場合
インストールと環境設定の完了後,次に示す操作を実行します。
- Log Agentの起動スクリプトbjexlaを作成し,/etc/init.dに登録します。
起動スクリプトbjexlaのひな形を次のファイルで提供しています。
/opt/hitachi/bjexlog/bjexlogagent/bin/bjexla
chkconfigコマンドで管理するために,起動スクリプトbjexlaに次の記述を追加します。
「# chkconfig:」には次の内容を記述します。
# chkconfig: lllll mm nn # description: BJEX Log Agent
「# description:」にはサービスの説明を記述します。
- lllll
Log Agentを起動するランレベルを指定します。
- mm
Log Agentの起動順を10進数で指定します。JP1/AJSの指定値より小さく,Log Managerの指定値より大きい値を指定します。
- nn
Log Agentの停止順を10進数で指定します。JP1/AJSの指定値より大きく,Log Managerの指定値より小さい値を指定します。
また,Log Agent専用の実行ユーザーを作成している場合は,起動スクリプトbjexlaを次のように変更します。
ユーザー名には,chownコマンドで所有者に指定したユーザーのユーザー名を指定します。
<変更前> /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start # su username -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start" /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop # su username -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop" <変更後> # /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start su ユーザー名 -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start" # /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop su ユーザー名 -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop"
- chkconfigコマンドを実行して,起動スクリプトbjexlaの自動起動・停止を設定します。
実行するコマンドを次に示します。
このコマンドを実行すると,Smmbjexla(mmは起動スクリプト中の「# chkconfig:」で指定した起動順)が/etc/rcx.d(xは起動スクリプト中の「# chkconfig:」でlllllに指定したランレベル)へ登録され,Knnbjexla(nnは起動スクリプト中の「# chkconfig:」で指定した停止順)が/etc/rcy.d(yは起動スクリプト中の「# chkconfig:」でlllllに指定しなかったランレベル)へ登録されます。
/sbin/chkconfig --add bjexla
- 設定内容を確認します。
実行するコマンドを次に示します。
コマンドの実行結果を参照し,ランレベルの設定に誤りがないか確認します。
/sbin/chkconfig --list bjexla
また,/etc/rc#.dディレクトリ(#はランレベル)を参照して,JP1/AJS,Log Manager,Log Agentの起動スクリプトの起動順,停止順が正しいことを確認します。
(3) HP-UXの場合
インストールと環境設定の完了後,次に示す操作を実行します。
- Log Agentの起動スクリプトbjexlaを作成し,/sbin/init.dに登録します。
起動スクリプトbjexlaのひな形を次のファイルで提供しています。
/opt/hitachi/bjexlog/bjexlogagent/bin/bjexla
Log Agent専用の実行ユーザーを作成している場合は,起動スクリプトbjexlaを次のように変更します。
ユーザー名には,chownコマンドで所有者に指定したユーザーのユーザー名を指定します。
<変更前> /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start # su username -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start" /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop # su username -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop" <変更後> # /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start su ユーザー名 -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent start" # /opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop su ユーザー名 -c "/opt/hitachi/bjexlog/bjexlogagent/bin/bjexlagent stop"
- 起動スクリプトbjexlaへのシンボリックリンクを,/sbin/rc#ディレクトリ(#はランレベル)に作成します。
実行するコマンドを次に示します。
次の内容を指定します。
ln -s /sbin/init.d/bjexla /sbin/rcx.d/Smmmbjexla ln -s /sbin/init.d/bjexla /sbin/rcy.d/Knnnbjexla
- x
Log Agentを起動するランレベルを指定します。
- y
Log Agentを停止するランレベルを指定します。
- mmm
Log Agentの起動順を3けたの10進数で指定します。JP1/AJSの指定値より小さく,Log Managerの指定値より大きい値を指定します。
- nnn
Log Agentの停止順を3けたの10進数で指定します。JP1/AJSの指定値より大きく,Log Managerの指定値より小さい値を指定します。
(4) Windowsの場合
インストールと環境設定の完了後,次に示す操作を実行します。
- Windowsの管理ツールで[サービス]を選択し,表示された画面で「uCosminexus BJEX-Log Agent」のプロパティを開きます。
- 「スタートアップの種類」が「自動」になっていることを確認します。
- シャットダウンスクリプトにLog Agentのインストール先フォルダ\bin\bjexlashutdown.cmdを登録します。
シャットダウンスクリプトへの登録方法を次に示します。
1. Windowsの[スタート]メニューの[ファイル名を指定して実行]から「gpedit.msc」を実行して,ローカルグループポリシーエディターを起動します。
2. ツリービューペインから[ローカルコンピュータポリシー]−[コンピュータの設定]−[Windowsの設定]−[スクリプト(スタートアップ/シャットダウン)]を選択します。
3. リストペインから[シャットダウン]をダブルクリックして,[シャットダウンのプロパティ]画面を開きます。
4. [シャットダウンのプロパティ]画面の[追加]ボタンをクリックして,[スクリプト追加]画面からLog Agentのインストール先フォルダ\bin\bjexlashutdown.cmdを選択して,[OK]ボタンをクリックします。
All Rights Reserved. Copyright (C) 2009, 2011, Hitachi Solutions, Ltd.
All Rights Reserved. Copyright (C) 2009, 2011, Hitachi, Ltd.