6 環境設定(HP-UX)
6.7 HiRDB の影響分散スタンバイレス型系切 り替え構成の環境設定例(HP-UX)
6.7.3 実行サーバを運用するためのシェルスクリプト例
クラスタソフトから,サーバのパッケージを起動・停止するためのシェルスクリプト例,
および,システム構成のとおりに実行サーバを配置するためのシェルスクリプト例を,
次に示します。
(1) bes1 〜 6 を実行サーバとして起動するためのシェルスクリプト例
一つの系につき,六つのファイルを作成してください。
/opt/hitachi/HAmon/etc/shell/bes[n]
※1_online.sh
の設定例を示します。注※1 [n]は,サーバごとに1〜6に変えて作成してください。
注※2 [k]は,系ごとに1〜3に変えて作成してください。
(2) 実行サーバ bes1 〜 6 のパッケージを停止するためのシェルスクリ プト例
一つの系につき,六つのファイルを作成してください。
/opt/hitachi/HAmon/etc/shell/bes[n]
※_offline.sh
の設定例を示します。注※ [n]は,サーバごとに1〜6に変えて作成してください。
(3) システム構成のとおりに実行サーバを配置するためのシェルスクリ プト例
このシェルスクリプトは,MC/ServiceGuardおよび
HA Toolkit Ex
の起動完了後に,自 動または手動で実行してください。指定したサーバが実行サーバとして起動し,ほかの サーバは待機サーバとして起動します。bes6 ...
SERVICE_NAME[0]="bes6"
SERVICE_CMD[0]="/opt/hitachi/HAmon/bin/hateserv bes6"
...
#!/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}
#!/bin/sh BES=bes[n]※
############# BES OFFLINE #################################
cmhaltpkg ${BES}
パッケージ名 パッケージ制御スクリプトの設定例
対応するパッケージがすでに他系で起動している場合,シェルスクリプトを実行した系 で実行サーバとして指定したサーバは,待機サーバとして起動します。
系
1
でbes1
とbes2
を実行サーバとして起動するための,/opt/hitachi/HAmon/etc/shell/bes_init_start.sh
の設定例を示します。系
2
でbes3
とbes4
を実行サーバとして起動するための,/opt/hitachi/HAmon/etc/shell/bes_init_start.sh
の設定例を示します。系
3
でbes5
とbes6
を実行サーバとして起動するための,/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
#!/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
#!/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