From d39e4a7c395d057cc7b4ad4a4b23937a7b2363bb Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 29 May 2009 16:53:13 +1000 Subject: Make setup_gpfs.sh and mknsd.sh aware of NSD servers. Both scripts now use nsd_server_common.bash to re-exec on the first node defined in $NSD_SERVERS if that variable is set (to the list of sofs_storage nodes by 50sofs.defconf). They also also include the NSD servers in the file that is passed to mmcrnsd and mmcrfs. setup_gpfs.sh includes any NSD servers in the list of nodes for the GPFS cluster, using them as the primary and secondary GPFS servers. setup_gpfs.sh just sources mknsd.sh to avoid duplication of logic. Signed-off-by: Martin Schwenke --- base/root/scripts/nsd_server_common.bash | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 base/root/scripts/nsd_server_common.bash (limited to 'base/root/scripts/nsd_server_common.bash') diff --git a/base/root/scripts/nsd_server_common.bash b/base/root/scripts/nsd_server_common.bash new file mode 100644 index 0000000..d665c59 --- /dev/null +++ b/base/root/scripts/nsd_server_common.bash @@ -0,0 +1,18 @@ +# If there are sofs_storage nodes in the cluster (meaning that other +# sofs_* nodes will not have direct-attached storage) then scripts +# that include this snippet must be run on one of the storage nodes. +# Therefore, in the case, this snippet tries to determine if it is +# running on the 1st NSD server and, if not, attempts to run the +# script there. + +nsd_servers="@@NSD_SERVERS@@" + +if [ -n "$nsd_servers" -a \ + "${HOSTNAME%%.*}" != "${nsd_servers%%[.,]*}" ] ; then + if [ "${0#/}" != "$0" ] ; then + script="$0" + else + script="${PWD}/${0}" + fi + exec ssh "${nsd_servers%%[.,]*}" "$script" "$@" +fi -- cgit