[TD-2352]<test> trans data test for cluster
This commit is contained in:
parent
42e34d5365
commit
66b6a77db2
|
@ -385,3 +385,8 @@ cd ../../../debug; make
|
||||||
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
|
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
|
||||||
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
|
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
|
||||||
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
|
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
|
||||||
|
|
||||||
|
./test.sh -f general/connection/test_old_data.sim
|
||||||
|
./test.sh -f unique/dnode/datatrans_3node.sim
|
||||||
|
./test.sh -f unique/dnode/datatrans_3node_2.sim
|
||||||
|
|
||||||
|
|
|
@ -73,3 +73,7 @@
|
||||||
./test.sh -f general/stream/stream_restart.sim
|
./test.sh -f general/stream/stream_restart.sim
|
||||||
./test.sh -f general/stream/table_del.sim
|
./test.sh -f general/stream/table_del.sim
|
||||||
./test.sh -f general/stream/table_replica1_vnoden.sim
|
./test.sh -f general/stream/table_replica1_vnoden.sim
|
||||||
|
|
||||||
|
./test.sh -f general/connection/test_old_data.sim
|
||||||
|
./test.sh -f unique/dnode/datatrans_3node.sim
|
||||||
|
./test.sh -f unique/dnode/datatrans_3node_2.sim
|
|
@ -0,0 +1,47 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Executing move_dnode.sh"
|
||||||
|
|
||||||
|
SCRIPT_DIR=`dirname $0`
|
||||||
|
cd $SCRIPT_DIR/../
|
||||||
|
SCRIPT_DIR=`pwd`
|
||||||
|
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
||||||
|
|
||||||
|
IN_TDINTERNAL="community"
|
||||||
|
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
|
cd ../../..
|
||||||
|
else
|
||||||
|
cd ../../
|
||||||
|
fi
|
||||||
|
|
||||||
|
TAOS_DIR=`pwd`
|
||||||
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3`
|
||||||
|
else
|
||||||
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2`
|
||||||
|
fi
|
||||||
|
|
||||||
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
||||||
|
SIM_DIR=$TAOS_DIR/sim
|
||||||
|
|
||||||
|
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||||
|
|
||||||
|
if [ -d "$SIM_DIR/$2" ];then
|
||||||
|
rm -rf $SIM_DIR/$2
|
||||||
|
fi
|
||||||
|
mv $SIM_DIR/$1 $SIM_DIR/$2
|
||||||
|
|
||||||
|
if [[ $2 =~ "dnode2" ]];then
|
||||||
|
sed -i 's/serverPort 7100/serverPort 7200/g' $SIM_DIR/$2/cfg/taos.cfg
|
||||||
|
sed -i 's/dnode1/dnode2/g' $SIM_DIR/$2/cfg/taos.cfg
|
||||||
|
sed -i 's/7100/7200/g' $SIM_DIR/$2/data/dnode/dnodeEps.json
|
||||||
|
elif [[ $2 =~ "dnode4" ]];then
|
||||||
|
sed -i 's/serverPort 7100/serverPort 7400/g' $SIM_DIR/$2/cfg/taos.cfg
|
||||||
|
sed -i 's/dnode1/dnode4/g' $SIM_DIR/$2/cfg/taos.cfg
|
||||||
|
sed -i 's/7100/7400/g' $SIM_DIR/dnode2/data/dnode/dnodeEps.json
|
||||||
|
sed -i 's/7100/7400/g' $SIM_DIR/dnode3/data/dnode/dnodeEps.json
|
||||||
|
sed -i 's/7100/7400/g' $SIM_DIR/$2/data/dnode/dnodeEps.json
|
||||||
|
fi
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Executing mv_old_data.sh"
|
||||||
|
|
||||||
|
SCRIPT_DIR=`dirname $0`
|
||||||
|
cd $SCRIPT_DIR/../
|
||||||
|
SCRIPT_DIR=`pwd`
|
||||||
|
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
||||||
|
|
||||||
|
IN_TDINTERNAL="community"
|
||||||
|
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
|
cd ../../..
|
||||||
|
else
|
||||||
|
cd ../../
|
||||||
|
fi
|
||||||
|
|
||||||
|
TAOS_DIR=`pwd`
|
||||||
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3`
|
||||||
|
else
|
||||||
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2`
|
||||||
|
fi
|
||||||
|
|
||||||
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
||||||
|
SIM_DIR=$TAOS_DIR/sim
|
||||||
|
|
||||||
|
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||||
|
|
||||||
|
rm -rf $SIM_DIR/dnode1
|
||||||
|
rm -rf $SIM_DIR/dnode2
|
||||||
|
rm -rf $SIM_DIR/dnode3
|
||||||
|
rm -rf $SIM_DIR/tsim
|
||||||
|
|
||||||
|
tar zxf $SCRIPT_DIR/general/connection/sim.tar.gz -C $SIM_DIR/../
|
|
@ -0,0 +1,53 @@
|
||||||
|
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
|
||||||
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
system sh/cfg.sh -n dnode1 -c wallevel -v 2
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
|
sleep 3000
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print =============== step1
|
||||||
|
sql drop database -x step1
|
||||||
|
step1:
|
||||||
|
sql create database db
|
||||||
|
sql use db
|
||||||
|
sql create table m1 (ts timestamp, speed int)
|
||||||
|
|
||||||
|
print =============== step 2
|
||||||
|
$x = 0
|
||||||
|
while $x < 10
|
||||||
|
$cc = $x * 60000
|
||||||
|
$ms = 1601481600000 + $cc
|
||||||
|
|
||||||
|
sql insert into m1 values ($ms , $x )
|
||||||
|
$x = $x + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
sql select * from m1
|
||||||
|
|
||||||
|
print $rows points data are retrieved
|
||||||
|
if $rows != 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
||||||
|
print =============== step 3
|
||||||
|
system sh/move_dnode.sh dnode1 dnode2
|
||||||
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
|
|
||||||
|
print =============== step 4
|
||||||
|
sleep 3000
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
sql select * from db.m1
|
||||||
|
|
||||||
|
print $rows points data are retrieved
|
||||||
|
if $rows != 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
|
@ -0,0 +1,91 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
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/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||||
|
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||||
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||||
|
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||||
|
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||||
|
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||||
|
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||||
|
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c role -v 2
|
||||||
|
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||||
|
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||||
|
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||||
|
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||||
|
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print ============== step1: start dnode1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sleep 3000
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data
|
||||||
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
sql create dnode $hostname2
|
||||||
|
sql create dnode $hostname3
|
||||||
|
sleep 3000
|
||||||
|
|
||||||
|
# create table
|
||||||
|
sql drop database -x step1
|
||||||
|
step1:
|
||||||
|
sql create database db
|
||||||
|
sql use db
|
||||||
|
sql create table m1 (ts timestamp, speed int)
|
||||||
|
|
||||||
|
# insert data
|
||||||
|
$x = 0
|
||||||
|
while $x < 10
|
||||||
|
$cc = $x * 60000
|
||||||
|
$ms = 1601481600000 + $cc
|
||||||
|
|
||||||
|
sql insert into m1 values ($ms , $x )
|
||||||
|
$x = $x + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
sql select * from m1
|
||||||
|
|
||||||
|
print $rows points data are retrieved
|
||||||
|
if $rows != 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print ============== step3: stop cluster , then move_dnode1 ,start cluster
|
||||||
|
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/move_dnode.sh dnode1 dnode4
|
||||||
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
||||||
|
print =============== step 4
|
||||||
|
sleep 3000
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
sql select * from db.m1
|
||||||
|
|
||||||
|
print $rows points data are retrieved
|
||||||
|
if $rows != 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
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
|
|
@ -0,0 +1,91 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
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/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||||
|
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||||
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||||
|
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||||
|
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||||
|
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||||
|
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||||
|
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c role -v 2
|
||||||
|
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||||
|
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||||
|
|
||||||
|
|
||||||
|
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||||
|
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||||
|
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print ============== step1: start dnode1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sleep 3000
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data
|
||||||
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
sql create dnode $hostname2
|
||||||
|
sql create dnode $hostname3
|
||||||
|
sleep 3000
|
||||||
|
|
||||||
|
# create table
|
||||||
|
sql drop database -x step1
|
||||||
|
step1:
|
||||||
|
sql create database db replica 2
|
||||||
|
sql use db
|
||||||
|
sql create table m1 (ts timestamp, speed int)
|
||||||
|
|
||||||
|
# insert data
|
||||||
|
$x = 0
|
||||||
|
while $x < 10
|
||||||
|
$cc = $x * 60000
|
||||||
|
$ms = 1601481600000 + $cc
|
||||||
|
|
||||||
|
sql insert into m1 values ($ms , $x )
|
||||||
|
$x = $x + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
sql select * from m1
|
||||||
|
|
||||||
|
print $rows points data are retrieved
|
||||||
|
if $rows != 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print ============== step3: stop cluster , then move_dnode1 ,start cluster
|
||||||
|
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/move_dnode.sh dnode1 dnode4
|
||||||
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
||||||
|
print =============== step 4
|
||||||
|
sleep 3000
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
sql select * from db.m1
|
||||||
|
|
||||||
|
print $rows points data are retrieved
|
||||||
|
if $rows != 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in New Issue