HP StorageWorks X5500 Network Storage Gateway for Windows setup guide (AP809-96004, October 2009)

AppendixA:ConfiguretheClusterfromtheCommandLine 49
Sample Configuration Script
Thefollowingexampleshowshowascriptcanbeusedtoconfigurethe
cluster.Althoughthisisabashscript,thesameideasapplytoother
scriptingmethods.Notethefollowinginthesamplescript:
•Thevaluesforthemxcommandsarespecifiedinafilenamed
cluster.conf.
•Theclusterspecified
bythisscriptusesFibreChannelswitchbased
fencing.
•Somecommandssuchasmxconfigprotocolarenotincludedinthe
scriptbecausethedefaultvaluesforthosecommandswillbeused.
Alsonotethatmxconfigfcfencingdoesnotneedtobespecified
becausethatisthedefault.
#!/bin/bash
if [ ! -f cluster.conf ]; then
echo "you need cluster.conf"
exit 1
fi
set -x
source cluster.conf
MX="mx --matrix ${MATRIX} --user ${USER} --password ${PASSWORD}"
# Configure cluster.
${MX} config license ${LICENSE} || exit 1
${MX} config secret ${SECRET} || exit 1
${MX} config fcswitch --community ${COMMUNITY} ${SWITCHES} || exit 1
${MX} config mp set ${MP} || exit 1
# Export the config to all the other nodes and start them up.
${MX} server start ${MATRIX} || exit 1
for NODE in ${NODES}; do
${MX} server add ${NODE} || exit 1
${MX} config export ${NODE} || exit 1 done
Thecluster.conffiledefinesthevaluesforthecommandsinthescript.
# Cluster Details
# Start Node