6.7.3 実行サーバを運用するためのシェルスクリプト例
クラスタソフトから,サーバのパッケージを起動・停止するためのシェルスクリプト例,および,システム構成のとおりに実行サーバを配置するためのシェルスクリプト例を,次に示します。
- 〈この項の構成〉
(1) bes1〜6を実行サーバとして起動するためのシェルスクリプト例
一つの系につき,六つのファイルを作成してください。
/opt/hitachi/HAmon/etc/shell/bes[n]※1_online.shの設定例を示します。
#!/bin/sh
BES=bes[n]※1
NODE=node[k]※2
############# BES ONLINE #################################
/opt/hitachi/HAmon/bin/hateactonl ${BES}
cmmodpkg -n ${NODE} -e ${BES}
cmrunpkg -n ${NODE} ${BES}
cmmodpkg -e ${BES}- 注※1
-
[n]は,サーバごとに1〜6に変えて作成してください。
- 注※2
-
[k]は,系ごとに1〜3に変えて作成してください。
(2) 実行サーバbes1〜6のパッケージを停止するためのシェルスクリプト例
一つの系につき,六つのファイルを作成してください。
/opt/hitachi/HAmon/etc/shell/bes[n]※_offline.shの設定例を示します。
#!/bin/sh
BES=bes[n]※
############# BES OFFLINE #################################
cmhaltpkg ${BES}- 注※
-
[n]は,サーバごとに1〜6に変えて作成してください。
(3) システム構成のとおりに実行サーバを配置するためのシェルスクリプト例
このシェルスクリプトは,MC/ServiceGuardおよびHA Toolkit Exの起動完了後に,自動または手動で実行してください。指定したサーバが実行サーバとして起動し,ほかのサーバは待機サーバとして起動します。
対応するパッケージがすでに他系で起動している場合,シェルスクリプトを実行した系で実行サーバとして指定したサーバは,待機サーバとして起動します。
系1でbes1とbes2を実行サーバとして起動するための,/opt/hitachi/HAmon/etc/shell/bes_init_start.shの設定例を示します。
#!/bin/sh
############# ONLINE Permission ###########################
/opt/hitachi/HAmon/bin/hateactonl bes1
/opt/hitachi/HAmon/bin/hateactonl bes2
############# BES1, BES2 ONLINE ###########################
cmmodpkg -n node1 -e bes1
cmrunpkg -n node1 bes1
cmmodpkg -e bes1
cmmodpkg -n node1 -e bes2
cmrunpkg -n node1 bes2
cmmodpkg -e bes2
############# start HiRDB-unit and all-BES ################
PDDIR=/opt/HiRDB
PDCONFPATH=${PDDIR}/conf
SHLIB_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH SHLIB_PATH PATH
${PDDIR}/bin/pdstart -q 系2でbes3とbes4を実行サーバとして起動するための,/opt/hitachi/HAmon/etc/shell/bes_init_start.shの設定例を示します。
#!/bin/sh
############# ONLINE Permission ###########################
/opt/hitachi/HAmon/bin/hateactonl bes3
/opt/hitachi/HAmon/bin/hateactonl bes4
############# BES3, BES4 ONLINE ###########################
cmmodpkg -n node2 -e bes3
cmrunpkg -n node2 bes3
cmmodpkg -e bes3
cmmodpkg -n node2 -e bes4
cmrunpkg -n node2 bes4
cmmodpkg -e bes4
############# start HiRDB-unit and all-BES ################
PDDIR=/opt/HiRDB
PDCONFPATH=${PDDIR}/conf
SHLIB_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH SHLIB_PATH PATH
${PDDIR}/bin/pdstart -q 系3でbes5とbes6を実行サーバとして起動するための,/opt/hitachi/HAmon/etc/shell/bes_init_start.shの設定例を示します。
#!/bin/sh
############# ONLINE Permission ###########################
/opt/hitachi/HAmon/bin/hateactonl bes5
/opt/hitachi/HAmon/bin/hateactonl bes6
############# BES5, BES6 ONLINE ###########################
cmmodpkg -n node3 -e bes5
cmrunpkg -n node3 bes5
cmmodpkg -e bes5
cmmodpkg -n node3 -e bes6
cmrunpkg -n node3 bes6
cmmodpkg -e bes6
############# start HiRDB-unit and all-BES ################
PDDIR=/opt/HiRDB
PDCONFPATH=${PDDIR}/conf
SHLIB_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH SHLIB_PATH PATH
${PDDIR}/bin/pdstart -q