IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42549


Ignore:
Timestamp:
Dec 3, 2023, 2:45:50 PM (3 years ago)
Author:
eugene
Message:

cleanup the rebalance scripts to be more flexible

Location:
trunk/tools/eam/rebalance
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rebalance/launch.trash.check.sh

    r42314 r42549  
    11#!/bin/csh
    22
    3 set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
    4 set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
     3set program = `basename $0`
    54
    6 if ($#argv == 1) then
    7   if ("$1" != "launch") then
    8     echo "USAGE: launch.trash.check.sh launch"
    9     exit 2
    10   endif
    11   foreach f ($list)
    12     echo ssh -f $f "cd $mydir && ./launch.trash.check.sh"
    13          ssh -f $f "cd $mydir && ./launch.trash.check.sh"
     5set run = v0
     6set version = 20230802
     7set mode = trash.check
     8
     9set srchost = (ipp100 ipp108 ipp112 ipp114)
     10set srcvol  = (     0      0      1      0)
     11set tgthost = (ipp161 ipp161 ipp162 ipp162)
     12set tgtvol  = (     0      1      0      1)
     13
     14set mydir = /data/ipphome1.0/home/eugene/rebalance.20230802
     15
     16if ($#argv == 0) then
     17  echo "USAGE: $program launch"
     18  echo "USAGE: $program run (Nentry)"
     19  echo "   eg: $program run 1"
     20  exit 2
     21endif
     22
     23if ("$1" == "launch") then
     24
     25  set i = 1
     26  while ($i <= $#srchost)
     27    echo ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     28         ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     29    @ i++
    1430  end
    1531  exit 0
    1632endif
    1733
    18 set run = v0
    19 set version = 20220922
     34if ("$1" == "run") then
     35  if ($#argv != 2) then
     36    echo "USAGE: $program run (Nentry)"
     37    echo "   eg: $program run 1"
     38    exit 2
     39  endif
    2040
    21 set myhost = `hostname`
    22 set Nhost = `hostname | sed s/ipp//`
     41  set N = $2
    2342
    24 set target = NONE
    25 switch ($myhost)
    26   # total of 23TB
    27   case ipp100
    28   case ipp101
    29   case ipp123
    30   set target = ipp153
    31   breaksw;
     43  set hn = $srchost[$N]
     44  set hv = $srcvol[$N]
     45  set tn = $tgthost[$N]
     46  set tv = $tgtvol[$N]
    3247
    33   # total of 35TB
    34   case ipp102
    35   case ipp104
    36   case ipp124
    37   case ipp136
    38   set target = ipp154
    39   breaksw;
     48  set myhost = `hostname`
     49  if ($hn != $myhost) then
     50    echo "ERROR: need to run $mode on the source host ($hn vs $myhost)"
     51    exit 3
     52  endif
    4053
    41   # total of 35TB
    42   case ipp105
    43   case ipp108
    44   case ipp125
    45   case ipp137
    46   set target = ipp155
    47   breaksw;
     54  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
     55  mkdir -p $hn.$hv
     56  echo "./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &"
     57        ./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &
    4858
    49   # total of 23TB
    50   case ipp112
    51   case ipp114
    52   case ipp126
    53   set target = ipp156
    54   breaksw;
    55 
    56   # total of 38TB
    57   case ipp115
    58   case ipp117
    59   case ipp134
    60   case ipp139
    61   set target = ipp157
    62   breaksw;
    63 endsw
    64 
    65 if ("$target" == "NONE") then
    66   echo "need target"
    67   exit 2
     59  exit 0
    6860endif
    69 
    70 set v = 0 ; set h = `hostname` ; set t = $target; ./rebalance.mana trash.check $h $v $t $v $version > & $h.$v/log.trash.check.$version.$run &
    71 set v = 1 ; set h = `hostname` ; set t = $target; ./rebalance.mana trash.check $h $v $t $v $version > & $h.$v/log.trash.check.$version.$run &
    72 
    73 # e.g.: ssh -f ipp127 "cd `pwd` && ./launch.trash.check.sh"
  • trunk/tools/eam/rebalance/launch.trash.empty.sh

    r42314 r42549  
    11#!/bin/csh
    22
    3 set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
    4 set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
     3set program = `basename $0`
    54
    6 if ($#argv == 1) then
    7   if ("$1" != "launch") then
    8     echo "USAGE: launch.trash.empty.sh launch"
    9     exit 2
    10   endif
    11   foreach f ($list)
    12     echo ssh -f $f "cd $mydir && ./launch.trash.empty.sh"
    13          ssh -f $f "cd $mydir && ./launch.trash.empty.sh"
     5set run = v0
     6set version = 20230802
     7set mode = empty.trash
     8
     9set srchost = (ipp100 ipp108 ipp112 ipp114)
     10set srcvol  = (     0      0      1      0)
     11set tgthost = (ipp161 ipp161 ipp162 ipp162)
     12set tgtvol  = (     0      1      0      1)
     13
     14set mydir = /data/ipphome1.0/home/eugene/rebalance.20230802
     15
     16if ($#argv == 0) then
     17  echo "USAGE: $program launch"
     18  echo "USAGE: $program run (Nentry)"
     19  echo "   eg: $program run 1"
     20  exit 2
     21endif
     22
     23if ("$1" == "launch") then
     24
     25  set i = 1
     26  while ($i <= $#srchost)
     27    echo ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     28         ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     29    @ i++
    1430  end
    1531  exit 0
    1632endif
    1733
    18 set run = v0
    19 set version = 20220922
     34if ("$1" == "run") then
     35  if ($#argv != 2) then
     36    echo "USAGE: $program run (Nentry)"
     37    echo "   eg: $program run 1"
     38    exit 2
     39  endif
    2040
    21 set myhost = `hostname`
    22 set Nhost = `hostname | sed s/ipp//`
     41  set N = $2
    2342
    24 set target = NONE
    25 switch ($myhost)
    26   # total of 23TB
    27   case ipp100
    28   case ipp101
    29   case ipp123
    30   set target = ipp153
    31   breaksw;
     43  set hn = $srchost[$N]
     44  set hv = $srcvol[$N]
     45  set tn = $tgthost[$N]
     46  set tv = $tgtvol[$N]
    3247
    33   # total of 35TB
    34   case ipp102
    35   case ipp104
    36   case ipp124
    37   case ipp136
    38   set target = ipp154
    39   breaksw;
     48  set myhost = `hostname`
     49  if ($hn != $myhost) then
     50    echo "ERROR: need to run $mode on the source host ($hn vs $myhost)"
     51    exit 3
     52  endif
    4053
    41   # total of 35TB
    42   case ipp105
    43   case ipp108
    44   case ipp125
    45   case ipp137
    46   set target = ipp155
    47   breaksw;
     54  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
     55  mkdir -p $hn.$hv
     56  echo "./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &"
     57        ./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &
    4858
    49   # total of 23TB
    50   case ipp112
    51   case ipp114
    52   case ipp126
    53   set target = ipp156
    54   breaksw;
    55 
    56   # total of 38TB
    57   case ipp115
    58   case ipp117
    59   case ipp134
    60   case ipp139
    61   set target = ipp157
    62   breaksw;
    63 endsw
    64 
    65 if ("$target" == "NONE") then
    66   echo "need target"
    67   exit 2
     59  exit 0
    6860endif
    69 
    70 set v = 0 ; set h = `hostname` ; set t = $target; ./rebalance.mana empty.trash $h $v $t $v $version > & $h.$v/log.empty.trash.$version.$run &
    71 set v = 1 ; set h = `hostname` ; set t = $target; ./rebalance.mana empty.trash $h $v $t $v $version > & $h.$v/log.empty.trash.$version.$run &
    72 
    73 # e.g.: ssh -f ipp127 "cd `pwd` && ./launch.trash.empty.sh"
  • trunk/tools/eam/rebalance/launch.trash.errors.sh

    r42314 r42549  
    11#!/bin/csh
    22
    3 set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
    4 set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
     3set program = `basename $0`
    54
    6 if ($#argv == 1) then
    7   if ("$1" != "launch") then
    8     echo "USAGE: launch.trash.errors.sh launch"
    9     exit 2
    10   endif
    11   foreach f ($list)
    12     echo ssh -f $f "cd $mydir && ./launch.trash.errors.sh"
    13          ssh -f $f "cd $mydir && ./launch.trash.errors.sh"
     5set run = v0
     6set version = 20230802
     7set mode = trash.errors
     8
     9set srchost = (ipp100 ipp108 ipp112 ipp114)
     10set srcvol  = (     0      0      1      0)
     11set tgthost = (ipp161 ipp161 ipp162 ipp162)
     12set tgtvol  = (     0      1      0      1)
     13
     14set mydir = /data/ipphome1.0/home/eugene/rebalance.20230802
     15
     16if ($#argv == 0) then
     17  echo "USAGE: $program launch"
     18  echo "USAGE: $program run (Nentry)"
     19  echo "   eg: $program run 1"
     20  exit 2
     21endif
     22
     23if ("$1" == "launch") then
     24
     25  # NOTE: the insert jobs run on the target machines, not source machines
     26
     27  set i = 1
     28  while ($i <= $#srchost)
     29    echo ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     30         ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     31    @ i++
    1432  end
    1533  exit 0
    1634endif
    1735
    18 set run = v0
    19 set version = 20220922
     36if ("$1" == "run") then
     37  if ($#argv != 2) then
     38    echo "USAGE: $program run (Nentry)"
     39    echo "   eg: $program run 1"
     40    exit 2
     41  endif
    2042
    21 set myhost = `hostname`
    22 set Nhost = `hostname | sed s/ipp//`
     43  set N = $2
    2344
    24 set target = NONE
    25 switch ($myhost)
    26   # total of 23TB
    27   case ipp100
    28   case ipp101
    29   case ipp123
    30   set target = ipp153
    31   breaksw;
     45  set hn = $srchost[$N]
     46  set hv = $srcvol[$N]
     47  set tn = $tgthost[$N]
     48  set tv = $tgtvol[$N]
    3249
    33   # total of 35TB
    34   case ipp102
    35   case ipp104
    36   case ipp124
    37   case ipp136
    38   set target = ipp154
    39   breaksw;
     50  set myhost = `hostname`
     51  if ($hn != $myhost) then
     52    echo "ERROR: need to run $mode on the source host ($hn vs $myhost)"
     53    exit 3
     54  endif
    4055
    41   # total of 35TB
    42   case ipp105
    43   case ipp108
    44   case ipp125
    45   case ipp137
    46   set target = ipp155
    47   breaksw;
     56  echo "running $program on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
     57  mkdir -p $hn.$hv
    4858
    49   # total of 23TB
    50   case ipp112
    51   case ipp114
    52   case ipp126
    53   set target = ipp156
    54   breaksw;
     59  grep ERROR /data/$hn.$hv/nebulous/??/rebalance/check.trash.$version.log >& $hn.$hv/errors.trash.$version.$run &
    5560
    56   # total of 38TB
    57   case ipp115
    58   case ipp117
    59   case ipp134
    60   case ipp139
    61   set target = ipp157
    62   breaksw;
    63 endsw
    64 
    65 if ("$target" == "NONE") then
    66   echo "need target"
    67   exit 2
     61  exit 0
    6862endif
    69 
    70 set v = 0 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/check.trash.$version.log >& $h.$v/errors.trash.$version.$run &
    71 set v = 1 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/check.trash.$version.log >& $h.$v/errors.trash.$version.$run &
    72 
Note: See TracChangeset for help on using the changeset viewer.