maxvnodes.sim 2.0 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
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb     -v $totalVnodes
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
16
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb    -v $totalVnodes
17

S
slguan 已提交
18 19

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

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

$x = 0
S
scripts  
Shengliang Guan 已提交
30
while $x < $totalRows
S
slguan 已提交
31 32 33 34 35 36 37 38
  $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 已提交
39
if $rows != $totalRows then
S
slguan 已提交
40 41 42 43
  return -1
endi  

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

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

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

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

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

81 82
return

S
Shengliang Guan 已提交
83 84 85 86 87 88 89 90
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