#!/bin/ksh # @(#)66 1.8.1.3 src/avs/fs/mmfs/samples/nfscluster/nfsrecovernode.scr, mmfs, avs_rgpfs24, rgpfs24s009a 12/18/06 10:34:58 # if [ ! -f /var/mmfs/etc/nfsfuncs ]; then echo "$0: Can't find NFS functions in /var/mmfs/etc" exit 0 fi . /var/mmfs/etc/nfsfuncs # Main [ -f $NODELIST ] || die "$0: NFS cluster was not defined (no $NODELIST file)" # Usage: nfsrecovernode.scr phase node [failed_nodes] phase=$1 me=$2 shift 2 failed_nodes=$* if [ "$phase" == "1" ]; then debugmsg "Start node recovery for $failed_nodes" for fip in $failed_nodes; do takeover_node=$(selectNode $fip) [ -z "$takeover_node" ] && die "Error: no takeover node" if [ "$me" == "$takeover_node" ]; then debugmsg "Do recovery for node $fip" IPtakeover $me $fip debuglog ls -A $SHARED_RECOVERY/$fip # recover nodes that were recovered by the failed node for node in $(ls -A $SHARED_RECOVERY/$fip 2> /dev/null); do debugmsg "Takeover node is $takeover_node. Do 2nd recovery for node $node" IPtakeover $me $node _unlink ${SHARED_RECOVERY}/$fip/$node done else debuglog touch ${SHARED_RECOVERY}/$takeover_node/$fip for node in $(ls -A $SHARED_RECOVERY/$fip 2> /dev/null); do debuglog cp ${SHARED_RECOVERY}/$node/* ${SHARED_RECOVERY}/$takeover_node 2> /dev/null done fi done checkDynamicGrace [ $? -eq 0 ] && startReclaim $me fi