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

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

system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10

S
slguan 已提交
11 12 13 14
system sh/cfg.sh -n dnode1 -c balanceInterval -v 5
system sh/cfg.sh -n dnode2 -c balanceInterval -v 5
system sh/cfg.sh -n dnode3 -c balanceInterval -v 5

S
Shengliang Guan 已提交
15 16 17
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
S
slguan 已提交
18

S
TD-1486  
Shengliang Guan 已提交
19 20 21 22 23 24 25

system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4


S
scripts  
slguan 已提交
26 27 28
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
S
slguan 已提交
29 30

print ========== step1
S
Shengliang Guan 已提交
31
system sh/exec.sh -n dnode1 -s start
S
slguan 已提交
32
sql connect
S
slguan 已提交
33
sql create dnode $hostname2
S
Shengliang Guan 已提交
34
system sh/exec.sh -n dnode2 -s start
H
Haojun Liao 已提交
35
sleep 2000
S
slguan 已提交
36

R
scripts  
root 已提交
37
sql create database d1 replica 2 
S
slguan 已提交
38
sql create table d1.t1(ts timestamp, i int)
S
scripts  
Shengliang Guan 已提交
39
sql insert into d1.t1 values(1588262400001, 1)
S
slguan 已提交
40 41

sql show dnodes
S
slguan 已提交
42 43 44 45
print dnode1 $data4_1
print dnode1 $data4_2

if $data4_1 != ready then
S
slguan 已提交
46 47
  return -1
endi
S
slguan 已提交
48
if $data4_2 != ready then
S
slguan 已提交
49 50 51 52
  return -1
endi

print ========== step2
S
Shengliang Guan 已提交
53
system sh/exec.sh -n dnode2 -s stop -x SIGINT
S
slguan 已提交
54
sleep 8000
S
slguan 已提交
55 56

sql show dnodes
S
slguan 已提交
57 58 59 60
print dnode1 $data4_1
print dnode1 $data4_2

if $data4_1 != ready then
S
slguan 已提交
61 62
  return -1
endi
S
slguan 已提交
63
if $data4_2 != offline then
S
slguan 已提交
64 65 66 67
  return -1
endi

print ========== step3
S
slguan 已提交
68
sleep 10000
S
slguan 已提交
69 70

sql show dnodes
S
slguan 已提交
71 72 73 74
print dnode1 $data4_1
print dnode1 $data4_2

if $data4_1 != ready then
S
slguan 已提交
75 76
  return -1
endi
S
slguan 已提交
77
if $data4_2 != dropping then
S
slguan 已提交
78 79 80 81
  return -1
endi

print ========== step4
S
slguan 已提交
82
sql create dnode $hostname3
S
Shengliang Guan 已提交
83 84
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode2 -s start
S
slguan 已提交
85
sql drop dnode $hostname2
S
slguan 已提交
86

H
Haojun Liao 已提交
87
sleep 3000
S
slguan 已提交
88 89 90
$x = 0
show4: 
	$x = $x + 1
H
Haojun Liao 已提交
91
	sleep 3000
S
scripts  
Shengliang Guan 已提交
92
	if $x == 10 then 
S
slguan 已提交
93 94 95 96
	  return -1
	endi

sql show dnodes
S
scripts  
Shengliang Guan 已提交
97 98 99
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
S
slguan 已提交
100 101
if $data4_1 != ready then
  goto show4
S
slguan 已提交
102
endi
S
scripts  
Shengliang Guan 已提交
103
if $data4_2 != null then
S
slguan 已提交
104
  goto show4
S
slguan 已提交
105
endi
S
slguan 已提交
106 107
if $data4_3 != ready then
  goto show4
S
slguan 已提交
108 109 110
endi

print ======================== step5
S
slguan 已提交
111 112 113
sql reset query cache
sleep 1000

S
slguan 已提交
114 115 116 117 118
sql select * from d1.t1
if $rows != 1 then
  return -1
endi

S
Shengliang Guan 已提交
119 120 121 122 123 124 125 126
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