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/ip.sh -i 4 -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/deploy.sh -n dnode4 -m 192.168.0.1 -i 192.168.0.4 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 system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.2 system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2 system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.2 system sh/cfg.sh -n dnode4 -c secondIp -v 192.168.0.2 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect sql create dnode 192.168.0.2 system sh/exec.sh -n dnode2 -s start sql create database ir2db replica 2 days 7 sql use ir2db sql create table tb(ts timestamp, i int) print ================= step1 sql import into tb values(1520000010000, 10000) sql select * from tb; if $rows != 1 then return -1 endi print ================= step2 sql insert into tb values(1520000008000, 8000) sql select * from tb; if $rows != 1 then return -1 endi print ================= step3 sql insert into tb values(1520000020000, 20000) sql select * from tb; print $rows if $rows != 2 then return -1 endi print ================= step4 sql import into tb values(1520000009000, 9000) sql import into tb values(1520000015000, 15000) sql import into tb values(1520000030000, 30000) sql select * from tb; if $rows != 5 then return -1 endi print ================= step5 sql insert into tb values(1520000008000, 8000) sql insert into tb values(1520000014000, 14000) sql insert into tb values(1520000025000, 25000) sql insert into tb values(1520000040000, 40000) sql select * from tb; if $rows != 6 then return -1 endi print ================= step6 sql import into tb values(1520000007000, 7000) sql import into tb values(1520000012000, 12000) sql import into tb values(1520000023000, 23000) sql import into tb values(1520000034000, 34000) sql import into tb values(1520000050000, 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 5000 system sh/exec.sh -n dnode1 -s start sleep 5000 sql select * from tb; if $rows != 11 then return -1 endi print ================= step7 sql import into tb values(1520000007001, 7001) sql import into tb values(1520000012001, 12001) sql import into tb values(1520000023001, 23001) sql import into tb values(1520000034001, 34001) sql import into tb values(1520000050001, 50001) sql select * from tb; if $rows != 16 then return -1 endi print ================= step8 sql insert into tb values(1520000008002, 8002) sql insert into tb values(1520000014002, 14002) sql insert into tb values(1520000025002, 25002) sql insert into tb values(1520000060000, 60000) sql select * from tb; if $rows != 17 then return -1 endi print ================= step9 #1520000000000 #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+1d, 50001) #sql import into tb values(now+2d, 50001) #sql import into tb values(now+6d, 50001) #sql import into tb values(now+8d, 50002) #sql import into tb values(now+10d, 50003) #sql import into tb values(now+12d, 50004) #sql import into tb values(now+14d, 50001) #sql import into tb values(now+16d, 500051) sql import into tb values(1517408000000, 7003) sql import into tb values(1518272000000, 34003) sql import into tb values(1519136000000, 34003) sql import into tb values(1519568000000, 34003) sql import into tb values(1519654400000, 50001) sql import into tb values(1519827200000, 50001) sql import into tb values(1520345600000, 50001) sql import into tb values(1520691200000, 50002) sql import into tb values(1520864000000, 50003) sql import into tb values(1521900800000, 50004) sql import into tb values(1523110400000, 50001) sql import into tb values(1521382400000, 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 5000 system sh/exec.sh -n dnode1 -s start sleep 5000 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 import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003) sql select * from tb; if $rows != 34 then return -1 endi print ================= step12 #1520000000000 #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 import into tb values(1518358400000, 7003) (1518444800000, 7003) (1518531200000, 7003) (1518617600000, 7003) (1518704000000, 7003) (1518790400000, 7003) (1518876800000, 7003) (1518963200000, 7003) (1519049600000, 7003) sql select * from tb; if $rows != 43 then return -1 endi print ================= step13 system sh/exec.sh -n dnode2 -s stop sleep 5000 print ================= step14 #1520000000000 #sql import into tb values(now-48d, 34003) #sql import into tb values(now-38d, 50001) #sql import into tb values(now-28d, 50001) sql import into tb values(1515852800001, 34003) sql import into tb values(1516716800000, 50001) sql import into tb values(1517580800000, 50001) sql select * from tb; if $rows != 46 then return -1 endi print ================= step15 system sh/exec.sh -n dnode2 -s start sleep 8000 system sh/exec.sh -n dnode1 -s stop sleep 10000 if $rows != 46 then return -1 endi