IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 29, 2023, 9:11:20 AM (3 years ago)
Author:
eugene
Message:

making rebalance scripts a little easier to modify for different machines

File:
1 edited

Legend:

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

    r42314 r42534  
    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"
     3set program = `basename $0`
    44
    5 set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
     5set run = v0
     6set version = 20230802
     7set mode = insert
    68
    7 if ($#argv == 1) then
    8   if ("$1" != "launch") then
    9     echo "USAGE: launch.insert.check.errors.sh launch"
    10     exit 2
    11   endif
    12   foreach f ($list)
    13     echo ssh -f $f "cd $mydir && ./launch.insert.check.errors.sh"
    14          ssh -f $f "cd $mydir && ./launch.insert.check.errors.sh"
     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++
    1532  end
    1633  exit 0
    1734endif
    1835
    19 set run = v0
    20 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
    2142
    22 set myhost = `hostname`
    23 set Nhost = `hostname | sed s/ipp//`
     43  set N = $2
    2444
    25 # ipp100 - ipp117 (10 total) need to have  ~7TB moved
    26 # ipp123 - ipp126 ( 4 total) need to have  ~9TB moved
    27 # ipp134 - ipp139 ( 4 total) need to have ~12TB moved
     45  set hn = $srchost[$N]
     46  set hv = $srcvol[$N]
     47  set tn = $tgthost[$N]
     48  set tv = $tgtvol[$N]
    2849
    29 set target = NONE
    30 switch ($myhost)
    31   # total of 23TB
    32   case ipp100
    33   case ipp101
    34   case ipp123
    35   set target = ipp153
    36   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
    3755
    38   # total of 35TB
    39   case ipp102
    40   case ipp104
    41   case ipp124
    42   case ipp136
    43   set target = ipp154
    44   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
    4558
    46   # total of 35TB
    47   case ipp105
    48   case ipp108
    49   case ipp125
    50   case ipp137
    51   set target = ipp155
    52   breaksw;
     59  grep ERROR /data/$hn.$hv/nebulous/??/rebalance/movefiles.$version.chk >& $hn.$hv/errors.insert.check.$version.$run &
    5360
    54   # total of 23TB
    55   case ipp112
    56   case ipp114
    57   case ipp126
    58   set target = ipp156
    59   breaksw;
    60 
    61   # total of 38TB
    62   case ipp115
    63   case ipp117
    64   case ipp134
    65   case ipp139
    66   set target = ipp157
    67   breaksw;
    68 endsw
    69 
    70 if ("$target" == "NONE") then
    71   echo "need target"
    72   exit 2
     61  exit 0
    7362endif
    74 
    75 set v = 0 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/movefiles.$version.chk >& $h.$v/errors.insert.check.$version.$run &
    76 set v = 1 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/movefiles.$version.chk >& $h.$v/errors.insert.check.$version.$run &
Note: See TracChangeset for help on using the changeset viewer.