mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
* add API to use s3 as shared storage * support using local file system as shared storage * upload file to shared storage * support read, compact and drop * finish basic mnode & vnode msg processing * follower sync migration state * implement mnode transaction, and improve log * send migration progress msg to dnode to avoid deadlock * implement following migration * remove mcount * avoid redo migration on startup * avoid follower deadlock when leader is down * trigger migrate by timer, avoid compact after migration * comment out the usage of 'tcs' functions in stream * change config item prefix from s3 to ss * change db option prefix from s3 to ss * rename s3 data struct, function, file to ss * rename s3 macro to ss * update s3 sql to ss * rename remaining s3 items to ss * check ss configruation, improve s3 retry * grant object storage -> shared storage, check ssEnabled * fix memory leaks * update build options * omit sensitive information when dump config * fix backward compatibility issue * fix issues found in ci-checks * fix some failed test cases * avoid follower timeout and improve log * fix: follower timeout because migration status not updated * refuse migration if there's an in progress one * fix ss test case * remove garbage files and other minor improvement * fix failed test cases * update unit test * fix failed test case * fix failed test case * update document * update document and fix failed test cases * fix minor issues in code, test and document * check new commit after migration task is scheduled * fix several issus 1. migrate information cannot be dropped sometimes because progress response was put into read queue. 2. memory leak in rare cases 3. data corruption in rare cases 4. failed test case * add shared storage upgrade tool * fix compile error
150 lines
4.3 KiB
Bash
Executable file
150 lines
4.3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set +e
|
|
#set -x
|
|
|
|
echo "Executing deploy.sh"
|
|
|
|
UNAME_BIN=`which uname`
|
|
OS_TYPE=`$UNAME_BIN`
|
|
NODE_NAME=
|
|
NODE=
|
|
while getopts "n:i:m" arg
|
|
do
|
|
case $arg in
|
|
n)
|
|
NODE_NAME=$OPTARG
|
|
;;
|
|
i)
|
|
NODE=$OPTARG
|
|
;;
|
|
?)
|
|
echo "unkonw argument"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
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`
|
|
|
|
cut_opt="-f "
|
|
|
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
|
else
|
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
|
fi
|
|
|
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
|
|
|
SIM_DIR=$TAOS_DIR/sim
|
|
|
|
NODE_DIR=$SIM_DIR/$NODE_NAME
|
|
EXE_DIR=$BUILD_DIR/bin
|
|
CFG_DIR=$NODE_DIR/cfg
|
|
LOG_DIR=$NODE_DIR/log
|
|
DATA_DIR=$NODE_DIR/data
|
|
|
|
rm -rf $NODE_DIR
|
|
|
|
mkdir -p $SIM_DIR
|
|
mkdir -p $NODE_DIR
|
|
mkdir -p $LOG_DIR
|
|
mkdir -p $DATA_DIR
|
|
|
|
#cp -rf $TAOS_DIR/cfg $NODE_DIR/
|
|
mkdir -p $CFG_DIR
|
|
|
|
#allow normal user to read/write log
|
|
chmod -R 777 $NODE_DIR
|
|
|
|
TAOS_CFG=$NODE_DIR/cfg/taos.cfg
|
|
touch -f $TAOS_CFG
|
|
|
|
TAOS_FLAG=$SIM_DIR/tsim/flag
|
|
if [ -f "$TAOS_FLAG" ] ; then
|
|
TAOS_CFG=/etc/taos/taos.cfg
|
|
DATA_DIR=/var/lib/taos
|
|
LOG_DIR=/var/log/taos
|
|
sudo rm -f /etc/taos/*.cfg
|
|
sudo cp -rf $TAOS_DIR/cfg/*.cfg /etc/taos
|
|
sudo rm -rf $DATA_DIR
|
|
sudo rm -rf $LOG_DIR
|
|
fi
|
|
|
|
HOSTNAME=`hostname -f`
|
|
|
|
if [ $NODE -eq 1 ]; then
|
|
NODE=7100
|
|
elif [ $NODE -eq 2 ]; then
|
|
NODE=7200
|
|
elif [ $NODE -eq 3 ]; then
|
|
NODE=7300
|
|
elif [ $NODE -eq 4 ]; then
|
|
NODE=7400
|
|
elif [ $NODE -eq 5 ]; then
|
|
NODE=7500
|
|
elif [ $NODE -eq 6 ]; then
|
|
NODE=7600
|
|
elif [ $NODE -eq 7 ]; then
|
|
NODE=7700
|
|
elif [ $NODE -eq 8 ]; then
|
|
NODE=7800
|
|
elif [ $NODE -eq 9 ]; then
|
|
NODE=7900
|
|
fi
|
|
|
|
HOSTNAME=localhost
|
|
|
|
echo " " >> $TAOS_CFG
|
|
echo "firstEp ${HOSTNAME}:7100" >> $TAOS_CFG
|
|
echo "secondEp ${HOSTNAME}:7200" >> $TAOS_CFG
|
|
echo "fqdn ${HOSTNAME}" >> $TAOS_CFG
|
|
echo "serverPort ${NODE}" >> $TAOS_CFG
|
|
echo "supportVnodes 1024" >> $TAOS_CFG
|
|
echo "statusInterval 1" >> $TAOS_CFG
|
|
echo "dataDir $DATA_DIR" >> $TAOS_CFG
|
|
echo "logDir $LOG_DIR" >> $TAOS_CFG
|
|
echo "tmrDebugFlag 131" >> $TAOS_CFG
|
|
echo "uDebugFlag 135" >> $TAOS_CFG
|
|
echo "rpcDebugFlag 135" >> $TAOS_CFG
|
|
echo "jniDebugFlag 135" >> $TAOS_CFG
|
|
echo "qDebugFlag 135" >> $TAOS_CFG
|
|
echo "cDebugFlag 135" >> $TAOS_CFG
|
|
echo "dDebugFlag 135" >> $TAOS_CFG
|
|
echo "vDebugFlag 135" >> $TAOS_CFG
|
|
echo "mDebugFlag 135" >> $TAOS_CFG
|
|
echo "wDebugFlag 135" >> $TAOS_CFG
|
|
echo "azDebugFlag 135" >> $TAOS_CFG
|
|
echo "tssDebugFlag 135" >> $TAOS_CFG
|
|
echo "sDebugFlag 135" >> $TAOS_CFG
|
|
echo "tsdbDebugFlag 135" >> $TAOS_CFG
|
|
echo "tqDebugFlag 135" >> $TAOS_CFG
|
|
echo "tqClientDebugFlag 135" >> $TAOS_CFG
|
|
echo "fsDebugFlag 135" >> $TAOS_CFG
|
|
echo "udfDebugFlag 135" >> $TAOS_CFG
|
|
echo "smaDebugFlag 135" >> $TAOS_CFG
|
|
echo "idxDebugFlag 135" >> $TAOS_CFG
|
|
echo "tdbDebugFlag 135" >> $TAOS_CFG
|
|
echo "metaDebugFlag 135" >> $TAOS_CFG
|
|
echo "stDebugFlag 135" >> $TAOS_CFG
|
|
echo "sndDebugFlag 135" >> $TAOS_CFG
|
|
echo "numOfLogLines 20000000" >> $TAOS_CFG
|
|
echo "asyncLog 0" >> $TAOS_CFG
|
|
echo "locale en_US.UTF-8" >> $TAOS_CFG
|
|
echo "telemetryReporting 0" >> $TAOS_CFG
|
|
echo "querySmaOptimize 1" >> $TAOS_CFG
|
|
echo "checkpointInterval 60" >> $TAOS_CFG
|
|
echo " " >> $TAOS_CFG
|