source: gpfs_3.1_ker2.6.20/lpp/mmfs/samples/nfscluster/nfsnodeback @ 16

Last change on this file since 16 was 16, checked in by rock, 16 years ago
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/bin/ksh
2# @(#)65  1.5.1.2  src/avs/fs/mmfs/samples/nfscluster/nfsnodeback, mmfs, avs_rgpfs24, rgpfs24s006a 8/17/06 17:09:15
3#
4
5if [ ! -f /var/mmfs/etc/nfsfuncs ]; then
6    echo "$0: Can't find NFS functions in /var/mmfs/etc"
7    exit 0
8fi
9. /var/mmfs/etc/nfsfuncs
10
11debugmsg "gpfs_ip $1 failover_ip $2 recovering_ip $3"
12
13hard_failback() {
14    [ $# -lt 3 ] && die "Usage: $0 gpfs_ip failover_ip"
15
16    gpfs_ip=$1
17    failover_ip=$2
18    recovering_ip=$3
19
20    # 1. all nodes go in to grace period
21    # Note: this is already done by nfsgrace
22    # startGrace
23    # msg "NLM grace period started due to recovery of node ($recovering_ip)"
24
25    # 2. only recovery node release IP addresses of node that joined back
26    if [ "$gpfs_ip" == "$failover_ip" ]; then
27        nfsips=$(getNfsIPs $recovering_ip)
28        msg "Node $recovering_ip has recovered; releasing its IP address(es) $nfsips"
29
30  [ $hardMount -eq 1 ] && nfsService soft-restart
31
32        for ip in $nfsips; do
33      ifDown $ip
34        done
35    fi
36
37    # 3. all node start lock recovery
38    startReclaim $gpfs_ip
39}
40
41soft_failback() {
42    [ $# -lt 2 ] && die "Usage: $0 gpfs_ip failover_ip"
43    gpfs_ip=$1
44    recovering_ip=$2
45
46    nfsips=$(getNfsIPs $recovering_ip)
47    msg "Node $recovering_ip has recovered; releasing its IP address(es) $nfsips"
48
49    [ $hardMount -eq 1 ] && nfsService soft-restart
50
51    for ip in $nfsips; do
52        ifDown $ip
53    done
54
55    resetLockd
56
57    msg "All NLM locks have been released due to recovery of node ($recovering_ip)"
58    startReclaim $gpfs_ip
59    for failed_node in $(ls -A $SHARED_RECOVERY/$gpfs_ip); do
60        startReclaim $failed_node
61    done
62}
63
64if [ $# -ge 3 ]; then
65    hard_failback $*
66else
67    soft_failback $*
68fi
Note: See TracBrowser for help on using the repository browser.