Last change
on this file since 27 was
16,
checked in by rock, 17 years ago
|
|
-
Property svn:executable set to
*
|
File size:
1.4 KB
|
Rev | Line | |
---|
[16] | 1 | #!/bin/ksh |
---|
| 2 | # @(#)66 1.8.1.3 src/avs/fs/mmfs/samples/nfscluster/nfsrecovernode.scr, mmfs, avs_rgpfs24, rgpfs24s009a 12/18/06 10:34:58 |
---|
| 3 | # |
---|
| 4 | |
---|
| 5 | if [ ! -f /var/mmfs/etc/nfsfuncs ]; then |
---|
| 6 | echo "$0: Can't find NFS functions in /var/mmfs/etc" |
---|
| 7 | exit 0 |
---|
| 8 | fi |
---|
| 9 | . /var/mmfs/etc/nfsfuncs |
---|
| 10 | |
---|
| 11 | # Main |
---|
| 12 | |
---|
| 13 | [ -f $NODELIST ] || die "$0: NFS cluster was not defined (no $NODELIST file)" |
---|
| 14 | |
---|
| 15 | # Usage: nfsrecovernode.scr phase node [failed_nodes] |
---|
| 16 | phase=$1 |
---|
| 17 | me=$2 |
---|
| 18 | shift 2 |
---|
| 19 | failed_nodes=$* |
---|
| 20 | |
---|
| 21 | if [ "$phase" == "1" ]; then |
---|
| 22 | debugmsg "Start node recovery for $failed_nodes" |
---|
| 23 | |
---|
| 24 | for fip in $failed_nodes; do |
---|
| 25 | takeover_node=$(selectNode $fip) |
---|
| 26 | |
---|
| 27 | [ -z "$takeover_node" ] && die "Error: no takeover node" |
---|
| 28 | |
---|
| 29 | if [ "$me" == "$takeover_node" ]; then |
---|
| 30 | debugmsg "Do recovery for node $fip" |
---|
| 31 | IPtakeover $me $fip |
---|
| 32 | debuglog ls -A $SHARED_RECOVERY/$fip |
---|
| 33 | # recover nodes that were recovered by the failed node |
---|
| 34 | for node in $(ls -A $SHARED_RECOVERY/$fip 2> /dev/null); do |
---|
| 35 | debugmsg "Takeover node is $takeover_node. Do 2nd recovery for node $node" |
---|
| 36 | IPtakeover $me $node |
---|
| 37 | _unlink ${SHARED_RECOVERY}/$fip/$node |
---|
| 38 | done |
---|
| 39 | else |
---|
| 40 | debuglog touch ${SHARED_RECOVERY}/$takeover_node/$fip |
---|
| 41 | for node in $(ls -A $SHARED_RECOVERY/$fip 2> /dev/null); do |
---|
| 42 | debuglog cp ${SHARED_RECOVERY}/$node/* ${SHARED_RECOVERY}/$takeover_node 2> /dev/null |
---|
| 43 | done |
---|
| 44 | fi |
---|
| 45 | done |
---|
| 46 | |
---|
| 47 | checkDynamicGrace |
---|
| 48 | [ $? -eq 0 ] && startReclaim $me |
---|
| 49 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.