IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 3, 2023, 3:00:48 PM (3 years ago)
Author:
eugene
Message:

updating rebalacne scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.errors.sh

    r42314 r42562  
    11#!/bin/csh
    22
    3 # src machines:
    4 set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
     3set program = `basename $0`
    54
    6 set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
     5set run = v0
     6set version = 20230802
     7set mode = insert
    78
    8 if ($#argv == 1) then
    9   if ("$1" != "launch") then
    10     echo "USAGE: launch.insert.errors.sh launch"
    11     exit 2
    12   endif
    13   foreach f ($list)
    14     echo ssh -f $f "cd $mydir && ./launch.insert.errors.sh"
    15          ssh -f $f "cd $mydir && ./launch.insert.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++
    1632  end
    1733  exit 0
    1834endif
    1935
    20 set run = v0
    21 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
    2242
    23 set myhost = `hostname`
    24 set Nhost = `hostname | sed s/ipp//`
     43  set N = $2
    2544
    26 # ipp100 - ipp117 (10 total) need to have  ~7TB moved
    27 # ipp123 - ipp126 ( 4 total) need to have  ~9TB moved
    28 # 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]
    2949
    30 set target = NONE
    31 switch ($myhost)
    32   # total of 23TB
    33   case ipp100
    34   case ipp101
    35   case ipp123
    36   set target = ipp153
    37   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
    3855
    39   # total of 35TB
    40   case ipp102
    41   case ipp104
    42   case ipp124
    43   case ipp136
    44   set target = ipp154
    45   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
    4658
    47   # total of 35TB
    48   case ipp105
    49   case ipp108
    50   case ipp125
    51   case ipp137
    52   set target = ipp155
    53   breaksw;
    54 
    55   # total of 23TB
    56   case ipp112
    57   case ipp114
    58   case ipp126
    59   set target = ipp156
    60   breaksw;
    61 
    62   # total of 38TB
    63   case ipp115
    64   case ipp117
    65   case ipp134
    66   case ipp139
    67   set target = ipp157
    68   breaksw;
    69 endsw
    70 
    71 if ("$target" == "NONE") then
    72   echo "need target"
    73   exit 2
     59  grep ERROR /data/$hn.$hv/nebulous/??/rebalance/insert.$version.log >& $hn.$hv/errors.insert.$version.$run &
     60  exit 0
    7461endif
    75 
    76 set v = 0 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/insert.$version.log >& $h.$v/errors.insert.$version.$run &
    77 set v = 1 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/insert.$version.log >& $h.$v/errors.insert.$version.$run &
    78 
    79 # e.g.: ssh -f ipp127 "cd `pwd` && ./launch.insert.errors.sh"
Note: See TracChangeset for help on using the changeset viewer.