mgmt34.sim 4.9 KB
Newer Older
S
slguan 已提交
1 2
system sh/stop_dnodes.sh

S
slguan 已提交
3 4 5 6
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
S
slguan 已提交
7

8 9 10 11
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 3
S
slguan 已提交
12 13

print ============== step1
S
Shengliang Guan 已提交
14
system sh/exec.sh -n dnode1 -s start
S
slguan 已提交
15 16 17
sql connect

sql show mnodes
S
slguan 已提交
18 19 20 21
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data3_3
if $data2_1 != master then
S
slguan 已提交
22 23
  return -1
endi
S
scripts  
Shengliang Guan 已提交
24
if $data3_2 != null then
S
slguan 已提交
25 26
  return -1
endi
S
scripts  
Shengliang Guan 已提交
27
if $data3_3 != null then
S
slguan 已提交
28 29 30 31
  return -1
endi

print ============== step2
S
Shengliang Guan 已提交
32
system sh/exec.sh -n dnode2 -s start
S
slguan 已提交
33
sql create dnode $hostname2
S
Shengliang Guan 已提交
34 35 36 37 38 39 40
$x = 0
step2: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi
S
slguan 已提交
41 42

sql show mnodes
S
slguan 已提交
43 44 45 46
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
47 48 49 50
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
51 52

if $dnode1Role != master then
S
Shengliang Guan 已提交
53
  goto step2
S
slguan 已提交
54 55
endi
if $dnode2Role != slave then
S
Shengliang Guan 已提交
56
  goto step2
S
slguan 已提交
57
endi
S
scripts  
Shengliang Guan 已提交
58
if $dnode3Role != null then
S
Shengliang Guan 已提交
59
  goto step2
S
slguan 已提交
60
endi
S
scripts  
Shengliang Guan 已提交
61
if $dnode4Role != null then
S
Shengliang Guan 已提交
62
  goto step2
S
slguan 已提交
63 64 65
endi

print ============== step3
S
Shengliang Guan 已提交
66
system sh/exec.sh -n dnode3 -s start
S
slguan 已提交
67
sql create dnode $hostname3
S
Shengliang Guan 已提交
68 69 70 71 72 73 74 75

$x = 0
step3: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi
S
slguan 已提交
76 77

sql show mnodes
S
slguan 已提交
78 79 80 81
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
82 83 84 85
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
86 87

if $dnode1Role != master then
S
Shengliang Guan 已提交
88
  goto step3
S
slguan 已提交
89 90
endi
if $dnode2Role != slave then
S
Shengliang Guan 已提交
91
  goto step3
S
slguan 已提交
92 93
endi
if $dnode3Role != slave then
S
Shengliang Guan 已提交
94
  goto step3
S
slguan 已提交
95
endi
S
scripts  
Shengliang Guan 已提交
96
if $dnode4Role != null then
S
Shengliang Guan 已提交
97
  goto step3
S
slguan 已提交
98 99 100 101
endi


print ============== step4
S
Shengliang Guan 已提交
102
system sh/exec.sh -n dnode4 -s start
S
slguan 已提交
103
sql create dnode $hostname4
S
Shengliang Guan 已提交
104 105 106 107 108 109 110
$x = 0
step4: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi
S
slguan 已提交
111 112

sql show mnodes
S
slguan 已提交
113 114 115 116
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
117 118 119 120
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
121 122

if $dnode1Role != master then
S
Shengliang Guan 已提交
123
  goto step4
S
slguan 已提交
124 125
endi
if $dnode2Role != slave then
S
Shengliang Guan 已提交
126
  goto step4
S
slguan 已提交
127 128
endi
if $dnode3Role != slave then
S
Shengliang Guan 已提交
129
  goto step4
S
slguan 已提交
130
endi
S
scripts  
Shengliang Guan 已提交
131
if $dnode4Role != null then
S
Shengliang Guan 已提交
132
  goto step4
S
slguan 已提交
133 134 135
endi

print ============== step5
S
slguan 已提交
136
sql drop dnode $hostname2
S
Shengliang Guan 已提交
137 138 139 140 141 142 143
$x = 0
step5: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi
S
slguan 已提交
144 145

sql show mnodes
S
slguan 已提交
146 147 148 149
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
150 151 152 153
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
154 155

if $dnode1Role != master then
S
Shengliang Guan 已提交
156
  goto step5
S
slguan 已提交
157
endi
S
scripts  
Shengliang Guan 已提交
158
if $dnode2Role != null then
S
Shengliang Guan 已提交
159
  goto step5
S
slguan 已提交
160 161
endi
if $dnode3Role != slave then
S
Shengliang Guan 已提交
162
  goto step5
S
slguan 已提交
163 164
endi
if $dnode4Role != slave then
S
Shengliang Guan 已提交
165
  goto step5
S
slguan 已提交
166 167
endi

S
Shengliang Guan 已提交
168
system sh/exec.sh -n dnode2 -s stop
S
slguan 已提交
169
system sh/deploy.sh -n dnode2 -i 2
170
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
S
Shengliang Guan 已提交
171
system sh/exec.sh -n dnode2 -s start
S
slguan 已提交
172 173

print ============== step6
S
slguan 已提交
174
sql create dnode $hostname2
S
Shengliang Guan 已提交
175 176 177 178 179 180 181
$x = 0
step6: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi
S
slguan 已提交
182 183

sql show mnodes
S
slguan 已提交
184 185 186 187
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
188 189 190 191
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
192 193

if $dnode1Role != master then
S
Shengliang Guan 已提交
194
  goto step6
S
slguan 已提交
195
endi
S
scripts  
Shengliang Guan 已提交
196
if $dnode2Role != null then
S
Shengliang Guan 已提交
197
  goto step6
S
slguan 已提交
198 199
endi
if $dnode3Role != slave then
S
Shengliang Guan 已提交
200
  goto step6
S
slguan 已提交
201 202
endi
if $dnode4Role != slave then
S
Shengliang Guan 已提交
203
  goto step6
S
slguan 已提交
204 205 206
endi

print ============== step7
S
Shengliang Guan 已提交
207
system sh/exec.sh -n dnode1 -s stop
S
Shengliang Guan 已提交
208 209 210 211 212 213 214
$x = 0
step7: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi
S
slguan 已提交
215

S
Shengliang Guan 已提交
216
sql show mnodes -x step7
S
slguan 已提交
217 218 219 220
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
221 222 223 224
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
225

226
if $dnode1Role != offline then
S
Shengliang Guan 已提交
227
  goto step7
S
slguan 已提交
228 229 230
endi

print ============== step8
S
slguan 已提交
231
sql drop dnode $hostname1
S
Shengliang Guan 已提交
232 233 234 235 236 237
step8: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi
S
slguan 已提交
238

S
Shengliang Guan 已提交
239
sql show mnodes -x step8
S
slguan 已提交
240
$dnode1Role = $data2_1
S
slguan 已提交
241
$dnode2Role = $data2_5
S
slguan 已提交
242 243
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
244 245 246 247
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
248

S
scripts  
Shengliang Guan 已提交
249
if $dnode1Role != null then
S
Shengliang Guan 已提交
250
  goto step8
S
slguan 已提交
251 252
endi
if $dnode2Role != slave then
S
Shengliang Guan 已提交
253
  goto step8
S
slguan 已提交
254 255 256 257 258 259 260 261
endi
#if $dnode3Role != master then
#  return -1
#endi
#if $dnode4Role != slave then
#  return -1
#endi

S
Shengliang Guan 已提交
262 263 264 265 266 267 268 269
system sh/exec.sh -n dnode1 -s stop  -x SIGINT
system sh/exec.sh -n dnode2 -s stop  -x SIGINT
system sh/exec.sh -n dnode3 -s stop  -x SIGINT
system sh/exec.sh -n dnode4 -s stop  -x SIGINT
system sh/exec.sh -n dnode5 -s stop  -x SIGINT
system sh/exec.sh -n dnode6 -s stop  -x SIGINT
system sh/exec.sh -n dnode7 -s stop  -x SIGINT
system sh/exec.sh -n dnode8 -s stop  -x SIGINT