mgmt33.sim 3.4 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 3
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
S
slguan 已提交
9 10

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

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

print ============== step2
S
Shengliang Guan 已提交
29
system sh/exec.sh -n dnode2 -s start
S
slguan 已提交
30
sql create dnode $hostname2
S
slguan 已提交
31 32 33
sleep 8000

sql show mnodes
S
slguan 已提交
34 35 36
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
S
slguan 已提交
37 38 39
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
40 41 42 43 44 45 46

if $dnode1Role != master then
  return -1
endi
if $dnode2Role != slave then
  return -1
endi
S
scripts  
Shengliang Guan 已提交
47
if $dnode3Role != null then
S
slguan 已提交
48 49 50 51
  return -1
endi

print ============== step3
S
Shengliang Guan 已提交
52
system sh/exec.sh -n dnode3 -s start
S
slguan 已提交
53
sql create dnode $hostname3
S
slguan 已提交
54 55 56
sleep 8000

sql show mnodes
S
slguan 已提交
57 58 59
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
S
slguan 已提交
60 61 62
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
63 64 65 66 67 68 69 70 71 72 73 74

if $dnode1Role != master then
  return -1
endi
if $dnode2Role != slave then
  return -1
endi
if $dnode3Role != slave then
  return -1
endi

print ============== step4
S
slguan 已提交
75
sql drop dnode $hostname2
S
slguan 已提交
76 77 78
sleep 8000

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

if $dnode1Role != master then
  return -1
endi
S
scripts  
Shengliang Guan 已提交
89
if $dnode2Role != null then
S
slguan 已提交
90 91 92 93 94 95
  return -1
endi
if $dnode3Role != slave then
  return -1
endi

S
Shengliang Guan 已提交
96
system sh/exec.sh -n dnode2 -s stop
S
slguan 已提交
97 98
sleep 3000

S
slguan 已提交
99
system sh/deploy.sh -n dnode2 -i 2
100
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
S
Shengliang Guan 已提交
101
system sh/exec.sh -n dnode2 -s start
S
slguan 已提交
102 103

print ============== step5
S
slguan 已提交
104
sql create dnode $hostname2
S
slguan 已提交
105 106 107
sleep 8000

sql show mnodes
S
slguan 已提交
108
$dnode1Role = $data2_1
S
slguan 已提交
109
$dnode2Role = $data2_4
S
slguan 已提交
110
$dnode3Role = $data2_3
S
slguan 已提交
111 112 113
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
114 115 116 117 118 119 120 121 122 123 124 125

if $dnode1Role != master then
  return -1
endi
if $dnode2Role != slave then
  return -1
endi
if $dnode3Role != slave then
  return -1
endi

print ============== step6
S
Shengliang Guan 已提交
126
system sh/exec.sh -n dnode1 -s stop
S
slguan 已提交
127 128 129
sleep 10000

sql show mnodes
S
slguan 已提交
130
$dnode1Role = $data2_1
S
slguan 已提交
131
$dnode2Role = $data2_4
S
slguan 已提交
132
$dnode3Role = $data2_3
S
slguan 已提交
133 134 135
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
136

137
if $dnode1Role != offline then
S
slguan 已提交
138 139 140 141 142 143 144 145 146 147
  return -1
endi
#if $dnode2Role != master then
#  return -1
#endi
#if $dnode3Role != slave then
#  return -1
#endi

print ============== step7
S
slguan 已提交
148
sql drop dnode $hostname1
S
slguan 已提交
149 150 151
sleep 8000

sql show mnodes
S
slguan 已提交
152 153 154
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
S
slguan 已提交
155 156 157
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
158

S
scripts  
Shengliang Guan 已提交
159
if $dnode1Role != null then
S
slguan 已提交
160 161 162 163 164 165 166 167 168
  return -1
endi
#if $dnode2Role != master then
#  return -1
#endi
#if $dnode3Role != slave then
#  return -1
#endi

S
Shengliang Guan 已提交
169 170 171 172 173 174 175 176
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