mgmtr2.sim 2.0 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2 3 4
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
S
slguan 已提交
5

6 7 8
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
S
slguan 已提交
9 10

print ============== step1
S
slguan 已提交
11
system sh/exec_up.sh -n dnode1 -s start
S
slguan 已提交
12
sleep 3000
S
scripts  
Shengliang Guan 已提交
13
sql connect
S
slguan 已提交
14 15

sql show mnodes
S
slguan 已提交
16 17 18
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
S
slguan 已提交
19 20 21
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
22 23 24 25

if $dnode1Role != master then
  return -1
endi
S
scripts  
Shengliang Guan 已提交
26
if $dnode2Role != null then
S
slguan 已提交
27 28
  return -1
endi
S
scripts  
Shengliang Guan 已提交
29
if $dnode3Role != null then
S
slguan 已提交
30 31 32 33
  return -1
endi

print ============== step2
S
slguan 已提交
34 35
sql create dnode $hostname2 
sql create dnode $hostname3
S
slguan 已提交
36 37 38 39

print ============== step3
print ========= start dnode2 and dnode3

S
slguan 已提交
40
system sh/exec_up.sh -n dnode2 -s start
S
slguan 已提交
41
sleep 1000
S
slguan 已提交
42
system sh/exec_up.sh -n dnode3 -s start
S
slguan 已提交
43 44

sleep 8000
S
slguan 已提交
45 46
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
S
slguan 已提交
47
sleep 4000
S
slguan 已提交
48 49
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
S
slguan 已提交
50
sleep 4000
S
slguan 已提交
51 52
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
S
slguan 已提交
53
sleep 4000
S
slguan 已提交
54 55
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
S
slguan 已提交
56 57 58 59

print ============== step4
sql show mnodes

S
slguan 已提交
60 61 62
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
S
slguan 已提交
63 64 65
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
66 67 68 69

if $dnode1Role != master then
  return -1
endi
S
scripts  
Shengliang Guan 已提交
70
if $dnode2Role != slave then
S
slguan 已提交
71 72
  return -1
endi
S
scripts  
Shengliang Guan 已提交
73
if $dnode3Role != null then
S
slguan 已提交
74 75
  return -1
endi
S
slguan 已提交
76

guanshengliang's avatar
scripts  
guanshengliang 已提交
77 78 79 80 81 82 83 84
system sh/exec_up.sh -n dnode1 -s stop  -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop  -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop  -x SIGINT
system sh/exec_up.sh -n dnode4 -s stop  -x SIGINT
system sh/exec_up.sh -n dnode5 -s stop  -x SIGINT
system sh/exec_up.sh -n dnode6 -s stop  -x SIGINT
system sh/exec_up.sh -n dnode7 -s stop  -x SIGINT
system sh/exec_up.sh -n dnode8 -s stop  -x SIGINT