diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index e8602befa35220787b56be32a51f0ac5044c55ef..b2613a7cb62faae489d52d1711c05581b63e8428 100644 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -99,6 +99,44 @@ else os_type=1 fi + +# ============================= get input parameters ================================================= + +# install.sh -v [server | client] -e [yes | no] -i [systemd | service | ...] + +# set parameters by default value +interactiveFqdn=yes # [yes | no] +verType=server # [server | client] +initType=systemd # [systemd | service | ...] + +while getopts "hv:e:i:" arg +do + case $arg in + e) + #echo "interactiveFqdn=$OPTARG" + interactiveFqdn=$( echo $OPTARG ) + ;; + v) + #echo "verType=$OPTARG" + verType=$(echo $OPTARG) + ;; + i) + #echo "initType=$OPTARG" + initType=$(echo $OPTARG) + ;; + h) + echo "Usage: `basename $0` -v [server | client] -e [yes | no]" + exit 0 + ;; + ?) #unknow option + echo "unkonw argument" + exit 1 + ;; + esac +done + +echo "verType=${verType} interactiveFqdn=${interactiveFqdn}" + function kill_taosd() { pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') if [ -n "$pid" ]; then @@ -191,6 +229,10 @@ function install_config() { if ((${update_flag}==1)); then return 0 fi + + if [ "$interactiveFqdn" == "no" ]; then + return 0 + fi #FQDN_FORMAT="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" #FQDN_FORMAT="(:[1-6][0-9][0-9][0-9][0-9]$)" @@ -653,8 +695,8 @@ function install_TDengine() { echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}" else echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}" - fi - else + fi + else echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}" fi @@ -673,7 +715,7 @@ function install_TDengine() { ## ==============================Main program starts from here============================ -if [ -z $1 ]; then +if [ "$verType" == "server" ]; then # Install server and client if [ -x ${bin_dir}/taosd ]; then update_flag=1 @@ -681,7 +723,8 @@ if [ -z $1 ]; then else install_TDengine fi -else +elif [ "$verType" == "client" ]; then + interactiveFqdn=no # Only install client if [ -x ${bin_dir}/taos ]; then update_flag=1 @@ -689,4 +732,6 @@ else else install_TDengine client fi +else + echo "please input correct verType" fi diff --git a/tests/script/unique/clusterSimCase/client-01.sim b/tests/script/unique/clusterSimCase/client-01.sim new file mode 100644 index 0000000000000000000000000000000000000000..f334828b4163b449425ae92d6272defaf810c991 --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-01.sim @@ -0,0 +1,69 @@ +# create database db1 +# create table tb () +# loop insert seq data +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$preBinary = ' . client-01- +############################################################### + +sql connect + +print ================ create db +$db = db +sql create database if not exists $db replica 2 +sql use $db + +print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) + +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i +# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + $i = $i + 1 +endw + +$totalRows = 0 +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 160 + +$loop_cnt = 0 +loop_run: +print ================ client-01 start loop insert data ( loop_cnt: $loop_cnt ) +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i + + $c2Binary = $preBinary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + $x = $x + 20 + $ts = $ts + 40a + endw + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tb +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ************ client-01 insert data error ***** ***** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +$loop_cnt = $loop_cnt + 1 +goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-02.sim b/tests/script/unique/clusterSimCase/client-02.sim new file mode 100644 index 0000000000000000000000000000000000000000..4887193438d92b5309364f0836f36253f0b7d02f --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-02.sim @@ -0,0 +1,68 @@ +# create database db1 +# create table tb () +# loop insert disorder data +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$c2Binary = ' . client-02- +############################################################### + +sql connect + +print ================ create db +$db = db +sql create database if not exists $db replica 2 +sql use $db + +print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) + +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i +# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + $i = $i + 1 +endw + +$totalRows = 0 +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 160 + +loop_run: +print ================ client-02 start loop insert data +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i + + $c2Binary = $c2Binary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary ) + $x = $x + 40 + $ts = $ts + 40a + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + endw + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tblStart +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ************ client-02 insert data error ***** ***** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-03.sim b/tests/script/unique/clusterSimCase/client-03.sim new file mode 100644 index 0000000000000000000000000000000000000000..d05b1c86be494ec9325807f47d77d35c6f489eb0 --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-03.sim @@ -0,0 +1,82 @@ +# create database db1 +# create table stb () +# loop dynamic create sub table and insert disorder data +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$c2Binary = ' . client-03- +$t2Binary = ' . client-03- +############################################################### + +sql connect + +print ================ create db and super-table +$db = db +$stb = stb +sql create database if not exists $db replica 2 +sql use $db +sql create table if not exists $stb ( ts timestamp , c1 int , c2 binary(16) ) tags ( t1 int , t2 binary(16) ) + +#print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) +#$i = $tblStart +#while $i < $tblEnd +# $tb = tb . $i +## print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) +# sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) +# $i = $i + 1 +#endw + +$totalRows = 0 +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 160 + +loop_run: +print ================ client-03 start loop insert data +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i + + $t2Binary = ' . $i + $t2Binary = $t2Binary . ' + + $c2Binary = $c2Binary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb using $stb tags ( $i , $t2Binary ) values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + sql insert into $tb using $stb tags ( $i , $t2Binary ) values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary ) + $x = $x + 40 + $ts = $ts + 40a + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + endw + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tblStart +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ****** client-3 insert data into $tblStart error *** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +sql select count(*) from $stb +if $data00 != $totalRows then + print data00 $data00 totalRows $totalRows + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ***** client-3 insert data into $stbl error ******** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-04.sim b/tests/script/unique/clusterSimCase/client-04.sim new file mode 100644 index 0000000000000000000000000000000000000000..ec10454b864d97a46ff2bb9742e997de732d5fde --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-04.sim @@ -0,0 +1,81 @@ +# create database db1 +# create table tb () +# loop insert disorder data, drop database, sleep , +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$c2Binary = ' . client-04- +############################################################### + +$totalRows = 0 + +sql connect + +init_lable: +print ================ create db +$db = db +sql create database if not exists $db replica 2 +sql use $db + +print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) + +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i +# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + $i = $i + 1 +endw + +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 160 + +$loopCnt = 0 + +loop_run: +print ================ client-04 start loop insert data +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i + + $c2Binary = $c2Binary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary ) + $x = $x + 40 + $ts = $ts + 40a + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + endw + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tblStart +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ************ client-04 insert data error ***** ***** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +$loopCnt = $loopCnt + 1 + +if $loopCnt > 100 then + sql drop database if exists $db + sleep 20000 + $totalRows = 0 + goto init_lable +endi + +goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-05.sim b/tests/script/unique/clusterSimCase/client-05.sim new file mode 100644 index 0000000000000000000000000000000000000000..af64c10dd5b04c80e1edff0c442f90d6e3680a83 --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-05.sim @@ -0,0 +1,86 @@ +# create database db1 +# loop create table , insert disorder data, drop table, sleep , +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$c2Binary = ' . client-05- +############################################################### + +$totalRows = 0 + +sql connect + +print ================ create db +$db = db +sql create database if not exists $db replica 2 +sql use $db + +init_lable: +print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) + +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i +# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + $i = $i + 1 +endw + +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 160 + +$loopCnt = 0 + +loop_run: +print ================ client-05 start loop insert data +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i + + $c2Binary = $c2Binary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary ) + $x = $x + 40 + $ts = $ts + 40a + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + endw + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tblStart +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ************ client-05 insert data error ***** ***** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +$loopCnt = $loopCnt + 1 + +if $loopCnt > 100 then + + $i = $tblStart + while $i < $tblEnd + $tb = tb . $i + sql drop table if exists $tb + $i = $i + 1 + $totalRows = $totalRows - $rowsPerTbl + endw + sleep 20000 + goto init_lable +endi + +goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-06.sim b/tests/script/unique/clusterSimCase/client-06.sim new file mode 100644 index 0000000000000000000000000000000000000000..f01583119647a9129f739ead4a834c482c356b22 --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-06.sim @@ -0,0 +1,94 @@ +# create database db1 +# create table tb () +# loop insert disorder data, drop some tables and create new tables, sleep , +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$c2Binary = ' . client-06- +$numPerUpdateTbl = 2000 +############################################################### + +$totalRows = 0 + +sql connect + +print ================ create db +$db = db +sql create database if not exists $db replica 2 +sql use $db + +init_lable: +print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) + +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i +# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + $i = $i + 1 +endw + +$dropTblStart = $tblStart +$dropTblEnd = $tblStart + $numPerUpdateTbl + +$tblStart = $tblEnd +$tblEnd = $tblEnd + $numPerUpdateTbl + +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 160 + +$loopCnt = 0 + +loop_run: +print ================ client-06 start loop insert data +$i = $dropTblStart +while $i < $tblEnd + $tb = tb . $i + + $c2Binary = $c2Binary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary ) + $x = $x + 40 + $ts = $ts + 40a + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + endw + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tblStart +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ************ client-06 insert data error ***** ***** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +$loopCnt = $loopCnt + 1 + +if $loopCnt > 100 then + + $i = $dropTblStart + while $i < $dropTblEnd + $tb = tb . $i + sql drop table if exists $tb + $i = $i + 1 + $totalRows = $totalRows - $rowsPerTbl + endw + sleep 20000 + goto init_lable +endi + +goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-07.sim b/tests/script/unique/clusterSimCase/client-07.sim new file mode 100644 index 0000000000000000000000000000000000000000..126ae767716c0a14fe5e1be3b3a54ca7ab3dfdf4 --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-07.sim @@ -0,0 +1,88 @@ +# create database db1 +# loop create table , insert disorder data, drop table, sleep , +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$c2Binary = ' . client-07- +############################################################### + +$totalRows = 0 + +sql connect + +print ================ create db +$db = db +sql create database if not exists $db replica 2 +sql use $db + +init_lable: +print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) + +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i +# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + $i = $i + 1 +endw + +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 160 + +$loopCnt = 0 + +loop_run: +print ================ client-07 start loop insert data +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i + + $c2Binary = $c2Binary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary ) + $x = $x + 40 + $ts = $ts + 40a + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + endw + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tblStart +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ************ client-07 insert data error ***** ***** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +$loopCnt = $loopCnt + 1 + +if $loopCnt > 100 then + + $i = $tblStart + while $i < $tblEnd + $tb = tb . $i + sql alter table $tb add column c3 double + sql alter table $tb add column c4 binary( 16 ) + sql alter table $tb drop column c1 + sql alter table $tb drop column c2 + $i = $i + 1 + endw + sleep 20000 + goto init_lable +endi + +goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-08.sim b/tests/script/unique/clusterSimCase/client-08.sim new file mode 100644 index 0000000000000000000000000000000000000000..6316abb28eabcafe7e85c79bcef3eba9aedbb135 --- /dev/null +++ b/tests/script/unique/clusterSimCase/client-08.sim @@ -0,0 +1,93 @@ +# create database db1 +# create table tb () +# loop insert disorder data, drop some tables and create new tables, sleep , +############################################################### +################ set script parameters ################ +$tblStart = 0 +$tblEnd = 10000 +$tsStart = 1325347200000 # 2012-01-01 00:00:00.000 +$c2Binary = ' . client-06- +$numPerUpdateTbl = 2000 +############################################################### + +$totalRows = 0 + +sql connect + +print ================ create db +$db = db +sql create database if not exists $db replica 2 +sql use $db + +init_lable: +print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) + +$i = $tblStart +while $i < $tblEnd + $tb = tb . $i +# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + $i = $i + 1 +endw + +$dropTblStart = $tblStart +$dropTblEnd = $tblStart + $numPerUpdateTbl + +$tblStart = $tblEnd +$tblEnd = $tblEnd + $numPerUpdateTbl + +$rowsPerTbl = 0 +$ts = $tsStart +$rowsPerLoop = 40 + +$loopCnt = 0 + +loop_run: +print ================ client-06 start loop insert data +$i = $dropTblStart +while $i < $tblEnd + $tb = tb . $i + + $c2Binary = $c2Binary . $i + $c2Binary = $c2Binary . ' + + $x = 0 + while $x < $rowsPerLoop + sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary ) + sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary ) + $x = $x + 40 + $ts = $ts + 40a + if $i == $tblStart then + $rowsPerTbl = $rowsPerTbl + $x + endi + endw + + $totalRows = $totalRows + $x + $i = $i + 1 + +endw + +sql select count(*) from $tblStart +if $data00 != $rowsPerTbl then + print data00 $data00 rowsPerTbl $rowsPerTbl + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + print ************ client-06 insert data error ***** ***** + print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + return -1 +endi + +$loopCnt = $loopCnt + 1 + +#if $loopCnt > 100 then + $i = $dropTblStart + while $i < $dropTblEnd + $tb = tb . $i + sql drop table if exists $tb + $i = $i + 1 + $totalRows = $totalRows - $rowsPerTbl + endw + sleep 20000 + goto init_lable +#endi + +goto loop_run diff --git a/tests/script/unique/clusterSimCase/cluster_main.sim b/tests/script/unique/clusterSimCase/cluster_main.sim new file mode 100644 index 0000000000000000000000000000000000000000..e126463d53ba4ae97f9cbbf8e4d1425987a992ed --- /dev/null +++ b/tests/script/unique/clusterSimCase/cluster_main.sim @@ -0,0 +1,245 @@ +# scp -r root@114.116.252.220:/home/ubuntu/clusterSimCase unique/. + +#taos> show dnodes; +# id | end_point | vnodes | cores | status | role | create_time | +#================================================================================================================== +# 1 | ubuntu-OptiPlex-7060:7100 | 0 | 12 | ready | mnode | 2020-07-22 06:25:31.677 | +# 2 | ubuntu-OptiPlex-7060:7200 | 4 | 12 | ready | vnode | 2020-07-22 06:25:34.795 | +# 3 | ubuntu-OptiPlex-7060:7300 | 4 | 12 | ready | vnode | 2020-07-22 06:25:34.803 | +#Query OK, 3 row(s) in set (0.002448s) +#taos> show vgroups; +# vgId | tables | status | onlineVnodes | dnode | vstatus | dnode | vstatus | +#====================================================================================================== +# 2 | 1024 | ready | 2 | 3 | master | 2 | slave | +# 3 | 1024 | ready | 2 | 3 | master | 2 | slave | +# 4 | 1024 | ready | 2 | 3 | master | 2 | slave | +# 5 | 718 | ready | 2 | 3 | master | 2 | slave | +#Query OK, 4 row(s) in set (0.002749s) +# +#taos> show mnodes +# -> ; +# id | end_point | role | create_time | +#===================================================================================== +# 1 | ubuntu-OptiPlex-7060:7100 | master | 2020-07-22 06:25:31.677 | +#Query OK, 1 row(s) in set (0.002126s) + + +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/deploy.sh -n dnode4 -i 4 + +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 dnode4 -c numOfMnodes -v 1 + +system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/cfg.sh -n dnode2 -c walLevel -v 1 +system sh/cfg.sh -n dnode3 -c walLevel -v 1 +system sh/cfg.sh -n dnode4 -c walLevel -v 1 + +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 dnode4 -c balanceInterval -v 10 + +system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 +system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 256 +system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 +system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 + +#system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 +#system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 +#system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 +#system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 + +#system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 256 +#system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 256 +#system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 256 +#system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 256 + +system sh/cfg.sh -n dnode1 -c role -v 1 +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 dnode4 -c role -v 2 + +system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5000 +system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 5000 +system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 5000 +system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 5000 + +system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator +system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator +system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator +system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator + +print ============== step0: start tarbitrator and dnode1 +system sh/exec_tarbitrator.sh -s start +system sh/exec.sh -n dnode1 -s start + +print ============== step2: start dnode2/dnode3 +system sh/exec.sh -n dnode2 -s start +system sh/exec.sh -n dnode3 -s start +sleep 1000 +sql connect + +print ============== step1: add dnode2/dnode3 into cluster +sql create dnode $hostname2 +sql create dnode $hostname3 +sleep 3000 +sleep 3000 +print ============== step3: start back client-01.sim +run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +#run_back unique/clusterSimCase/client-01.sim +sleep 20000 + +$db = db +sql use $db + +$loop_cnt = 0 +loop_cluster_do: +print **** **** **** START loop cluster do (loop_cnt: $loop_cnt )**** **** **** **** + +print ============== step4: stop dnode3 +system sh/exec.sh -n dnode3 -s stop -x SIGINT + +$checkCnt = 0 +wait_vgroup_chang_0: +$checkCnt = $checkCnt + 1 +if $loopCnt == 10 then + return -1 +endi +print show vgroups +sql show vgroups +#if $rows != 4 then +# print rows: $rows +# sleep 2000 +# goto wait_vgroup_chang_0 +#endi +print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 +print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 +print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 +$vg2Dnode3Status = $data5_2 +$vg2Dnode2Status = $data7_2 + +if $vg2Dnode3Status != offline then + sleep 2000 + goto wait_vgroup_chang_0 +endi +if $vg2Dnode2Status != master then + sleep 2000 + goto wait_vgroup_chang_0 +endi + + +sleep 3000 +print ============== step3: restart dnode3 +system sh/exec.sh -n dnode3 -s start + +$checkCnt = 0 +wait_vgroup_chang_1: +$checkCnt = $checkCnt + 1 +if $loopCnt == 10 then + return -1 +endi +print show vgroups +sql show vgroups +#if $rows != 4 then +# print rows: $rows +# sleep 2000 +# goto wait_vgroup_chang_1 +#endi +print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 +print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 +print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 +$vg2Dnode3Status = $data5_2 +$vg2Dnode2Status = $data7_2 + +if $vg2Dnode3Status != slave then + sleep 2000 + goto wait_vgroup_chang_1 +endi +if $vg2Dnode2Status != master then + sleep 2000 + goto wait_vgroup_chang_1 +endi + +sleep 3000 +print ============== step4: stop dnode2 +system sh/exec.sh -n dnode2 -s stop -x SIGINT + +$checkCnt = 0 +wait_vgroup_chang_2: +$checkCnt = $checkCnt + 1 +if $loopCnt == 10 then + return -1 +endi +print show vgroups +sql show vgroups +#if $rows != 4 then +# print rows: $rows +# sleep 2000 +# goto wait_vgroup_chang_2 +#endi +print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 +print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 +print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 +$vg2Dnode3Status = $data5_2 +$vg2Dnode2Status = $data7_2 + +if $vg2Dnode3Status != master then + sleep 2000 + goto wait_vgroup_chang_2 +endi +if $vg2Dnode2Status != offline then + sleep 2000 + goto wait_vgroup_chang_2 +endi + + +sleep 3000 +print ============== step5: restart dnode2 +system sh/exec.sh -n dnode2 -s start + +$checkCnt = 0 +wait_vgroup_chang_3: +$checkCnt = $checkCnt + 1 +if $loopCnt == 10 then + return -1 +endi +print show vgroups +sql show vgroups +#if $rows != 4 then +# print rows: $rows +# sleep 2000 +# goto wait_vgroup_chang_3 +#endi +print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 +print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 +print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 +$vg2Dnode3Status = $data5_2 +$vg2Dnode2Status = $data7_2 + +if $vg2Dnode2Status != slave then + sleep 2000 + goto wait_vgroup_chang_3 +endi +if $vg2Dnode3Status != master then + sleep 2000 + goto wait_vgroup_chang_3 +endi + +sleep 3000 +print **** **** **** (loop_cnt: $loop_cnt ) end, continue...... **** **** **** **** +$loop_cnt = $loop_cnt + 1 +goto loop_cluster_do