未验证 提交 91774fda 编写于 作者: H Haojun Liao 提交者: GitHub

Merge pull request #6895 from taosdata/fix/TD-5352

[TD-5352]<fix>: Unable to run tsim test script on MacOS
#!/bin/bash #!/bin/bash
if [ $# != 6 ]; then if [ $# != 6 ]; then
echo "argument list need input : " echo "argument list need input : "
echo " -n nodeName" echo " -n nodeName"
echo " -c configName" echo " -c configName"
...@@ -8,10 +8,12 @@ if [ $# != 6 ]; then ...@@ -8,10 +8,12 @@ if [ $# != 6 ]; then
exit 1 exit 1
fi fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
CONFIG_NAME= CONFIG_NAME=
CONFIG_VALUE= CONFIG_VALUE=
while getopts "n:v:c:" arg while getopts "n:v:c:" arg
do do
case $arg in case $arg in
n) n)
...@@ -43,10 +45,16 @@ fi ...@@ -43,10 +45,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
...@@ -56,7 +64,7 @@ SIM_DIR=$TAOS_DIR/sim ...@@ -56,7 +64,7 @@ SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/$NODE_NAME NODE_DIR=$SIM_DIR/$NODE_NAME
TAOS_CFG=$NODE_DIR/cfg/taos.cfg TAOS_CFG=$NODE_DIR/cfg/taos.cfg
TAOS_FLAG=$SIM_DIR/tsim/flag TAOS_FLAG=$SIM_DIR/tsim/flag
if [ -f "$TAOS_FLAG" ] ; then if [ -f "$TAOS_FLAG" ] ; then
TAOS_CFG=/etc/taos/taos.cfg TAOS_CFG=/etc/taos/taos.cfg
fi fi
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
echo "Executing clear.sh" echo "Executing clear.sh"
if [ $# != 6 ]; then if [ $# != 6 ]; then
echo "argument list need input : " echo "argument list need input : "
echo " -n nodeName" echo " -n nodeName"
echo " -i nodeIp" echo " -i nodeIp"
...@@ -10,10 +10,12 @@ if [ $# != 6 ]; then ...@@ -10,10 +10,12 @@ if [ $# != 6 ]; then
exit 1 exit 1
fi fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
NODE_IP= NODE_IP=
MSATER_IP= MSATER_IP=
while getopts "n:i:m:" arg while getopts "n:i:m:" arg
do do
case $arg in case $arg in
n) n)
...@@ -34,7 +36,7 @@ done ...@@ -34,7 +36,7 @@ done
SCRIPT_DIR=`dirname $0` SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
echo "SCRIPT_DIR: $SCRIPT_DIR" echo "SCRIPT_DIR: $SCRIPT_DIR"
IN_TDINTERNAL="community" IN_TDINTERNAL="community"
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then
...@@ -46,10 +48,16 @@ fi ...@@ -46,10 +48,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
...@@ -88,7 +96,7 @@ TAOS_CFG=$NODE_DIR/cfg/taos.cfg ...@@ -88,7 +96,7 @@ TAOS_CFG=$NODE_DIR/cfg/taos.cfg
touch -f $TAOS_CFG touch -f $TAOS_CFG
TAOS_FLAG=$SIM_DIR/tsim/flag TAOS_FLAG=$SIM_DIR/tsim/flag
if [ -f "$TAOS_FLAG" ] ; then if [ -f "$TAOS_FLAG" ] ; then
TAOS_CFG=/etc/taos/taos.cfg TAOS_CFG=/etc/taos/taos.cfg
DATA_DIR=/var/lib/taos DATA_DIR=/var/lib/taos
LOG_DIR=/var/log/taos LOG_DIR=/var/log/taos
...@@ -98,7 +106,7 @@ if [ -f "$TAOS_FLAG" ] ; then ...@@ -98,7 +106,7 @@ if [ -f "$TAOS_FLAG" ] ; then
sudo rm -rf $LOG_DIR sudo rm -rf $LOG_DIR
fi fi
echo " " >> $TAOS_CFG echo " " >> $TAOS_CFG
echo "masterIp $MASTER_IP" >> $TAOS_CFG echo "masterIp $MASTER_IP" >> $TAOS_CFG
echo "dataDir $DATA_DIR" >> $TAOS_CFG echo "dataDir $DATA_DIR" >> $TAOS_CFG
echo "logDir $LOG_DIR" >> $TAOS_CFG echo "logDir $LOG_DIR" >> $TAOS_CFG
......
...@@ -2,16 +2,18 @@ ...@@ -2,16 +2,18 @@
echo "Executing deploy.sh" echo "Executing deploy.sh"
if [ $# != 4 ]; then if [ $# != 4 ]; then
echo "argument list need input : " echo "argument list need input : "
echo " -n nodeName" echo " -n nodeName"
echo " -i nodePort" echo " -i nodePort"
exit 1 exit 1
fi fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
NODE= NODE=
while getopts "n:i:" arg while getopts "n:i:" arg
do do
case $arg in case $arg in
n) n)
...@@ -29,7 +31,7 @@ done ...@@ -29,7 +31,7 @@ done
SCRIPT_DIR=`dirname $0` SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
echo "SCRIPT_DIR: $SCRIPT_DIR" echo "SCRIPT_DIR: $SCRIPT_DIR"
IN_TDINTERNAL="community" IN_TDINTERNAL="community"
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then
...@@ -41,10 +43,16 @@ fi ...@@ -41,10 +43,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
......
#!/bin/bash #!/bin/bash
# if [ $# != 4 || $# != 5 ]; then # if [ $# != 4 || $# != 5 ]; then
# echo "argument list need input : " # echo "argument list need input : "
# echo " -n nodeName" # echo " -n nodeName"
# echo " -s start/stop" # echo " -s start/stop"
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
# exit 1 # exit 1
# fi # fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
EXEC_OPTON= EXEC_OPTON=
CLEAR_OPTION="false" CLEAR_OPTION="false"
while getopts "n:s:u:x:ct" arg while getopts "n:s:u:x:ct" arg
do do
case $arg in case $arg in
n) n)
...@@ -52,10 +54,16 @@ fi ...@@ -52,10 +54,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
......
#!/bin/bash #!/bin/bash
# if [ $# != 4 || $# != 5 ]; then # if [ $# != 4 || $# != 5 ]; then
# echo "argument list need input : " # echo "argument list need input : "
# echo " -n nodeName" # echo " -n nodeName"
# echo " -s start/stop" # echo " -s start/stop"
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
# exit 1 # exit 1
# fi # fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
EXEC_OPTON= EXEC_OPTON=
CLEAR_OPTION="false" CLEAR_OPTION="false"
while getopts "n:s:u:x:ct" arg while getopts "n:s:u:x:ct" arg
do do
case $arg in case $arg in
n) n)
...@@ -52,10 +54,16 @@ fi ...@@ -52,10 +54,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
...@@ -78,23 +86,23 @@ if [ -f "$TAOS_FLAG" ]; then ...@@ -78,23 +86,23 @@ if [ -f "$TAOS_FLAG" ]; then
EXE_DIR=/usr/local/bin/taos EXE_DIR=/usr/local/bin/taos
fi fi
if [ "$CLEAR_OPTION" = "clear" ]; then if [ "$CLEAR_OPTION" = "clear" ]; then
echo rm -rf $MGMT_DIR $TSDB_DIR echo rm -rf $MGMT_DIR $TSDB_DIR
rm -rf $TSDB_DIR rm -rf $TSDB_DIR
rm -rf $MGMT_DIR rm -rf $MGMT_DIR
fi fi
if [ "$EXEC_OPTON" = "start" ]; then if [ "$EXEC_OPTON" = "start" ]; then
echo "ExcuteCmd:" $EXE_DIR/taosd -c $CFG_DIR echo "ExcuteCmd:" $EXE_DIR/taosd -c $CFG_DIR
if [ "$SHELL_OPTION" = "true" ]; then if [ "$SHELL_OPTION" = "true" ]; then
TT=`date +%s` TT=`date +%s`
mkdir ${LOG_DIR}/${TT} mkdir ${LOG_DIR}/${TT}
nohup valgrind --log-file=${LOG_DIR}/${TT}/valgrind.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 & nohup valgrind --log-file=${LOG_DIR}/${TT}/valgrind.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
else else
nohup $EXE_DIR/taosd -c $CFG_DIR --random-file-fail-factor 0 > /dev/null 2>&1 & nohup $EXE_DIR/taosd -c $CFG_DIR --random-file-fail-factor 0 > /dev/null 2>&1 &
fi fi
else else
#relative path #relative path
RCFG_DIR=sim/$NODE_NAME/cfg RCFG_DIR=sim/$NODE_NAME/cfg
...@@ -110,6 +118,6 @@ else ...@@ -110,6 +118,6 @@ else
fi fi
sleep 1 sleep 1
PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'`
done done
fi fi
#!/bin/bash #!/bin/bash
# if [ $# != 4 || $# != 5 ]; then # if [ $# != 4 || $# != 5 ]; then
# echo "argument list need input : " # echo "argument list need input : "
# echo " -n nodeName" # echo " -n nodeName"
# echo " -s start/stop" # echo " -s start/stop"
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
# exit 1 # exit 1
# fi # fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
EXEC_OPTON= EXEC_OPTON=
CLEAR_OPTION="false" CLEAR_OPTION="false"
while getopts "n:s:u:x:ct" arg while getopts "n:s:u:x:ct" arg
do do
case $arg in case $arg in
n) n)
...@@ -52,10 +54,16 @@ fi ...@@ -52,10 +54,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
......
#!/bin/bash #!/bin/bash
# if [ $# != 4 || $# != 5 ]; then # if [ $# != 4 || $# != 5 ]; then
# echo "argument list need input : " # echo "argument list need input : "
# echo " -n nodeName" # echo " -n nodeName"
# echo " -s start/stop" # echo " -s start/stop"
...@@ -8,10 +8,13 @@ ...@@ -8,10 +8,13 @@
# exit 1 # exit 1
# fi # fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
EXEC_OPTON= EXEC_OPTON=
CLEAR_OPTION="false" CLEAR_OPTION="false"
while getopts "n:s:u:x:ct" arg while getopts "n:s:u:x:ct" arg
do do
case $arg in case $arg in
n) n)
...@@ -52,10 +55,16 @@ fi ...@@ -52,10 +55,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
......
#!/bin/bash #!/bin/bash
# if [ $# != 2 || $# != 3 ]; then # if [ $# != 2 || $# != 3 ]; then
# echo "argument list need input : " # echo "argument list need input : "
# echo " -s start/stop" # echo " -s start/stop"
# exit 1 # exit 1
# fi # fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
EXEC_OPTON= EXEC_OPTON=
while getopts "n:s:u:x:ct" arg while getopts "n:s:u:x:ct" arg
do do
case $arg in case $arg in
n) n)
...@@ -49,10 +51,16 @@ fi ...@@ -49,10 +51,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
echo "Executing move_dnode.sh" echo "Executing move_dnode.sh"
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
SCRIPT_DIR=`dirname $0` SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
echo "SCRIPT_DIR: $SCRIPT_DIR" echo "SCRIPT_DIR: $SCRIPT_DIR"
IN_TDINTERNAL="community" IN_TDINTERNAL="community"
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then
...@@ -17,10 +20,16 @@ fi ...@@ -17,10 +20,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
echo "Executing mv_old_data.sh" echo "Executing mv_old_data.sh"
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
SCRIPT_DIR=`dirname $0` SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
echo "SCRIPT_DIR: $SCRIPT_DIR" echo "SCRIPT_DIR: $SCRIPT_DIR"
IN_TDINTERNAL="community" IN_TDINTERNAL="community"
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then
...@@ -17,10 +20,16 @@ fi ...@@ -17,10 +20,16 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
......
#!/bin/sh #!/bin/sh
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
if [ -n "$PID" ]; then if [ -n "$PID" ]; then
echo systemctl stop taosd echo systemctl stop taosd
systemctl stop taosd systemctl stop taosd
fi fi
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]; do while [ -n "$PID" ]; do
echo kill -9 $PID echo kill -9 $PID
pkill -9 taosd pkill -9 taosd
fuser -k -n tcp 6030 echo "Killing processes locking on port 6030"
if [[ "$OS_TYPE" != "Darwin" ]]; then
fuser -k -n tcp 6030
else
lsof -nti:6030 | xargs kill -9
fi
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
done done
PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]; do while [ -n "$PID" ]; do
echo kill -9 $PID echo kill -9 $PID
pkill -9 tarbitrator pkill -9 tarbitrator
fuser -k -n tcp 6040 if [[ "$OS_TYPE" != "Darwin" ]]; then
fuser -k -n tcp 6040
else
lsof -nti:6040 | xargs kill -9
fi
PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
done done
#!/bin/bash #!/bin/bash
################################################## ##################################################
# #
# Do simulation test # Do simulation test
# #
################################################## ##################################################
...@@ -14,6 +14,8 @@ RELEASE=0 ...@@ -14,6 +14,8 @@ RELEASE=0
ASYNC=0 ASYNC=0
VALGRIND=0 VALGRIND=0
UNIQUE=0 UNIQUE=0
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
while getopts "f:avu" arg while getopts "f:avu" arg
do do
case $arg in case $arg in
...@@ -51,10 +53,16 @@ fi ...@@ -51,10 +53,16 @@ fi
TOP_DIR=`pwd` TOP_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
if [[ "$OS_TYPE" != "Darwin" ]]; then
cut_opt="--field="
else
cut_opt="-f "
fi
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
else else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2` BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
fi fi
BUILD_DIR=$TOP_DIR/$BIN_DIR/build BUILD_DIR=$TOP_DIR/$BIN_DIR/build
...@@ -117,7 +125,7 @@ echo "wal 0" >> $TAOS_CFG ...@@ -117,7 +125,7 @@ echo "wal 0" >> $TAOS_CFG
echo "asyncLog 0" >> $TAOS_CFG echo "asyncLog 0" >> $TAOS_CFG
echo "locale en_US.UTF-8" >> $TAOS_CFG echo "locale en_US.UTF-8" >> $TAOS_CFG
echo "enableCoreFile 1" >> $TAOS_CFG echo "enableCoreFile 1" >> $TAOS_CFG
echo " " >> $TAOS_CFG echo " " >> $TAOS_CFG
ulimit -n 600000 ulimit -n 600000
ulimit -c unlimited ulimit -c unlimited
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册