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
11
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb     -v $totalVnodes
S
scripts  
Shengliang Guan 已提交
12
system sh/cfg.sh -n dnode1 -c balanceInterval     -v 1
13 14
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c walLevel            -v 2
15
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb    -v $totalVnodes
S
scripts  
Shengliang Guan 已提交
16
system sh/cfg.sh -n dnode2 -c balanceInterval     -v 1
S
slguan 已提交
17 18

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

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

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

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

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

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

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

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

80 81
return

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