Hitachi HA Toolkit

[目次][用語][索引][前へ][次へ]

7.7.3 実行サーバを運用するためのシェルスクリプト例

クラスタソフトから,サーバのサービスグループをオンライン・オフライン化するためのシェルスクリプト例,およびシステム構成のとおりに実行サーバを配置するためのシェルスクリプト例を,次に示します。

<この項の構成>
(1) bes1〜6を実行サーバとしてオンライン化するためのシェルスクリプト例
(2) 実行サーバbes1〜6をオフライン化するためのシェルスクリプト例
(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}
hagrp -clear ${BES} -sys ${NODE}
hagrp -online ${BES} -sys ${NODE}

注※1 [n]は,サーバごとに1〜6に変えて作成してください。

注※2 [k]は,系ごとに1〜3に変えて作成してください。


(2) 実行サーバbes1〜6をオフライン化するためのシェルスクリプト例

一つの系につき,六つのファイルを作成してください。

/opt/hitachi/HAmon/etc/shell/bes[n]1_offline.shの設定例を示します。

#!/bin/sh
BES=bes[n]1
NODE=node[k]※2
############# BES OFFLINE #################################
hagrp -offline ${BES} -sys ${NODE}

注※1 [n]は,サーバごとに1〜6に変えて作成してください。

注※2 [k]は,系ごとに1〜3に変えて作成してください。


(3) システム構成のとおりに実行サーバを配置するためのシェルスクリプト例

このシェルスクリプトは,VCSおよび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 ###########################
hagrp -clear bes1 -sys node1
hagrp -online bes1 -sys node1
hagrp -clear bes2 -sys node1
hagrp -online bes2 -sys node1
 
############# start HiRDB-unit and all-BES ################
PDDIR=/opt/HiRDB
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH LD_LIBRARY_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 ###########################
hagrp -clear bes3 -sys node2
hagrp -online bes3 -sys node2
hagrp -clear bes4 -sys node2
hagrp -online bes4 -sys node2
 
############# start HiRDB-unit and all-BES ################
PDDIR=/opt/HiRDB
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH LD_LIBRARY_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 ###########################
hagrp -clear bes5 -sys node3
hagrp -online bes5 -sys node3
hagrp -clear bes6 -sys node3
hagrp -online bes6 -sys node3
 
############# start HiRDB-unit and all-BES ################
PDDIR=/opt/HiRDB
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH LD_LIBRARY_PATH PATH
 
${PDDIR}/bin/pdstart -q