#!/bin/ksh # @(#)65 1.5.1.2 src/avs/fs/mmfs/samples/nfscluster/nfsnodeback, mmfs, avs_rgpfs24, rgpfs24s006a 8/17/06 17:09:15 # 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 debugmsg "gpfs_ip $1 failover_ip $2 recovering_ip $3" hard_failback() { [ $# -lt 3 ] && die "Usage: $0 gpfs_ip failover_ip" gpfs_ip=$1 failover_ip=$2 recovering_ip=$3 # 1. all nodes go in to grace period # Note: this is already done by nfsgrace # startGrace # msg "NLM grace period started due to recovery of node ($recovering_ip)" # 2. only recovery node release IP addresses of node that joined back if [ "$gpfs_ip" == "$failover_ip" ]; then nfsips=$(getNfsIPs $recovering_ip) msg "Node $recovering_ip has recovered; releasing its IP address(es) $nfsips" [ $hardMount -eq 1 ] && nfsService soft-restart for ip in $nfsips; do ifDown $ip done fi # 3. all node start lock recovery startReclaim $gpfs_ip } soft_failback() { [ $# -lt 2 ] && die "Usage: $0 gpfs_ip failover_ip" gpfs_ip=$1 recovering_ip=$2 nfsips=$(getNfsIPs $recovering_ip) msg "Node $recovering_ip has recovered; releasing its IP address(es) $nfsips" [ $hardMount -eq 1 ] && nfsService soft-restart for ip in $nfsips; do ifDown $ip done resetLockd msg "All NLM locks have been released due to recovery of node ($recovering_ip)" startReclaim $gpfs_ip for failed_node in $(ls -A $SHARED_RECOVERY/$gpfs_ip); do startReclaim $failed_node done } if [ $# -ge 3 ]; then hard_failback $* else soft_failback $* fi