data.sim 1.9 KB
Newer Older
1 2
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
S
Shengliang Guan 已提交
3 4 5
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
S
Shengliang Guan 已提交
6 7 8
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode7 -i 7
S
Shengliang Guan 已提交
9
system sh/cfg.sh -n dnode1 -c supportVnodes -v 0
10
system sh/exec.sh -n dnode1 -s start
S
Shengliang Guan 已提交
11 12 13
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
14 15
sql connect

S
Shengliang Guan 已提交
16 17 18 19
print =============== step1: create dnodes
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
sql create dnode $hostname port 7400
S
Shengliang Guan 已提交
20 21 22
sql create dnode $hostname port 7500
sql create dnode $hostname port 7600
sql create dnode $hostname port 7700
S
Shengliang Guan 已提交
23 24 25 26 27 28 29 30 31

$x = 0
step1:
	$x = $x + 1
	sleep 1000
	if $x == 10 then
	  print ====> dnode not ready!
		return -1
	endi
X
Xiaoyu Wang 已提交
32
sql select * from information_schema.ins_dnodes
S
Shengliang Guan 已提交
33 34 35 36 37
print ===> rows: $rows 
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data30 $data31 $data32 $data33 $data24 $data35
S
Shengliang Guan 已提交
38
if $rows != 7 then
S
Shengliang Guan 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
  return -1
endi
if $data(1)[4] != ready then
  goto step1
endi
if $data(2)[4] != ready then
  goto step1
endi
if $data(3)[4] != ready then
  goto step1
endi
if $data(4)[4] != ready then
  goto step1
endi

S
Shengliang Guan 已提交
54
return 
S
Shengliang Guan 已提交
55
print =============== step2: create database
S
Shengliang Guan 已提交
56
sql create database db vgroups 33 replica 3
S
Shengliang Guan 已提交
57 58 59 60 61

sql use db;
sql create table stb (ts timestamp, c int) tags (t int);
sql create table t0 using stb tags (0);
sql insert into t0 values(now, 1);
X
Xiaoyu Wang 已提交
62 63
sql select * from information_schema.ins_stables where db_name = 'db';
sql select * from information_schema.ins_tables where db_name = 'db';
S
Shengliang Guan 已提交
64 65
sql show db.vgroups;

S
Shengliang Guan 已提交
66 67
system sh/exec.sh -n dnode2 -s stop

S
Shengliang Guan 已提交
68
return
69 70 71 72 73
print ======== start back
run_back tmp/back.sim

sleep 2000
return -1