mgmtr2.sim 2.0 KB
Newer Older
S
slguan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
system sh/stop_dnodes.sh

system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up

system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3

system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2

system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.3
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.3
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.3

print ============== step1
S
slguan 已提交
20
system sh/exec_up.sh -n dnode1 -s start
S
slguan 已提交
21 22 23 24
sql connect
sleep 3000

sql show mnodes
S
slguan 已提交
25 26 27
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
S
slguan 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role

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

print ============== step2
sql create dnode 192.168.0.2 
sleep 1700
sql create dnode 192.168.0.3

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

S
slguan 已提交
50
system sh/exec_up.sh -n dnode2 -s start
S
slguan 已提交
51
sleep 1000
S
slguan 已提交
52
system sh/exec_up.sh -n dnode3 -s start
S
slguan 已提交
53 54

sleep 8000
S
slguan 已提交
55 56
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
S
slguan 已提交
57
sleep 4000
S
slguan 已提交
58 59
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
S
slguan 已提交
60
sleep 4000
S
slguan 已提交
61 62
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
S
slguan 已提交
63
sleep 4000
S
slguan 已提交
64 65
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
S
slguan 已提交
66 67 68 69

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

S
slguan 已提交
70 71 72
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
S
slguan 已提交
73 74 75 76 77 78 79 80 81 82 83 84 85
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role

if $dnode1Role != master then
  return -1
endi
if $rows != 2 then
  return -1
endi
if $dnode3Role != null then
  return -1
endi
S
slguan 已提交
86 87 88 89

system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop