replica3.sim 1.2 KB
Newer Older
S
slguan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode2 -c commitLog -v 0
system sh/cfg.sh -n dnode3 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c numofMpeers -v 3
system sh/cfg.sh -n dnode2 -c numofMpeers -v 3
system sh/cfg.sh -n dnode3 -c numofMpeers -v 3

system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode 192.168.0.2
sql create dnode 192.168.0.3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start

sql create database db replica 3 
sql use db
sql create table mt (ts timestamp, f1 float, f2 float, f3 float, f4 float, f5 float, f6 float, f7 float, f8 float, f9 float, f10 float) tags (t1 int, t2 int)
sql create table tb1 using mt tags(1, 2)
sleep 3001

$x = 1000
while $x < 2000
  sql insert into tb1 values (now+1s , $x , $x , $x , $x , $x , $x , $x , $x , $x , $x ) 
  $x = $x + 1
endw 


system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop