check_cluster_cfg_para.sim 6.4 KB
Newer Older
H
Hui Li 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode7 -i 7


system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 15
system sh/cfg.sh -n dnode1 -c statusInterval -v 3
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
#system sh/cfg.sh -n dnode1 -c timezone -v ""
#system sh/cfg.sh -n dnode1 -c locale -v ""
#system sh/cfg.sh -n dnode1 -c charset -v ""
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10

######## dnode 2 the same with dnode1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 15
system sh/cfg.sh -n dnode2 -c statusInterval -v 3
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
#system sh/cfg.sh -n dnode2 -c timezone -v ""
#system sh/cfg.sh -n dnode2 -c locale -v ""
#system sh/cfg.sh -n dnode2 -c charset -v ""
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10

######## dnode 3 one para no same with dnode1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 15
system sh/cfg.sh -n dnode3 -c statusInterval -v 3
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
#system sh/cfg.sh -n dnode3 -c timezone -v ""
#system sh/cfg.sh -n dnode3 -c locale -v ""
#system sh/cfg.sh -n dnode3 -c charset -v ""
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10

######## dnode 4 one para no same with dnode1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 5
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 15
system sh/cfg.sh -n dnode4 -c statusInterval -v 3
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
#system sh/cfg.sh -n dnode4 -c timezone -v ""
#system sh/cfg.sh -n dnode4 -c locale -v ""
#system sh/cfg.sh -n dnode4 -c charset -v ""
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10

######## dnode 5 one para no same with dnode1
system sh/cfg.sh -n dnode5 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode5 -c offlineThreshold -v 16
system sh/cfg.sh -n dnode5 -c statusInterval -v 3
system sh/cfg.sh -n dnode5 -c arbitrator -v $arbitrator
#system sh/cfg.sh -n dnode5 -c timezone -v ""
#system sh/cfg.sh -n dnode5 -c locale -v ""
#system sh/cfg.sh -n dnode5 -c charset -v ""
system sh/cfg.sh -n dnode5 -c balanceInterval -v 10


######## dnode 6 one para no same with dnode1
system sh/cfg.sh -n dnode6 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode6 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode6 -c offlineThreshold -v 15 
system sh/cfg.sh -n dnode6 -c statusInterval -v 2
system sh/cfg.sh -n dnode6 -c arbitrator -v $arbitrator
#system sh/cfg.sh -n dnode6 -c timezone -v ""
#system sh/cfg.sh -n dnode6 -c locale -v ""
#system sh/cfg.sh -n dnode6 -c charset -v ""
system sh/cfg.sh -n dnode6 -c balanceInterval -v 10


######## dnode 7 one para no same with dnode1
system sh/cfg.sh -n dnode7 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode7 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode7 -c offlineThreshold -v 15
system sh/cfg.sh -n dnode7 -c statusInterval -v 3
system sh/cfg.sh -n dnode7 -c arbitrator -v "plum-VirtualBox:8001"
#system sh/cfg.sh -n dnode7 -c timezone -v ""
#system sh/cfg.sh -n dnode7 -c locale -v ""
#system sh/cfg.sh -n dnode7 -c charset -v ""
system sh/cfg.sh -n dnode7 -c balanceInterval -v 10

print ============== step0: start tarbitrator
system sh/exec_tarbitrator.sh -s start

print ============== step1: start dnode1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect

print ============== step2: start dnode2~7 and add into cluster 
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode5 -s start
system sh/exec.sh -n dnode6 -s start
system sh/exec.sh -n dnode7 -s start
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
sql create dnode $hostname5
sql create dnode $hostname6
sql create dnode $hostname7
sleep 10000

wait_dnode_created:
sql show dnodes
if $rows != 7 then
  sleep 2000
  goto wait_dnode_created
endi
print $data0_1  $data1_1  $data2_1  $data3_1  $data4_1
print $data0_2  $data1_2  $data2_2  $data3_2  $data4_2
print $data0_3  $data1_3  $data2_3  $data3_3  $data4_3
print $data0_4  $data1_4  $data2_4  $data3_4  $data4_4
print $data0_5  $data1_5  $data2_5  $data3_5  $data4_5
print $data0_6  $data1_6  $data2_6  $data3_6  $data4_6
print $data0_7  $data1_7  $data2_7  $data3_7  $data4_7
$dnode1Status = $data4_1  
$dnode2Status = $data4_2
$dnode3Status = $data4_3  
$dnode4Status = $data4_4 
$dnode5Status = $data4_5
$dnode6Status = $data4_6  
$dnode7Status = $data4_7 

if $dnode1Status != ready then
  return -1
endi
if $dnode2Status != ready then
  return -1
endi
if $dnode3Status != offline then
  return -1
endi
if $dnode4Status != offline then
  return -1
endi
if $dnode5Status != offline then
  return -1
endi
if $dnode6Status != offline then
  return -1
endi
if $dnode7Status != offline then
  return -1
endi

sleep 10000

wait_dnode_offline_overtime_dropped:
sql show dnodes
print $data0_1  $data1_1  $data2_1  $data3_1  $data4_1
print $data0_2  $data1_2  $data2_2  $data3_2  $data4_2
print $data0_3  $data1_3  $data2_3  $data3_3  $data4_3
print $data0_4  $data1_4  $data2_4  $data3_4  $data4_4
print $data0_5  $data1_5  $data2_5  $data3_5  $data4_5
print $data0_6  $data1_6  $data2_6  $data3_6  $data4_6
print $data0_7  $data1_7  $data2_7  $data3_7  $data4_7
if $rows != 2 then
  sleep 2000
  goto wait_dnode_offline_overtime_dropped
endi
print $data0_1  $data1_1  $data2_1  $data3_1  $data4_1
print $data0_2  $data1_2  $data2_2  $data3_2  $data4_2
print $data0_3  $data1_3  $data2_3  $data3_3  $data4_3
print $data0_4  $data1_4  $data2_4  $data3_4  $data4_4
print $data0_5  $data1_5  $data2_5  $data3_5  $data4_5
print $data0_6  $data1_6  $data2_6  $data3_6  $data4_6
print $data0_7  $data1_7  $data2_7  $data3_7  $data4_7
$dnode1Status = $data4_1  
$dnode2Status = $data4_2
$dnode3Status = $data4_3  
$dnode4Status = $data4_4 
$dnode5Status = $data4_5
$dnode6Status = $data4_6  
$dnode7Status = $data4_7 

if $dnode1Status != ready then
  return -1
endi
if $dnode2Status != ready then
  return -1
endi