replica1.sim 4.3 KB
Newer Older
S
slguan 已提交
1 2 3
system sh/stop_dnodes.sh


S
slguan 已提交
4 5 6 7 8 9 10 11




system sh/deploy.sh -n dnode1 -i 1
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
slguan 已提交
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171

system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 1

system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 10
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 10
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 10

system sh/cfg.sh -n dnode1 -c sessionsPerVnode -v 2000
system sh/cfg.sh -n dnode2 -c sessionsPerVnode -v 2000
system sh/cfg.sh -n dnode3 -c sessionsPerVnode -v 2000
system sh/cfg.sh -n dnode4 -c sessionsPerVnode -v 2000

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 dnode4 -c commitlog -v 0

print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect

sql create database ir1db days 7
sql use ir1db
sql create table tb(ts timestamp, i int)

print ================= step1
sql import into tb values(now+10000a, 10000)
sql select * from tb;
if $rows != 1 then 
  return -1
endi

print ================= step2
sql insert into tb values(now+8000a, 8000)
sql select * from tb;
if $rows != 1 then 
  return -1
endi

print ================= step3
sql insert into tb values(now+20000a, 20000)
sql select * from tb;
if $rows != 2 then 
  return -1
endi

print ================= step4
sql import into tb values(now+8000a, 9000)
sql import into tb values(now+15000a, 15000)
sql import into tb values(now+30000a, 30000)
sql select * from tb;
if $rows != 5 then 
  return -1
endi

print ================= step5
sql insert into tb values(now+8000a, 8000)
sql insert into tb values(now+14000a, 14000)
sql insert into tb values(now+25000a, 25000)
sql insert into tb values(now+40000a, 40000)
sql select * from tb;
if $rows != 6 then 
  return -1
endi

print ================= step6
sql import into tb values(now+7000a, 7000)
sql import into tb values(now+12000a, 12000)
sql import into tb values(now+23000a, 23000)
sql import into tb values(now+34000a, 34000)
sql import into tb values(now+50000a, 50000)
sql select * from tb;
if $rows != 11 then 
  return -1
endi

print ================== dnode restart
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 5000

sql use ir1db
sql select * from tb;
if $rows != 11 then 
  return -1
endi

print ================= step7
sql import into tb values(now+7001a, 7001)
sql import into tb values(now+12001a, 12001)
sql import into tb values(now+23001a, 23001)
sql import into tb values(now+34001a, 34001)
sql import into tb values(now+50001a, 50001)
sql select * from tb;
if $rows != 16 then 
  return -1
endi

print ================= step8
sql insert into tb values(now+8002a, 8002)
sql insert into tb values(now+14002a, 14002)
sql insert into tb values(now+25002a, 25002)
sql insert into tb values(now+200000a, 60000)
sql select * from tb;
if $rows != 17 then 
  return -1
endi

print ================= step9
sql import into tb values(now-30d, 7003)
sql import into tb values(now-20d, 34003)
sql import into tb values(now-10d, 34003)
sql import into tb values(now-5d, 34003)
sql import into tb values(now+1m, 50001)
sql import into tb values(now+2m, 50001)
sql import into tb values(now+3m, 50001)
sql import into tb values(now+4m, 50002)
sql import into tb values(now+5m, 50003)
sql import into tb values(now+6m, 50004)
sql import into tb values(now+7m, 50001)
sql import into tb values(now+8m, 500051)
sql select * from tb;
if $rows != 29 then 
  return -1
endi

print ================= step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 5000

sql use ir1db
sql select * from tb;
if $rows != 29 then 
  return -1
endi

print ================= step11
sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003)
sql select * from tb;
if $rows != 34 then 
  return -1
endi

sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003)
sql select * from tb;
if $rows != 43 then 
  return -1
endi