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

S
scripts  
Shengliang Guan 已提交
3 4 5
$totalVnodes = 20
$minVnodes = 10
$maxVnodes = 10
S
scripts  
Shengliang Guan 已提交
6 7 8
$maxTables = 4
$totalRows = $totalVnodes * $maxTables

S
slguan 已提交
9
system sh/deploy.sh -n dnode1 -i 1
10
system sh/cfg.sh -n dnode1 -c walLevel            -v 2
S
scripts  
Shengliang Guan 已提交
11
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes    -v $totalVnodes
12 13 14 15
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c walLevel            -v 2
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes    -v $totalVnodes

S
slguan 已提交
16 17

print ==========  prepare data
S
scripts  
Shengliang Guan 已提交
18 19
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
S
slguan 已提交
20
sql connect 
S
scripts  
Shengliang Guan 已提交
21
sql create database db blocks 2 cache 1 maxTables $maxTables
S
slguan 已提交
22 23 24 25 26 27
sql use db

print ==========  step1
sql create table mt (ts timestamp, tbcol int) TAGS(tgcol int)

$x = 0
S
scripts  
Shengliang Guan 已提交
28
while $x < $totalRows
S
slguan 已提交
29 30 31 32 33 34 35 36
  $tb = t . $x
  sql create table $tb using mt tags( $x )
  sql insert into $tb values (now, $x ) 
  $x = $x + 1
endw 

print ========== step2
sql select * from mt
S
scripts  
Shengliang Guan 已提交
37
if $rows != $totalRows then
S
slguan 已提交
38 39 40 41
  return -1
endi  

sql select count(*) from mt
S
scripts  
Shengliang Guan 已提交
42
if $data00 != $totalRows then
S
slguan 已提交
43 44 45
  return -1
endi  

46
print ==========  step3
S
slguan 已提交
47
sql create dnode $hostname2
S
scripts  
Shengliang Guan 已提交
48
system sh/exec_up.sh -n dnode2 -s start
S
slguan 已提交
49 50 51 52 53 54 55 56 57 58

$x = 0
show3: 
	$x = $x + 1
	sleep 3000
	if $x == 1000 then 
		return -1
	endi
	
sql show dnodes
S
scripts  
Shengliang Guan 已提交
59 60 61
print dnode1 openvnodes $data2_1
print dnode2 openvnodes $data2_2
if $data2_1 != $minVnodes then
S
slguan 已提交
62 63
	goto show3
endi
S
scripts  
Shengliang Guan 已提交
64
if $data2_2 != $maxVnodes then
S
slguan 已提交
65 66 67 68 69
	goto show3
endi

print ========== step4
sql select * from mt
S
scripts  
Shengliang Guan 已提交
70
if $rows != $totalRows then
S
slguan 已提交
71 72 73 74
  return -1
endi  

sql select count(*) from mt
S
scripts  
Shengliang Guan 已提交
75
if $data00 != $totalRows then
S
slguan 已提交
76 77
  return -1
endi  
guanshengliang's avatar
scripts  
guanshengliang 已提交
78

79 80
return

guanshengliang's avatar
scripts  
guanshengliang 已提交
81 82 83 84 85 86 87 88
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