未验证 提交 7f8960a5 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

Feature/sangshuduo/td 10469 blm3 (#8220)

* [TD-10469]<feature>: use blm to replace httpd

* add blm3 as submodule and modify the install script.

* make http disabled by default.

* use external project for go build.

* make install and systemctl works.

* change blm3 to official repo.

* fix alert build missing sqlx package.

* update README regarding golang env setup.

* remove blm3.

* modify script to support blm3

* <test>udpate submodule in CI

* update jenkinsfile

* update blm3 with statsd port changed and config file name changed.

* still use tdengine's httpd for lite version.

* include blm.toml in released packages.

* merge with develop branch.

* update grafana plugin to support telegraf.

* fix python test framework

* fix blm3.toml name

* comment off restful test for blm3 CI.

* fix blm.toml name

* comment off http related case for blm3.

* fix cmake define.inc for windows build

* update grafanaplugin

* update blm3
Co-authored-by: Nliuyq-617 <yqliu@taosdata.com>
上级 8fd163b1
...@@ -12,6 +12,7 @@ steps: ...@@ -12,6 +12,7 @@ steps:
commands: commands:
- apt-get update - apt-get update
- apt-get install -y cmake build-essential - apt-get install -y cmake build-essential
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. - cmake ..
...@@ -37,6 +38,7 @@ steps: ...@@ -37,6 +38,7 @@ steps:
commands: commands:
- apt-get update - apt-get update
- apt-get install -y cmake build-essential - apt-get install -y cmake build-essential
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. -DCPUTYPE=aarch64 > /dev/null - cmake .. -DCPUTYPE=aarch64 > /dev/null
...@@ -64,6 +66,7 @@ steps: ...@@ -64,6 +66,7 @@ steps:
- echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
- apt-get update - apt-get update
- apt-get install -y -qq cmake build-essential - apt-get install -y -qq cmake build-essential
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. -DCPUTYPE=aarch64 > /dev/null - cmake .. -DCPUTYPE=aarch64 > /dev/null
...@@ -89,6 +92,7 @@ steps: ...@@ -89,6 +92,7 @@ steps:
image: arm64v8/centos:7 image: arm64v8/centos:7
commands: commands:
- yum install -y gcc gcc-c++ make cmake git - yum install -y gcc gcc-c++ make cmake git
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. -DCPUTYPE=aarch64 > /dev/null - cmake .. -DCPUTYPE=aarch64 > /dev/null
...@@ -114,6 +118,7 @@ steps: ...@@ -114,6 +118,7 @@ steps:
image: arm64v8/centos:8 image: arm64v8/centos:8
commands: commands:
- dnf install -y gcc gcc-c++ make cmake epel-release git libarchive - dnf install -y gcc gcc-c++ make cmake epel-release git libarchive
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. -DCPUTYPE=aarch64 > /dev/null - cmake .. -DCPUTYPE=aarch64 > /dev/null
...@@ -140,6 +145,7 @@ steps: ...@@ -140,6 +145,7 @@ steps:
commands: commands:
- apt-get update - apt-get update
- apt-get install -y cmake build-essential - apt-get install -y cmake build-essential
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. -DCPUTYPE=aarch32 > /dev/null - cmake .. -DCPUTYPE=aarch32 > /dev/null
...@@ -166,7 +172,7 @@ steps: ...@@ -166,7 +172,7 @@ steps:
commands: commands:
- apt-get update - apt-get update
- apt-get install -y gcc cmake3 build-essential git binutils-2.26 - apt-get install -y gcc cmake3 build-essential git binutils-2.26
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. - cmake ..
...@@ -193,6 +199,7 @@ steps: ...@@ -193,6 +199,7 @@ steps:
commands: commands:
- apt-get update - apt-get update
- apt-get install -y gcc cmake build-essential - apt-get install -y gcc cmake build-essential
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. - cmake ..
...@@ -218,6 +225,7 @@ steps: ...@@ -218,6 +225,7 @@ steps:
commands: commands:
- apt-get update - apt-get update
- apt-get install -y gcc cmake build-essential - apt-get install -y gcc cmake build-essential
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. - cmake ..
...@@ -242,6 +250,7 @@ steps: ...@@ -242,6 +250,7 @@ steps:
image: ansible/centos7-ansible image: ansible/centos7-ansible
commands: commands:
- yum install -y gcc gcc-c++ make cmake - yum install -y gcc gcc-c++ make cmake
- git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. - cmake ..
......
...@@ -16,3 +16,6 @@ ...@@ -16,3 +16,6 @@
[submodule "deps/TSZ"] [submodule "deps/TSZ"]
path = deps/TSZ path = deps/TSZ
url = https://github.com/taosdata/TSZ.git url = https://github.com/taosdata/TSZ.git
[submodule "src/plugins/blm3"]
path = src/plugins/blm3
url = https://github.com/taosdata/blm3
...@@ -72,6 +72,7 @@ def pre_test(){ ...@@ -72,6 +72,7 @@ def pre_test(){
git fetch origin +refs/pull/${CHANGE_ID}/merge git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD git checkout -qf FETCH_HEAD
git clean -dfx git clean -dfx
git submodule update --init --recursive
cd ${WK} cd ${WK}
git reset --hard HEAD~10 git reset --hard HEAD~10
''' '''
...@@ -98,7 +99,7 @@ def pre_test(){ ...@@ -98,7 +99,7 @@ def pre_test(){
sh ''' sh '''
cd ${WK} cd ${WK}
git pull >/dev/null git pull >/dev/null
git submodule update --init --recursive
export TZ=Asia/Harbin export TZ=Asia/Harbin
date date
git clean -dfx git clean -dfx
......
...@@ -88,6 +88,15 @@ To install Apache Maven: ...@@ -88,6 +88,15 @@ To install Apache Maven:
sudo dnf install -y maven sudo dnf install -y maven
``` ```
### Setup golang environment
TDengine includes few components developed by Go language. Please refer to golang.org official documentation for golang environment setup.
Please use version 1.14+. For the user in China, we recommend using a proxy to accelerate package downloading.
```
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
```
## Get the source codes ## Get the source codes
First of all, you may clone the source codes from github: First of all, you may clone the source codes from github:
......
...@@ -52,7 +52,7 @@ echo "cpuType=${cpuType}" ...@@ -52,7 +52,7 @@ echo "cpuType=${cpuType}"
echo "osType=${osType}" echo "osType=${osType}"
echo "version=${version}" echo "version=${version}"
GOOS=${osType} GOARCH=${cpuType} go build -ldflags '-X main.version='${version} GOOS=${osType} GOARCH=${cpuType} go mod tidy && go build -ldflags '-X main.version='${version}
mkdir -p TDengine-alert/driver mkdir -p TDengine-alert/driver
......
...@@ -87,7 +87,7 @@ IF (TD_ARM_64) ...@@ -87,7 +87,7 @@ IF (TD_ARM_64)
ADD_DEFINITIONS(-DUSE_LIBICONV) ADD_DEFINITIONS(-DUSE_LIBICONV)
MESSAGE(STATUS "arm64 is defined") MESSAGE(STATUS "arm64 is defined")
SET(COMMON_FLAGS "-Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") SET(COMMON_FLAGS "-Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lua/src) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lua/src)
ENDIF () ENDIF ()
...@@ -124,7 +124,12 @@ IF (TD_APLHINE) ...@@ -124,7 +124,12 @@ IF (TD_APLHINE)
MESSAGE(STATUS "aplhine is defined") MESSAGE(STATUS "aplhine is defined")
ENDIF () ENDIF ()
IF (TD_BUILD_HTTP) IF (TD_LINUX)
IF (TD_BUILD_HTTP)
ADD_DEFINITIONS(-DHTTP_EMBEDDED)
ENDIF ()
ELSE ()
SET(TD_BUILD_HTTP TRUE)
ADD_DEFINITIONS(-DHTTP_EMBEDDED) ADD_DEFINITIONS(-DHTTP_EMBEDDED)
ENDIF () ENDIF ()
......
...@@ -90,10 +90,10 @@ IF (${BUILD_JDBC} MATCHES "false") ...@@ -90,10 +90,10 @@ IF (${BUILD_JDBC} MATCHES "false")
SET(TD_BUILD_JDBC FALSE) SET(TD_BUILD_JDBC FALSE)
ENDIF () ENDIF ()
SET(TD_BUILD_HTTP TRUE) SET(TD_BUILD_HTTP FALSE)
IF (${BUILD_HTTP} MATCHES "false") IF (${BUILD_HTTP} MATCHES "true")
SET(TD_BUILD_HTTP FALSE) SET(TD_BUILD_HTTP TRUE)
ENDIF () ENDIF ()
SET(TD_MEMORY_SANITIZER FALSE) SET(TD_MEMORY_SANITIZER FALSE)
...@@ -108,10 +108,10 @@ IF (${VERBOSE} MATCHES "true") ...@@ -108,10 +108,10 @@ IF (${VERBOSE} MATCHES "true")
ENDIF () ENDIF ()
IF (${TSZ_ENABLED} MATCHES "true") IF (${TSZ_ENABLED} MATCHES "true")
# define add # define add
MESSAGE(STATUS "build with TSZ enabled") MESSAGE(STATUS "build with TSZ enabled")
ADD_DEFINITIONS(-DTD_TSZ) ADD_DEFINITIONS(-DTD_TSZ)
set(VAR_TSZ "TSZ" CACHE INTERNAL "global variant tsz" ) set(VAR_TSZ "TSZ" CACHE INTERNAL "global variant tsz" )
ELSE() ELSE()
set(VAR_TSZ "" CACHE INTERNAL "global variant empty" ) set(VAR_TSZ "" CACHE INTERNAL "global variant empty" )
ENDIF() ENDIF()
...@@ -95,7 +95,7 @@ function check_file() { ...@@ -95,7 +95,7 @@ function check_file() {
echo -e "$1/$2 \033[31mnot exists\033[0m!quit" echo -e "$1/$2 \033[31mnot exists\033[0m!quit"
fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n" fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n"
echo -e $fin_result echo -e $fin_result
exit 8 exit 8
fi fi
} }
...@@ -107,6 +107,7 @@ function get_package_name() { ...@@ -107,6 +107,7 @@ function get_package_name() {
echo ${var::-17} echo ${var::-17}
fi fi
} }
function check_link() { function check_link() {
#check Link whether exists or broken #check Link whether exists or broken
if [ -L $1 ] ; then if [ -L $1 ] ; then
...@@ -114,13 +115,13 @@ function check_link() { ...@@ -114,13 +115,13 @@ function check_link() {
echo -e "$1 \033[31Broken link\033[0m" echo -e "$1 \033[31Broken link\033[0m"
fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n" fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n"
echo -e $fin_result echo -e $fin_result
exit 8 exit 8
fi fi
else else
echo -e "$1 \033[31mnot exists\033[0m!quit" echo -e "$1 \033[31mnot exists\033[0m!quit"
fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n" fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n"
echo -e $fin_result echo -e $fin_result
exit 8 exit 8
fi fi
} }
...@@ -141,11 +142,11 @@ function check_main_path() { ...@@ -141,11 +142,11 @@ function check_main_path() {
function check_bin_path() { function check_bin_path() {
# check install bin dir and all sub dir # check install bin dir and all sub dir
bin_dir=("taos" "taosd" "taosdemo" "taosdump" "remove.sh" "tarbitrator" "set_core.sh") bin_dir=("taos" "taosd" "blm3" "taosdemo" "taosdump" "remove.sh" "tarbitrator" "set_core.sh")
for i in ${bin_dir[@]};do for i in ${bin_dir[@]};do
check_file ${sbin_dir} $i check_file ${sbin_dir} $i
done done
lbin_dir=("taos" "taosd" "taosdemo" "taosdump" "rmtaos" "tarbitrator" "set_core") lbin_dir=("taos" "taosd" "blm3" "taosdemo" "taosdump" "rmtaos" "tarbitrator" "set_core")
for i in ${lbin_dir[@]};do for i in ${lbin_dir[@]};do
check_link ${bin_link_dir}/$i check_link ${bin_link_dir}/$i
done done
...@@ -155,7 +156,6 @@ function check_bin_path() { ...@@ -155,7 +156,6 @@ function check_bin_path() {
echo -e "Check bin path:\033[32mOK\033[0m!" echo -e "Check bin path:\033[32mOK\033[0m!"
} }
function check_lib_path() { function check_lib_path() {
# check all links # check all links
check_link ${lib_link_dir}/libtaos.so check_link ${lib_link_dir}/libtaos.so
...@@ -168,9 +168,8 @@ function check_lib_path() { ...@@ -168,9 +168,8 @@ function check_lib_path() {
echo -e "Check lib path:\033[32mOK\033[0m!" echo -e "Check lib path:\033[32mOK\033[0m!"
} }
function check_header_path() { function check_header_path() {
# check all header # check all header
header_dir=("taos.h" "taoserror.h") header_dir=("taos.h" "taoserror.h")
for i in ${header_dir[@]};do for i in ${header_dir[@]};do
check_link ${inc_link_dir}/$i check_link ${inc_link_dir}/$i
...@@ -178,6 +177,12 @@ function check_header_path() { ...@@ -178,6 +177,12 @@ function check_header_path() {
echo -e "Check bin path:\033[32mOK\033[0m!" echo -e "Check bin path:\033[32mOK\033[0m!"
} }
function check_blm3_config_dir() {
# check all config
check_file ${cfg_install_dir} blm3.toml
check_file ${install_main_dir}/cfg blm.toml.org
echo -e "Check conf path:\033[32mOK\033[0m!"
}
function check_config_dir() { function check_config_dir() {
# check all config # check all config
...@@ -194,7 +199,7 @@ function check_log_path() { ...@@ -194,7 +199,7 @@ function check_log_path() {
function check_data_path() { function check_data_path() {
# check data path # check data path
check_file ${data_dir} check_file ${data_dir}
echo -e "Check data path:\033[32mOK\033[0m!" echo -e "Check data path:\033[32mOK\033[0m!"
} }
...@@ -204,7 +209,7 @@ function install_TDengine() { ...@@ -204,7 +209,7 @@ function install_TDengine() {
temp_version=$(get_package_name $1) temp_version=$(get_package_name $1)
cd $(get_package_name $1) cd $(get_package_name $1)
echo -e "\033[32muninstall TDengine && install TDengine...\033[0m" echo -e "\033[32muninstall TDengine && install TDengine...\033[0m"
rmtaos >/dev/null 2>&1 || echo 'taosd not installed' && echo -e '\n\n' |./install.sh >/dev/null 2>&1 rmtaos >/dev/null 2>&1 || echo 'taosd not installed' && echo -e '\n\n' |./install.sh >/dev/null 2>&1
echo -e "\033[32mTDengine has been installed!\033[0m" echo -e "\033[32mTDengine has been installed!\033[0m"
echo -e "\033[32mTDengine is starting...\033[0m" echo -e "\033[32mTDengine is starting...\033[0m"
kill_process taos && systemctl start taosd && sleep 10 kill_process taos && systemctl start taosd && sleep 10
...@@ -216,18 +221,19 @@ function test_TDengine() { ...@@ -216,18 +221,19 @@ function test_TDengine() {
check_lib_path check_lib_path
check_header_path check_header_path
check_config_dir check_config_dir
check_blm3_config_dir
check_log_path check_log_path
check_data_path check_data_path
result=`taos -s 'create database test ;create table test.tt(ts timestamp ,i int);insert into test.tt values(now,11);select * from test.tt' 2>&1 ||:` result=`taos -s 'create database test ;create table test.tt(ts timestamp ,i int);insert into test.tt values(now,11);select * from test.tt' 2>&1 ||:`
if [[ $result =~ "Unable to establish" ]];then if [[ $result =~ "Unable to establish" ]];then
echo -e "\033[31mTDengine connect failed\033[0m" echo -e "\033[31mTDengine connect failed\033[0m"
fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n" fin_result=$fin_result"\033[31m$temp_version\033[0m test failed!\n"
echo -e $fin_result echo -e $fin_result
exit 8 exit 8
fi fi
echo -e "Check TDengine connect:\033[32mOK\033[0m!" echo -e "Check TDengine connect:\033[32mOK\033[0m!"
fin_result=$fin_result"\033[32m$temp_version\033[0m test OK!\n" fin_result=$fin_result"\033[32m$temp_version\033[0m test OK!\n"
} }
# ## ==============================Main program starts from here============================ # ## ==============================Main program starts from here============================
TD_package_name=`ls ${script_dir}/*server*gz |awk -F '/' '{print $NF}' ` TD_package_name=`ls ${script_dir}/*server*gz |awk -F '/' '{print $NF}' `
temp=`pwd` temp=`pwd`
...@@ -242,4 +248,4 @@ for i in $TD_package_name;do ...@@ -242,4 +248,4 @@ for i in $TD_package_name;do
test_TDengine test_TDengine
done done
echo "============================================================" echo "============================================================"
echo -e $fin_result echo -e $fin_result
\ No newline at end of file
...@@ -24,9 +24,13 @@ fi ...@@ -24,9 +24,13 @@ fi
# if taos.cfg already softlink, remove it # if taos.cfg already softlink, remove it
cfg_install_dir="/etc/taos" cfg_install_dir="/etc/taos"
install_main_dir="/usr/local/taos" install_main_dir="/usr/local/taos"
if [ -f ${cfg_install_dir}/taos.cfg ]; then if [ -f "${install_main_dir}/taos.cfg" ]; then
${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || : ${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || :
fi fi
if [ -f "${install_main_dir}/blm.toml" ]; then
${csudo} rm -f ${install_main_dir}/cfg/blm.toml || :
fi
# there can not libtaos.so*, otherwise ln -s error # there can not libtaos.so*, otherwise ln -s error
${csudo} rm -f ${install_main_dir}/driver/libtaos* || : ${csudo} rm -f ${install_main_dir}/driver/libtaos* || :
...@@ -17,7 +17,7 @@ else ...@@ -17,7 +17,7 @@ else
bin_link_dir="/usr/bin" bin_link_dir="/usr/bin"
lib_link_dir="/usr/lib" lib_link_dir="/usr/lib"
inc_link_dir="/usr/include" inc_link_dir="/usr/include"
data_link_dir="/usr/local/taos/data" data_link_dir="/usr/local/taos/data"
log_link_dir="/usr/local/taos/log" log_link_dir="/usr/local/taos/log"
cfg_link_dir="/usr/local/taos/cfg" cfg_link_dir="/usr/local/taos/cfg"
...@@ -25,15 +25,16 @@ else ...@@ -25,15 +25,16 @@ else
# Remove all links # Remove all links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${cfg_link_dir}/* || :
${csudo} rm -f ${inc_link_dir}/taos.h || : ${csudo} rm -f ${inc_link_dir}/taos.h || :
${csudo} rm -f ${lib_link_dir}/libtaos.* || : ${csudo} rm -f ${lib_link_dir}/libtaos.* || :
${csudo} rm -f ${log_link_dir} || : ${csudo} rm -f ${log_link_dir} || :
${csudo} rm -f ${data_link_dir} || : ${csudo} rm -f ${data_link_dir} || :
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo} kill -9 $pid || : ${csudo} kill -9 $pid || :
......
...@@ -44,15 +44,25 @@ mkdir -p ${pkg_dir}${install_home_path}/init.d ...@@ -44,15 +44,25 @@ mkdir -p ${pkg_dir}${install_home_path}/init.d
mkdir -p ${pkg_dir}${install_home_path}/script mkdir -p ${pkg_dir}${install_home_path}/script
cp ${compile_dir}/../packaging/cfg/taos.cfg ${pkg_dir}${install_home_path}/cfg cp ${compile_dir}/../packaging/cfg/taos.cfg ${pkg_dir}${install_home_path}/cfg
if [ -f "${compile_dir}/test/cfg/blm.toml" ]; then
cp ${compile_dir}/test/cfg/blm.toml ${pkg_dir}${install_home_path}/cfg
fi
cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d
cp ${compile_dir}/../packaging/tools/post.sh ${pkg_dir}${install_home_path}/script cp ${compile_dir}/../packaging/tools/post.sh ${pkg_dir}${install_home_path}/script
cp ${compile_dir}/../packaging/tools/preun.sh ${pkg_dir}${install_home_path}/script cp ${compile_dir}/../packaging/tools/preun.sh ${pkg_dir}${install_home_path}/script
cp ${compile_dir}/../packaging/tools/startPre.sh ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/../packaging/tools/startPre.sh ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/../packaging/tools/set_core.sh ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/../packaging/tools/set_core.sh ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/../packaging/tools/taosd-dump-cfg.gdb ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/../packaging/tools/taosd-dump-cfg.gdb ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosdemo ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/bin/taosdemo ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosdump ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/bin/taosdump ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_path}/bin
if [ -f "${compile_dir}/build/bin/blm3" ]; then
cp ${compile_dir}/build/bin/blm3 ${pkg_dir}${install_home_path}/bin ||:
fi
cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_path}/driver cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_path}/driver
cp ${compile_dir}/../src/inc/taos.h ${pkg_dir}${install_home_path}/include cp ${compile_dir}/../src/inc/taos.h ${pkg_dir}${install_home_path}/include
......
...@@ -24,6 +24,11 @@ USER="root" ...@@ -24,6 +24,11 @@ USER="root"
GROUP="root" GROUP="root"
DAEMON="/usr/local/taos/bin/taosd" DAEMON="/usr/local/taos/bin/taosd"
DAEMON_OPTS="" DAEMON_OPTS=""
HTTPD_NAME="blm3"
DAEMON_HTTPD_NAME=$HTTPD_NAME
DAEMON_HTTPD="/usr/local/taos/bin/$HTTPD_NAME"
PID_FILE="/var/run/$NAME.pid" PID_FILE="/var/run/$NAME.pid"
APPARGS="" APPARGS=""
...@@ -36,6 +41,7 @@ case "$1" in ...@@ -36,6 +41,7 @@ case "$1" in
start) start)
log_action_begin_msg "Starting TDEngine..." log_action_begin_msg "Starting TDEngine..."
$DAEMON_HTTPD &
if start-stop-daemon --test --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile "$PID_FILE" --exec "$DAEMON" -- $APPARGS &> /dev/null; then if start-stop-daemon --test --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile "$PID_FILE" --exec "$DAEMON" -- $APPARGS &> /dev/null; then
touch "$PID_FILE" && chown "$USER":"$GROUP" "$PID_FILE" touch "$PID_FILE" && chown "$USER":"$GROUP" "$PID_FILE"
...@@ -52,6 +58,7 @@ case "$1" in ...@@ -52,6 +58,7 @@ case "$1" in
stop) stop)
log_action_begin_msg "Stopping TDEngine..." log_action_begin_msg "Stopping TDEngine..."
pkill -9 $DAEMON_HTTPD_NAME
set +e set +e
if [ -f "$PID_FILE" ]; then if [ -f "$PID_FILE" ]; then
start-stop-daemon --stop --pidfile "$PID_FILE" --user "$USER" --retry=TERM/120/KILL/5 > /dev/null start-stop-daemon --stop --pidfile "$PID_FILE" --user "$USER" --retry=TERM/120/KILL/5 > /dev/null
......
...@@ -196,13 +196,17 @@ if [[ "$dbName" == "pro" ]]; then ...@@ -196,13 +196,17 @@ if [[ "$dbName" == "pro" ]]; then
sed -i "s/taos config/prodb config/g" ${top_dir}/src/util/src/tconfig.c sed -i "s/taos config/prodb config/g" ${top_dir}/src/util/src/tconfig.c
fi fi
echo "build ${pagMode} package ..."
if [[ "$pagMode" == "lite" ]]; then
BUILD_HTTP=true
fi
# check support cpu type # check support cpu type
if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "mips64" ]] ; then if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "mips64" ]] ; then
if [ "$verMode" != "cluster" ]; then if [ "$verMode" != "cluster" ]; then
cmake ../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} ${allocator_macro} cmake ../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} -DBUILD_HTTP=${BUILD_HTTP} ${allocator_macro}
else else
cmake ../../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} ${allocator_macro} cmake ../../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DBUILD_HTTP=${BUILD_HTTP} ${allocator_macro}
fi fi
else else
echo "input cpuType=${cpuType} error!!!" echo "input cpuType=${cpuType} error!!!"
......
...@@ -54,6 +54,9 @@ mkdir -p %{buildroot}%{homepath}/init.d ...@@ -54,6 +54,9 @@ mkdir -p %{buildroot}%{homepath}/init.d
mkdir -p %{buildroot}%{homepath}/script mkdir -p %{buildroot}%{homepath}/script
cp %{_compiledir}/../packaging/cfg/taos.cfg %{buildroot}%{homepath}/cfg cp %{_compiledir}/../packaging/cfg/taos.cfg %{buildroot}%{homepath}/cfg
if [ -f %{_compiledir}/test/cfg/blm.toml ]; then
cp %{_compiledir}/test/cfg/blm.toml %{buildroot}%{homepath}/cfg
fi
cp %{_compiledir}/../packaging/rpm/taosd %{buildroot}%{homepath}/init.d cp %{_compiledir}/../packaging/rpm/taosd %{buildroot}%{homepath}/init.d
cp %{_compiledir}/../packaging/tools/post.sh %{buildroot}%{homepath}/script cp %{_compiledir}/../packaging/tools/post.sh %{buildroot}%{homepath}/script
cp %{_compiledir}/../packaging/tools/preun.sh %{buildroot}%{homepath}/script cp %{_compiledir}/../packaging/tools/preun.sh %{buildroot}%{homepath}/script
...@@ -62,6 +65,9 @@ cp %{_compiledir}/../packaging/tools/set_core.sh %{buildroot}%{homepath}/bin ...@@ -62,6 +65,9 @@ cp %{_compiledir}/../packaging/tools/set_core.sh %{buildroot}%{homepath}/bin
cp %{_compiledir}/../packaging/tools/taosd-dump-cfg.gdb %{buildroot}%{homepath}/bin cp %{_compiledir}/../packaging/tools/taosd-dump-cfg.gdb %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taos %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taos %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosd %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosd %{buildroot}%{homepath}/bin
if [ -f %{_compiledir}/build/bin/blm3 ]; then
cp %{_compiledir}/build/bin/blm3 %{buildroot}%{homepath}/bin ||:
fi
cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driver cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driver
...@@ -150,6 +156,11 @@ if [ -f %{cfg_install_dir}/taos.cfg ]; then ...@@ -150,6 +156,11 @@ if [ -f %{cfg_install_dir}/taos.cfg ]; then
${csudo} rm -f %{homepath}/cfg/taos.cfg || : ${csudo} rm -f %{homepath}/cfg/taos.cfg || :
fi fi
# if blm.toml already softlink, remove it
if [ -f %{cfg_install_dir}/blm.toml ]; then
${csudo} rm -f %{homepath}/cfg/blm.toml || :
fi
# there can not libtaos.so*, otherwise ln -s error # there can not libtaos.so*, otherwise ln -s error
${csudo} rm -f %{homepath}/driver/libtaos* || : ${csudo} rm -f %{homepath}/driver/libtaos* || :
...@@ -188,6 +199,7 @@ if [ $1 -eq 0 ];then ...@@ -188,6 +199,7 @@ if [ $1 -eq 0 ];then
# Remove all links # Remove all links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${cfg_link_dir}/* || :
......
...@@ -185,6 +185,7 @@ function install_bin() { ...@@ -185,6 +185,7 @@ function install_bin() {
# Remove links # Remove links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
...@@ -196,6 +197,7 @@ function install_bin() { ...@@ -196,6 +197,7 @@ function install_bin() {
#Make link #Make link
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || : [ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
[ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || : [ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || :
[ -x ${install_main_dir}/bin/blm3 ] && ${csudo} ln -s ${install_main_dir}/bin/blm3 ${bin_link_dir}/blm3 || :
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || :
...@@ -445,10 +447,27 @@ function local_fqdn_check() { ...@@ -445,10 +447,27 @@ function local_fqdn_check() {
fi fi
} }
function install_blm3_config() {
if [ ! -f "${cfg_install_dir}/blm.toml" ]; then
${csudo} mkdir -p ${cfg_install_dir}
[ -f ${script_dir}/cfg/blm.toml ] && ${csudo} cp ${script_dir}/cfg/blm.toml ${cfg_install_dir}
[ -f ${cfg_install_dir}/blm.toml ] && ${csudo} chmod 644 ${cfg_install_dir}/blm.toml
fi
[ -f ${script_dir}/cfg/blm.toml ] &&
${csudo} cp -f ${script_dir}/cfg/blm.toml ${install_main_dir}/cfg/blm.toml.org
[ -f ${cfg_install_dir}/blm.toml ] &&
${csudo} ln -s ${cfg_install_dir}/blm.toml ${install_main_dir}/cfg/blm.toml
[ ! -z $1 ] && return 0 || : # only install client
}
function install_config() { function install_config() {
#${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || : #${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || :
if [ ! -f ${cfg_install_dir}/taos.cfg ]; then if [ ! -f "${cfg_install_dir}/taos.cfg" ]; then
${csudo} mkdir -p ${cfg_install_dir} ${csudo} mkdir -p ${cfg_install_dir}
[ -f ${script_dir}/cfg/taos.cfg ] && ${csudo} cp ${script_dir}/cfg/taos.cfg ${cfg_install_dir} [ -f ${script_dir}/cfg/taos.cfg ] && ${csudo} cp ${script_dir}/cfg/taos.cfg ${cfg_install_dir}
${csudo} chmod 644 ${cfg_install_dir}/* ${csudo} chmod 644 ${cfg_install_dir}/*
...@@ -860,6 +879,7 @@ function update_TDengine() { ...@@ -860,6 +879,7 @@ function update_TDengine() {
install_bin install_bin
install_service install_service
install_config install_config
install_blm3_config
openresty_work=false openresty_work=false
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
...@@ -1002,7 +1022,7 @@ function install_TDengine() { ...@@ -1002,7 +1022,7 @@ function install_TDengine() {
echo echo
echo -e "\033[44;32;1mTDengine client is installed successfully!${NC}" echo -e "\033[44;32;1mTDengine client is installed successfully!${NC}"
fi fi
touch ~/.taos_history touch ~/.taos_history
rm -rf $(tar -tf taos.tar.gz) rm -rf $(tar -tf taos.tar.gz)
} }
......
...@@ -46,7 +46,7 @@ else ...@@ -46,7 +46,7 @@ else
install_main_dir="/usr/local/Cellar/tdengine/${verNumber}" install_main_dir="/usr/local/Cellar/tdengine/${verNumber}"
install_main_2_dir="/usr/local/Cellar/tdengine@${verNumber}/${verNumber}" install_main_2_dir="/usr/local/Cellar/tdengine@${verNumber}/${verNumber}"
bin_dir="/usr/local/Cellar/tdengine/${verNumber}/bin" bin_dir="/usr/local/Cellar/tdengine/${verNumber}/bin"
bin_2_dir="/usr/local/Cellar/tdengine@${verNumber}/${verNumber}/bin" bin_2_dir="/usr/local/Cellar/tdengine@${verNumber}/${verNumber}/bin"
fi fi
...@@ -114,6 +114,13 @@ if [ "$osType" != "Darwin" ]; then ...@@ -114,6 +114,13 @@ if [ "$osType" != "Darwin" ]; then
fi fi
fi fi
function kill_blm3() {
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo} kill -9 $pid || :
fi
}
function kill_taosd() { function kill_taosd() {
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
...@@ -149,6 +156,7 @@ function install_bin() { ...@@ -149,6 +156,7 @@ function install_bin() {
# Remove links # Remove links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
...@@ -156,25 +164,26 @@ function install_bin() { ...@@ -156,25 +164,26 @@ function install_bin() {
${csudo} rm -f ${bin_link_dir}/perfMonitor || : ${csudo} rm -f ${bin_link_dir}/perfMonitor || :
${csudo} rm -f ${bin_link_dir}/set_core || : ${csudo} rm -f ${bin_link_dir}/set_core || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
${csudo} cp -r ${binary_dir}/build/bin/* ${install_main_dir}/bin ${csudo} cp -r ${binary_dir}/build/bin/* ${install_main_dir}/bin
${csudo} cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_dir}/bin ${csudo} cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_dir}/bin
${csudo} cp -r ${script_dir}/remove.sh ${install_main_dir}/bin ${csudo} cp -r ${script_dir}/remove.sh ${install_main_dir}/bin
${csudo} cp -r ${script_dir}/set_core.sh ${install_main_dir}/bin ${csudo} cp -r ${script_dir}/set_core.sh ${install_main_dir}/bin
${csudo} cp -r ${script_dir}/startPre.sh ${install_main_dir}/bin ${csudo} cp -r ${script_dir}/startPre.sh ${install_main_dir}/bin
${csudo} chmod 0555 ${install_main_dir}/bin/* ${csudo} chmod 0555 ${install_main_dir}/bin/*
#Make link #Make link
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || : [ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
[ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || : [ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || :
[ -x ${install_main_dir}/bin/blm3 ] && ${csudo} ln -s ${install_main_dir}/bin/blm3 ${bin_link_dir}/blm3 || :
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${install_main_dir}/bin/perfMonitor ] && ${csudo} ln -s ${install_main_dir}/bin/perfMonitor ${bin_link_dir}/perfMonitor || : [ -x ${install_main_dir}/bin/perfMonitor ] && ${csudo} ln -s ${install_main_dir}/bin/perfMonitor ${bin_link_dir}/perfMonitor || :
[ -x ${install_main_dir}/set_core.sh ] && ${csudo} ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : [ -x ${install_main_dir}/set_core.sh ] && ${csudo} ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || :
else else
${csudo} cp -r ${binary_dir}/build/bin/* ${install_main_dir}/bin || ${csudo} cp -r ${binary_dir}/build/bin/* ${install_main_2_dir}/bin || : ${csudo} cp -r ${binary_dir}/build/bin/* ${install_main_dir}/bin || ${csudo} cp -r ${binary_dir}/build/bin/* ${install_main_2_dir}/bin || :
${csudo} cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_dir}/bin || ${csudo}cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_2_dir} || : ${csudo} cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_dir}/bin || ${csudo}cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_2_dir} || :
${csudo} cp -r ${script_dir}/remove_client.sh ${install_main_dir}/bin || ${csudo} cp -r ${script_dir}/remove_client.sh ${install_main_2_dir}/bin ${csudo} cp -r ${script_dir}/remove_client.sh ${install_main_dir}/bin || ${csudo} cp -r ${script_dir}/remove_client.sh ${install_main_2_dir}/bin
...@@ -182,6 +191,7 @@ function install_bin() { ...@@ -182,6 +191,7 @@ function install_bin() {
#Make link #Make link
[ -x ${install_main_dir}/bin/taos ] || [ -x ${install_main_2_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || ${csudo} ln -s ${install_main_2_dir}/bin/taos || : [ -x ${install_main_dir}/bin/taos ] || [ -x ${install_main_2_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || ${csudo} ln -s ${install_main_2_dir}/bin/taos || :
[ -x ${install_main_dir}/bin/taosd ] || [ -x ${install_main_2_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || ${csudo} ln -s ${install_main_2_dir}/bin/taosd || : [ -x ${install_main_dir}/bin/taosd ] || [ -x ${install_main_2_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || ${csudo} ln -s ${install_main_2_dir}/bin/taosd || :
[ -x ${install_main_dir}/bin/blm3 ] || [ -x ${install_main_2_dir}/bin/blm3 ] && ${csudo} ln -s ${install_main_dir}/bin/blm3 ${bin_link_dir}/blm3 || ${csudo} ln -s ${install_main_2_dir}/bin/blm3 || :
[ -x ${install_main_dir}/bin/taosdump ] || [ -x ${install_main_2_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || ln -s ${install_main_2_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdump ] || [ -x ${install_main_2_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || ln -s ${install_main_2_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
[ -x ${install_main_dir}/bin/taosdemo ] || [ -x ${install_main_2_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || ln -s ${install_main_2_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${install_main_dir}/bin/taosdemo ] || [ -x ${install_main_2_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || ln -s ${install_main_2_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
fi fi
...@@ -191,40 +201,38 @@ function install_jemalloc() { ...@@ -191,40 +201,38 @@ function install_jemalloc() {
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
/usr/bin/install -c -d /usr/local/bin /usr/bin/install -c -d /usr/local/bin
if [ -f ${binary_dir}/build/bin/jemalloc-config ]; then if [ -f "${binary_dir}/build/bin/jemalloc-config" ]; then
/usr/bin/install -c -m 755 ${binary_dir}/build/bin/jemalloc-config /usr/local/bin /usr/bin/install -c -m 755 ${binary_dir}/build/bin/jemalloc-config /usr/local/bin
fi fi
if [ -f ${binary_dir}/build/bin/jemalloc.sh ]; then if [ -f "${binary_dir}/build/bin/jemalloc.sh" ]; then
/usr/bin/install -c -m 755 ${binary_dir}/build/bin/jemalloc.sh /usr/local/bin /usr/bin/install -c -m 755 ${binary_dir}/build/bin/jemalloc.sh /usr/local/bin
fi fi
if [ -f ${binary_dir}/build/bin/jeprof ]; then if [ -f "${binary_dir}/build/bin/jeprof" ]; then
/usr/bin/install -c -m 755 ${binary_dir}/build/bin/jeprof /usr/local/bin /usr/bin/install -c -m 755 ${binary_dir}/build/bin/jeprof /usr/local/bin
fi fi
if [ -f ${binary_dir}/build/include/jemalloc/jemalloc.h ]; then if [ -f "${binary_dir}/build/include/jemalloc/jemalloc.h" ]; then
/usr/bin/install -c -d /usr/local/include/jemalloc /usr/bin/install -c -d /usr/local/include/jemalloc
/usr/bin/install -c -m 644 ${binary_dir}/build/include/jemalloc/jemalloc.h /usr/local/include/jemalloc /usr/bin/install -c -m 644 ${binary_dir}/build/include/jemalloc/jemalloc.h /usr/local/include/jemalloc
fi fi
if [ -f ${binary_dir}/build/lib/libjemalloc.so.2 ]; then if [ -f "${binary_dir}/build/lib/libjemalloc.so.2" ]; then
/usr/bin/install -c -d /usr/local/lib /usr/bin/install -c -d /usr/local/lib
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc.so.2 /usr/local/lib /usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc.so.2 /usr/local/lib
ln -sf libjemalloc.so.2 /usr/local/lib/libjemalloc.so ln -sf libjemalloc.so.2 /usr/local/lib/libjemalloc.so
/usr/bin/install -c -d /usr/local/lib /usr/bin/install -c -d /usr/local/lib
if [ -f ${binary_dir}/build/lib/libjemalloc.a ]; then [ -f ${binary_dir}/build/lib/libjemalloc.a ] &&
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc.a /usr/local/lib /usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc.a /usr/local/lib
fi [ -f ${binary_dir}/build/lib/libjemalloc_pic.a ] &&
if [ -f ${binary_dir}/build/lib/libjemalloc_pic.a ]; then
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc_pic.a /usr/local/lib /usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc_pic.a /usr/local/lib
fi if [ -f "${binary_dir}/build/lib/pkgconfig/jemalloc.pc" ]; then
if [ -f ${binary_dir}/build/lib/pkgconfig/jemalloc.pc ]; then
/usr/bin/install -c -d /usr/local/lib/pkgconfig /usr/bin/install -c -d /usr/local/lib/pkgconfig
/usr/bin/install -c -m 644 ${binary_dir}/build/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig /usr/bin/install -c -m 644 ${binary_dir}/build/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
fi fi
fi fi
if [ -f ${binary_dir}/build/share/doc/jemalloc/jemalloc.html ]; then if [ -f "${binary_dir}/build/share/doc/jemalloc/jemalloc.html" ]; then
/usr/bin/install -c -d /usr/local/share/doc/jemalloc /usr/bin/install -c -d /usr/local/share/doc/jemalloc
/usr/bin/install -c -m 644 ${binary_dir}/build/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc /usr/bin/install -c -m 644 ${binary_dir}/build/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc
fi fi
if [ -f ${binary_dir}/build/share/man/man3/jemalloc.3 ]; then if [ -f "${binary_dir}/build/share/man/man3/jemalloc.3" ]; then
/usr/bin/install -c -d /usr/local/share/man/man3 /usr/bin/install -c -d /usr/local/share/man/man3
/usr/bin/install -c -m 644 ${binary_dir}/build/share/man/man3/jemalloc.3 /usr/local/share/man/man3 /usr/bin/install -c -m 644 ${binary_dir}/build/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi fi
...@@ -256,13 +264,13 @@ function install_lib() { ...@@ -256,13 +264,13 @@ function install_lib() {
fi fi
else else
${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_dir}/driver || ${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_2_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/* || ${csudo} chmod 777 ${install_main_2_dir}/driver/* ${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_dir}/driver || ${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_2_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/* || ${csudo} chmod 777 ${install_main_2_dir}/driver/*
${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${install_main_dir}/driver/libtaos.1.dylib || ${csudo} ln -sf ${install_main_2_dir}/driver/libtaos.* ${install_main_2_dir}/driver/libtaos.1.dylib || : ${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${install_main_dir}/driver/libtaos.1.dylib || ${csudo} ln -sf ${install_main_2_dir}/driver/libtaos.* ${install_main_2_dir}/driver/libtaos.1.dylib || :
${csudo} ln -sf ${install_main_dir}/driver/libtaos.1.dylib ${install_main_dir}/driver/libtaos.dylib || ${csudo} ln -sf ${install_main_2_dir}/driver/libtaos.1.dylib ${install_main_2_dir}/driver/libtaos.dylib || : ${csudo} ln -sf ${install_main_dir}/driver/libtaos.1.dylib ${install_main_dir}/driver/libtaos.dylib || ${csudo} ln -sf ${install_main_2_dir}/driver/libtaos.1.dylib ${install_main_2_dir}/driver/libtaos.dylib || :
${csudo} ln -sf ${install_main_dir}/driver/libtaos.${verNumber}.dylib ${lib_link_dir}/libtaos.1.dylib || ${csudo} ln -sf ${install_main_2_dir}/driver/libtaos.${verNumber}.dylib ${lib_link_dir}/libtaos.1.dylib || : ${csudo} ln -sf ${install_main_dir}/driver/libtaos.${verNumber}.dylib ${lib_link_dir}/libtaos.1.dylib || ${csudo} ln -sf ${install_main_2_dir}/driver/libtaos.${verNumber}.dylib ${lib_link_dir}/libtaos.1.dylib || :
${csudo} ln -sf ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib || : ${csudo} ln -sf ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib || :
fi fi
install_jemalloc install_jemalloc
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
...@@ -285,18 +293,36 @@ function install_header() { ...@@ -285,18 +293,36 @@ function install_header() {
function install_config() { function install_config() {
#${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || : #${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || :
if [ ! -f ${cfg_install_dir}/taos.cfg ]; then if [ ! -f "${cfg_install_dir}/taos.cfg" ]; then
${csudo} mkdir -p ${cfg_install_dir} ${csudo} mkdir -p ${cfg_install_dir}
[ -f ${script_dir}/../cfg/taos.cfg ] && [ -f ${script_dir}/../cfg/taos.cfg ] &&
${csudo} cp ${script_dir}/../cfg/taos.cfg ${cfg_install_dir} ${csudo} cp ${script_dir}/../cfg/taos.cfg ${cfg_install_dir}
${csudo} chmod 644 ${cfg_install_dir}/* ${csudo} chmod 644 ${cfg_install_dir}/taos.cfg
${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org
${csudo} ln -s ${cfg_install_dir}/taos.cfg ${install_main_dir}/cfg ${csudo} ln -s ${cfg_install_dir}/taos.cfg ${install_main_dir}/cfg/taos.cfg
else else
${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org || ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_2_dir}/cfg/taos.cfg.org ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org || ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_2_dir}/cfg/taos.cfg.org
fi fi
} }
function install_blm3_config() {
if [ ! -f "${cfg_install_dir}/blm.toml" ]; then
${csudo} mkdir -p ${cfg_install_dir}
[ -f ${binary_dir}/test/cfg/blm.toml ] &&
${csudo} cp ${binary_dir}/test/cfg/blm.toml ${cfg_install_dir}
[ -f ${cfg_install_dir}/blm.toml ] &&
${csudo} chmod 644 ${cfg_install_dir}/blm.toml
[ -f ${binary_dir}/test/cfg//blm.toml ] &&
${csudo} cp -f ${binary_dir}/test/cfg/blm.toml ${install_main_dir}/cfg/blm.toml.org
[ -f ${cfg_install_dir}/blm.toml ] &&
${csudo} ln -s ${cfg_install_dir}/blm.toml ${install_main_dir}/cfg/blm.toml
else
[ -f ${binary_dir}/test/cfg//blm.toml ] &&
${csudo} cp -f ${binary_dir}/test/cfg/blm.toml ${install_main_dir}/cfg/blm.toml.org \
|| ${csudo} cp -f ${binary_dir}/test/cfg/blm.toml ${install_main_2_dir}/cfg/blm.toml.org
fi
}
function install_log() { function install_log() {
${csudo} rm -rf ${log_dir} || : ${csudo} rm -rf ${log_dir} || :
${csudo} mkdir -p ${log_dir} && ${csudo} chmod 777 ${log_dir} ${csudo} mkdir -p ${log_dir} && ${csudo} chmod 777 ${log_dir}
...@@ -445,6 +471,7 @@ function install_service() { ...@@ -445,6 +471,7 @@ function install_service() {
install_service_on_sysvinit install_service_on_sysvinit
else else
# must manual stop taosd # must manual stop taosd
kill_blm3
kill_taosd kill_taosd
fi fi
} }
...@@ -460,6 +487,7 @@ function update_TDengine() { ...@@ -460,6 +487,7 @@ function update_TDengine() {
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
${csudo} service taosd stop || : ${csudo} service taosd stop || :
else else
kill_blm3
kill_taosd kill_taosd
fi fi
sleep 1 sleep 1
...@@ -480,6 +508,7 @@ function update_TDengine() { ...@@ -480,6 +508,7 @@ function update_TDengine() {
fi fi
install_config install_config
install_blm3_config
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
echo echo
...@@ -487,6 +516,7 @@ function update_TDengine() { ...@@ -487,6 +516,7 @@ function update_TDengine() {
echo echo
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg" echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
echo -e "${GREEN_DARK}To configure blm3 (if has) ${NC}: edit /etc/taos/blm.toml"
if ((${service_mod}==0)); then if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}" echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}"
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
...@@ -516,7 +546,7 @@ function install_TDengine() { ...@@ -516,7 +546,7 @@ function install_TDengine() {
else else
echo -e "${GREEN}Start to install TDEngine Client ...${NC}" echo -e "${GREEN}Start to install TDEngine Client ...${NC}"
fi fi
install_main_path install_main_path
install_data install_data
...@@ -526,12 +556,13 @@ function install_TDengine() { ...@@ -526,12 +556,13 @@ function install_TDengine() {
install_connector install_connector
install_examples install_examples
install_bin install_bin
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
install_service install_service
fi fi
install_config install_config
install_blm3_config
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
# Ask if to start the service # Ask if to start the service
...@@ -539,6 +570,7 @@ function install_TDengine() { ...@@ -539,6 +570,7 @@ function install_TDengine() {
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}" echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
echo echo
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg" echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
echo -e "${GREEN_DARK}To configure blm (if has) ${NC}: edit /etc/taos/blm.toml"
if ((${service_mod}==0)); then if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}" echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}"
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
......
...@@ -183,7 +183,7 @@ pkg_name=${install_dir}-${osType}-${cpuType} ...@@ -183,7 +183,7 @@ pkg_name=${install_dir}-${osType}-${cpuType}
# fi # fi
if [[ "$verType" == "beta" ]] || [[ "$verType" == "preRelease" ]]; then if [[ "$verType" == "beta" ]] || [[ "$verType" == "preRelease" ]]; then
pkg_name=${install_dir}-${verType}-${osType}-${cpuType} pkg_name=${install_dir}-${verType}-${osType}-${cpuType}
elif [ "$verType" == "stable" ]; then elif [ "$verType" == "stable" ]; then
pkg_name=${pkg_name} pkg_name=${pkg_name}
else else
......
...@@ -35,10 +35,19 @@ fi ...@@ -35,10 +35,19 @@ fi
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taosd strip ${build_dir}/bin/taosd
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
# lite version doesn't include blm3, which will lead to no restful interface
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${script_dir}/remove.sh ${script_dir}/startPre.sh" bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${script_dir}/remove.sh ${script_dir}/startPre.sh"
else else
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${build_dir}/bin/taosdump ${build_dir}/bin/taosdemo ${build_dir}/bin/tarbitrator\ bin_files="${build_dir}/bin/taosd \
${script_dir}/remove.sh ${script_dir}/set_core.sh ${script_dir}/startPre.sh ${script_dir}/taosd-dump-cfg.gdb" ${build_dir}/bin/taos \
${build_dir}/bin/blm3 \
${build_dir}/bin/taosdump \
${build_dir}/bin/taosdemo \
${build_dir}/bin/tarbitrator\
${script_dir}/remove.sh \
${script_dir}/set_core.sh \
${script_dir}/startPre.sh \
${script_dir}/taosd-dump-cfg.gdb"
fi fi
lib_files="${build_dir}/lib/libtaos.so.${version}" lib_files="${build_dir}/lib/libtaos.so.${version}"
...@@ -68,6 +77,9 @@ init_file_tarbitrator_rpm=${script_dir}/../rpm/tarbitratord ...@@ -68,6 +77,9 @@ init_file_tarbitrator_rpm=${script_dir}/../rpm/tarbitratord
mkdir -p ${install_dir} mkdir -p ${install_dir}
mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc
mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg
[ -f ${cfg_dir}/blm.toml ] && cp ${cfg_dir}/blm.toml ${install_dir}/cfg/blm.toml
mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/taosd.deb mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/taosd.deb
mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/taosd.rpm mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/taosd.rpm
...@@ -216,7 +228,7 @@ pkg_name=${install_dir}-${osType}-${cpuType} ...@@ -216,7 +228,7 @@ pkg_name=${install_dir}-${osType}-${cpuType}
# fi # fi
if [[ "$verType" == "beta" ]] || [[ "$verType" == "preRelease" ]]; then if [[ "$verType" == "beta" ]] || [[ "$verType" == "preRelease" ]]; then
pkg_name=${install_dir}-${verType}-${osType}-${cpuType} pkg_name=${install_dir}-${verType}-${osType}-${cpuType}
elif [ "$verType" == "stable" ]; then elif [ "$verType" == "stable" ]; then
pkg_name=${pkg_name} pkg_name=${pkg_name}
else else
......
...@@ -81,6 +81,7 @@ else ...@@ -81,6 +81,7 @@ else
# bin_files="${build_dir}/bin/powerd ${build_dir}/bin/power ${build_dir}/bin/powerdemo ${build_dir}/bin/tarbitrator ${script_dir}/remove_power.sh ${script_dir}/set_core.sh" # bin_files="${build_dir}/bin/powerd ${build_dir}/bin/power ${build_dir}/bin/powerdemo ${build_dir}/bin/tarbitrator ${script_dir}/remove_power.sh ${script_dir}/set_core.sh"
cp ${build_dir}/bin/taos ${install_dir}/bin/power cp ${build_dir}/bin/taos ${install_dir}/bin/power
cp ${build_dir}/bin/taosd ${install_dir}/bin/powerd cp ${build_dir}/bin/taosd ${install_dir}/bin/powerd
cp ${build_dir}/bin/blm3 ${install_dir}/bin/blm3 ||:
cp ${script_dir}/remove_power.sh ${install_dir}/bin cp ${script_dir}/remove_power.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump
......
...@@ -62,6 +62,7 @@ else ...@@ -62,6 +62,7 @@ else
fi fi
cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc
cp ${build_dir}/bin/taosd ${install_dir}/bin/prodbs cp ${build_dir}/bin/taosd ${install_dir}/bin/prodbs
cp ${build_dir}/bin/blm3 ${install_dir}/bin/blm3 ||:
cp ${script_dir}/remove_pro.sh ${install_dir}/bin cp ${script_dir}/remove_pro.sh ${install_dir}/bin
chmod a+x ${install_dir}/bin/* || : chmod a+x ${install_dir}/bin/* || :
...@@ -73,7 +74,7 @@ if [ "$verMode" == "cluster" ]; then ...@@ -73,7 +74,7 @@ if [ "$verMode" == "cluster" ]; then
mkdir -p ${install_dir}/nginxd && cp -r ${nginx_dir}/* ${install_dir}/nginxd mkdir -p ${install_dir}/nginxd && cp -r ${nginx_dir}/* ${install_dir}/nginxd
cp ${nginx_dir}/png/taos.png ${install_dir}/nginxd/admin/images/taos.png cp ${nginx_dir}/png/taos.png ${install_dir}/nginxd/admin/images/taos.png
rm -rf ${install_dir}/nginxd/png rm -rf ${install_dir}/nginxd/png
# replace the OEM name, add by yangzy@2021-09-22 # replace the OEM name, add by yangzy@2021-09-22
sed -i -e 's/www.taosdata.com/www.hanatech.com.cn/g' $(grep -r 'www.taosdata.com' ${install_dir}/nginxd | sed -r "s/(.*\.html):\s*(.*)/\1/g") sed -i -e 's/www.taosdata.com/www.hanatech.com.cn/g' $(grep -r 'www.taosdata.com' ${install_dir}/nginxd | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e 's/TAOS Data/Hanatech/g' $(grep -r 'TAOS Data' ${install_dir}/nginxd | sed -r "s/(.*\.html):\s*(.*)/\1/g") sed -i -e 's/TAOS Data/Hanatech/g' $(grep -r 'TAOS Data' ${install_dir}/nginxd | sed -r "s/(.*\.html):\s*(.*)/\1/g")
......
...@@ -82,6 +82,7 @@ else ...@@ -82,6 +82,7 @@ else
cp ${build_dir}/bin/taos ${install_dir}/bin/tq cp ${build_dir}/bin/taos ${install_dir}/bin/tq
cp ${build_dir}/bin/taosd ${install_dir}/bin/tqd cp ${build_dir}/bin/taosd ${install_dir}/bin/tqd
cp ${script_dir}/remove_tq.sh ${install_dir}/bin cp ${script_dir}/remove_tq.sh ${install_dir}/bin
cp ${build_dir}/bin/blm3 ${install_dir}/bin/blm3 ||:
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/tqdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/tqdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/tqdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/tqdump
cp ${build_dir}/bin/tarbitrator ${install_dir}/bin cp ${build_dir}/bin/tarbitrator ${install_dir}/bin
......
#!/bin/bash #!/bin/bash
# #
# This file is used to install tdengine rpm package on centos systems. The operating system # This file is used to install tdengine rpm package on centos systems. The operating system
# is required to use systemd to manage services at boot # is required to use systemd to manage services at boot
#set -x #set -x
...@@ -48,11 +48,11 @@ initd_mod=0 ...@@ -48,11 +48,11 @@ initd_mod=0
service_mod=2 service_mod=2
if pidof systemd &> /dev/null; then if pidof systemd &> /dev/null; then
service_mod=0 service_mod=0
elif $(which service &> /dev/null); then elif $(which service &> /dev/null); then
service_mod=1 service_mod=1
service_config_dir="/etc/init.d" service_config_dir="/etc/init.d"
if $(which chkconfig &> /dev/null); then if $(which chkconfig &> /dev/null); then
initd_mod=1 initd_mod=1
elif $(which insserv &> /dev/null); then elif $(which insserv &> /dev/null); then
initd_mod=2 initd_mod=2
elif $(which update-rc.d &> /dev/null); then elif $(which update-rc.d &> /dev/null); then
...@@ -60,10 +60,18 @@ elif $(which service &> /dev/null); then ...@@ -60,10 +60,18 @@ elif $(which service &> /dev/null); then
else else
service_mod=2 service_mod=2
fi fi
else else
service_mod=2 service_mod=2
fi fi
function kill_blm3() {
# ${csudo} pkill -f blm3 || :
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo} kill -9 $pid || :
fi
}
function kill_taosd() { function kill_taosd() {
# ${csudo} pkill -f taosd || : # ${csudo} pkill -f taosd || :
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
...@@ -74,17 +82,17 @@ function kill_taosd() { ...@@ -74,17 +82,17 @@ function kill_taosd() {
function install_include() { function install_include() {
${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h|| : ${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h|| :
${csudo} ln -s ${inc_dir}/taos.h ${inc_link_dir}/taos.h ${csudo} ln -s ${inc_dir}/taos.h ${inc_link_dir}/taos.h
${csudo} ln -s ${inc_dir}/taoserror.h ${inc_link_dir}/taoserror.h ${csudo} ln -s ${inc_dir}/taoserror.h ${inc_link_dir}/taoserror.h
} }
function install_lib() { function install_lib() {
${csudo} rm -f ${lib_link_dir}/libtaos* || : ${csudo} rm -f ${lib_link_dir}/libtaos* || :
${csudo} rm -f ${lib64_link_dir}/libtaos* || : ${csudo} rm -f ${lib64_link_dir}/libtaos* || :
${csudo} ln -s ${lib_dir}/libtaos.* ${lib_link_dir}/libtaos.so.1 ${csudo} ln -s ${lib_dir}/libtaos.* ${lib_link_dir}/libtaos.so.1
${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so ${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so
if [[ -d ${lib64_link_dir} && ! -e ${lib64_link_dir}/libtaos.so ]]; then if [[ -d ${lib64_link_dir} && ! -e ${lib64_link_dir}/libtaos.so ]]; then
${csudo} ln -s ${lib_dir}/libtaos.* ${lib64_link_dir}/libtaos.so.1 || : ${csudo} ln -s ${lib_dir}/libtaos.* ${lib64_link_dir}/libtaos.so.1 || :
${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || : ${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || :
...@@ -95,6 +103,7 @@ function install_bin() { ...@@ -95,6 +103,7 @@ function install_bin() {
# Remove links # Remove links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
...@@ -105,6 +114,7 @@ function install_bin() { ...@@ -105,6 +114,7 @@ function install_bin() {
#Make link #Make link
[ -x ${bin_dir}/taos ] && ${csudo} ln -s ${bin_dir}/taos ${bin_link_dir}/taos || : [ -x ${bin_dir}/taos ] && ${csudo} ln -s ${bin_dir}/taos ${bin_link_dir}/taos || :
[ -x ${bin_dir}/taosd ] && ${csudo} ln -s ${bin_dir}/taosd ${bin_link_dir}/taosd || : [ -x ${bin_dir}/taosd ] && ${csudo} ln -s ${bin_dir}/taosd ${bin_link_dir}/taosd || :
[ -x ${bin_dir}/blm3 ] && ${csudo} ln -s ${bin_dir}/blm3 ${bin_link_dir}/blm3 || :
[ -x ${bin_dir}/taosdemo ] && ${csudo} ln -s ${bin_dir}/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${bin_dir}/taosdemo ] && ${csudo} ln -s ${bin_dir}/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${bin_dir}/taosdump ] && ${csudo} ln -s ${bin_dir}/taosdump ${bin_link_dir}/taosdump || : [ -x ${bin_dir}/taosdump ] && ${csudo} ln -s ${bin_dir}/taosdump ${bin_link_dir}/taosdump || :
[ -x ${bin_dir}/set_core.sh ] && ${csudo} ln -s ${bin_dir}/set_core.sh ${bin_link_dir}/set_core || : [ -x ${bin_dir}/set_core.sh ] && ${csudo} ln -s ${bin_dir}/set_core.sh ${bin_link_dir}/set_core || :
...@@ -122,13 +132,13 @@ function add_newHostname_to_hosts() { ...@@ -122,13 +132,13 @@ function add_newHostname_to_hosts() {
if [[ "$s" == "$localIp" ]]; then if [[ "$s" == "$localIp" ]]; then
return return
fi fi
done done
${csudo} echo "127.0.0.1 $1" >> /etc/hosts ||: ${csudo} echo "127.0.0.1 $1" >> /etc/hosts ||:
} }
function set_hostname() { function set_hostname() {
echo -e -n "${GREEN}Please enter one hostname(must not be 'localhost')${NC}:" echo -e -n "${GREEN}Please enter one hostname(must not be 'localhost')${NC}:"
read newHostname read newHostname
while true; do while true; do
if [[ ! -z "$newHostname" && "$newHostname" != "localhost" ]]; then if [[ ! -z "$newHostname" && "$newHostname" != "localhost" ]]; then
break break
...@@ -142,25 +152,25 @@ function set_hostname() { ...@@ -142,25 +152,25 @@ function set_hostname() {
if [[ $retval != 0 ]]; then if [[ $retval != 0 ]]; then
echo echo
echo "set hostname fail!" echo "set hostname fail!"
return return
fi fi
#echo -e -n "$(hostnamectl status --static)" #echo -e -n "$(hostnamectl status --static)"
#echo -e -n "$(hostnamectl status --transient)" #echo -e -n "$(hostnamectl status --transient)"
#echo -e -n "$(hostnamectl status --pretty)" #echo -e -n "$(hostnamectl status --pretty)"
#ubuntu/centos /etc/hostname #ubuntu/centos /etc/hostname
if [[ -e /etc/hostname ]]; then if [[ -e /etc/hostname ]]; then
${csudo} echo $newHostname > /etc/hostname ||: ${csudo} echo $newHostname > /etc/hostname ||:
fi fi
#debian: #HOSTNAME=yourname #debian: #HOSTNAME=yourname
if [[ -e /etc/sysconfig/network ]]; then if [[ -e /etc/sysconfig/network ]]; then
${csudo} sed -i -r "s/#*\s*(HOSTNAME=\s*).*/\1$newHostname/" /etc/sysconfig/network ||: ${csudo} sed -i -r "s/#*\s*(HOSTNAME=\s*).*/\1$newHostname/" /etc/sysconfig/network ||:
fi fi
${csudo} sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${cfg_install_dir}/taos.cfg ${csudo} sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${cfg_install_dir}/taos.cfg
serverFqdn=$newHostname serverFqdn=$newHostname
if [[ -e /etc/hosts ]]; then if [[ -e /etc/hosts ]]; then
add_newHostname_to_hosts $newHostname add_newHostname_to_hosts $newHostname
fi fi
...@@ -178,7 +188,7 @@ function is_correct_ipaddr() { ...@@ -178,7 +188,7 @@ function is_correct_ipaddr() {
return 0 return 0
fi fi
done done
return 1 return 1
} }
...@@ -192,13 +202,13 @@ function set_ipAsFqdn() { ...@@ -192,13 +202,13 @@ function set_ipAsFqdn() {
echo echo
echo -e -n "${GREEN}Unable to get local ip, use 127.0.0.1${NC}" echo -e -n "${GREEN}Unable to get local ip, use 127.0.0.1${NC}"
localFqdn="127.0.0.1" localFqdn="127.0.0.1"
# Write the local FQDN to configuration file # Write the local FQDN to configuration file
${csudo} sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/taos.cfg ${csudo} sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/taos.cfg
serverFqdn=$localFqdn serverFqdn=$localFqdn
echo echo
return return
fi fi
echo -e -n "${GREEN}Please choose an IP from local IP list${NC}:" echo -e -n "${GREEN}Please choose an IP from local IP list${NC}:"
echo echo
echo -e -n "${GREEN}$iplist${NC}" echo -e -n "${GREEN}$iplist${NC}"
...@@ -207,15 +217,15 @@ function set_ipAsFqdn() { ...@@ -207,15 +217,15 @@ function set_ipAsFqdn() {
echo -e -n "${GREEN}Notes: if IP is used as the node name, data can NOT be migrated to other machine directly${NC}:" echo -e -n "${GREEN}Notes: if IP is used as the node name, data can NOT be migrated to other machine directly${NC}:"
read localFqdn read localFqdn
while true; do while true; do
if [ ! -z "$localFqdn" ]; then if [ ! -z "$localFqdn" ]; then
# Check if correct ip address # Check if correct ip address
is_correct_ipaddr $localFqdn is_correct_ipaddr $localFqdn
retval=`echo $?` retval=`echo $?`
if [[ $retval != 0 ]]; then if [[ $retval != 0 ]]; then
read -p "Please choose an IP from local IP list:" localFqdn read -p "Please choose an IP from local IP list:" localFqdn
else else
# Write the local FQDN to configuration file # Write the local FQDN to configuration file
${csudo} sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/taos.cfg ${csudo} sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/taos.cfg
serverFqdn=$localFqdn serverFqdn=$localFqdn
break break
fi fi
...@@ -230,49 +240,68 @@ function local_fqdn_check() { ...@@ -230,49 +240,68 @@ function local_fqdn_check() {
echo echo
echo -e -n "System hostname is: ${GREEN}$serverFqdn${NC}" echo -e -n "System hostname is: ${GREEN}$serverFqdn${NC}"
echo echo
if [[ "$serverFqdn" == "" ]] || [[ "$serverFqdn" == "localhost" ]]; then if [[ "$serverFqdn" == "" ]] || [[ "$serverFqdn" == "localhost" ]]; then
echo -e -n "${GREEN}It is strongly recommended to configure a hostname for this machine ${NC}" echo -e -n "${GREEN}It is strongly recommended to configure a hostname for this machine ${NC}"
echo echo
while true while true
do do
read -r -p "Set hostname now? [Y/n] " input read -r -p "Set hostname now? [Y/n] " input
if [ ! -n "$input" ]; then if [ ! -n "$input" ]; then
set_hostname set_hostname
break break
else else
case $input in case $input in
[yY][eE][sS]|[yY]) [yY][eE][sS]|[yY])
set_hostname set_hostname
break break
;; ;;
[nN][oO]|[nN]) [nN][oO]|[nN])
set_ipAsFqdn set_ipAsFqdn
break break
;; ;;
*) *)
echo "Invalid input..." echo "Invalid input..."
;; ;;
esac esac
fi fi
done done
fi fi
} }
function install_blm3_config() {
if [ ! -f "${cfg_install_dir}/blm.toml" ]; then
[ ! -d %{cfg_install_dir} ] &&
${csudo} ${csudo} mkdir -p ${cfg_install_dir}
[ -f ${cfg_dir}/blm.toml ] && ${csudo} cp ${cfg_dir}/blm.toml ${cfg_install_dir}
[ -f ${cfg_install_dir}/blm.toml ] &&
${csudo} chmod 644 ${cfg_install_dir}/blm.toml
fi
# restore the backup standard input, and turn off 6
exec 0<&6 6<&-
[ -f ${cfg_dir}/blm.toml ] &&
${csudo} mv ${cfg_dir}/blm.toml ${cfg_dir}/blm.toml.org
[ -f ${cfg_install_dir}/blm.toml ] &&
${csudo} ln -s ${cfg_install_dir}/blm.toml ${cfg_dir}
}
function install_config() { function install_config() {
if [ ! -f ${cfg_install_dir}/taos.cfg ]; then if [ ! -f "${cfg_install_dir}/taos.cfg" ]; then
${csudo} ${csudo} mkdir -p ${cfg_install_dir} ${csudo} ${csudo} mkdir -p ${cfg_install_dir}
[ -f ${cfg_dir}/taos.cfg ] && ${csudo} cp ${cfg_dir}/taos.cfg ${cfg_install_dir} [ -f ${cfg_dir}/taos.cfg ] && ${csudo} cp ${cfg_dir}/taos.cfg ${cfg_install_dir}
${csudo} chmod 644 ${cfg_install_dir}/* ${csudo} chmod 644 ${cfg_install_dir}/*
fi fi
# Save standard input to 6 and open / dev / TTY on standard input # Save standard input to 6 and open / dev / TTY on standard input
exec 6<&0 0</dev/tty exec 6<&0 0</dev/tty
local_fqdn_check local_fqdn_check
# restore the backup standard input, and turn off 6 # restore the backup standard input, and turn off 6
exec 0<&6 6<&- exec 0<&6 6<&-
...@@ -290,14 +319,14 @@ function install_config() { ...@@ -290,14 +319,14 @@ function install_config() {
echo -e -n "${GREEN}OR leave it blank to build one${NC}:" echo -e -n "${GREEN}OR leave it blank to build one${NC}:"
#read firstEp #read firstEp
if exec < /dev/tty; then if exec < /dev/tty; then
read firstEp; read firstEp;
fi fi
while true; do while true; do
if [ ! -z "$firstEp" ]; then if [ ! -z "$firstEp" ]; then
# check the format of the firstEp # check the format of the firstEp
#if [[ $firstEp == $FQDN_PATTERN ]]; then #if [[ $firstEp == $FQDN_PATTERN ]]; then
# Write the first FQDN to configuration file # Write the first FQDN to configuration file
${csudo} sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${cfg_install_dir}/taos.cfg ${csudo} sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${cfg_install_dir}/taos.cfg
break break
#else #else
# read -p "Please enter the correct FQDN:port: " firstEp # read -p "Please enter the correct FQDN:port: " firstEp
...@@ -305,9 +334,9 @@ function install_config() { ...@@ -305,9 +334,9 @@ function install_config() {
else else
break break
fi fi
done done
# user email # user email
#EMAIL_PATTERN='^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$' #EMAIL_PATTERN='^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$'
#EMAIL_PATTERN='^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$' #EMAIL_PATTERN='^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$'
#EMAIL_PATTERN="^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$" #EMAIL_PATTERN="^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"
...@@ -318,27 +347,27 @@ function install_config() { ...@@ -318,27 +347,27 @@ function install_config() {
if [ ! -z "$emailAddr" ]; then if [ ! -z "$emailAddr" ]; then
# check the format of the emailAddr # check the format of the emailAddr
#if [[ "$emailAddr" =~ $EMAIL_PATTERN ]]; then #if [[ "$emailAddr" =~ $EMAIL_PATTERN ]]; then
# Write the email address to temp file # Write the email address to temp file
email_file="${install_main_dir}/email" email_file="${install_main_dir}/email"
${csudo} bash -c "echo $emailAddr > ${email_file}" ${csudo} bash -c "echo $emailAddr > ${email_file}"
break break
#else #else
# read -p "Please enter the correct email address: " emailAddr # read -p "Please enter the correct email address: " emailAddr
#fi #fi
else else
break break
fi fi
done done
} }
function clean_service_on_sysvinit() { function clean_service_on_sysvinit() {
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start" #restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
#${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || : #${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || :
if pidof taosd &> /dev/null; then if pidof taosd &> /dev/null; then
${csudo} service taosd stop || : ${csudo} service taosd stop || :
fi fi
if ((${initd_mod}==1)); then if ((${initd_mod}==1)); then
${csudo} chkconfig --del taosd || : ${csudo} chkconfig --del taosd || :
elif ((${initd_mod}==2)); then elif ((${initd_mod}==2)); then
...@@ -346,9 +375,9 @@ function clean_service_on_sysvinit() { ...@@ -346,9 +375,9 @@ function clean_service_on_sysvinit() {
elif ((${initd_mod}==3)); then elif ((${initd_mod}==3)); then
${csudo} update-rc.d -f taosd remove || : ${csudo} update-rc.d -f taosd remove || :
fi fi
${csudo} rm -f ${service_config_dir}/taosd || : ${csudo} rm -f ${service_config_dir}/taosd || :
if $(which init &> /dev/null); then if $(which init &> /dev/null); then
${csudo} init q || : ${csudo} init q || :
fi fi
...@@ -359,12 +388,12 @@ function install_service_on_sysvinit() { ...@@ -359,12 +388,12 @@ function install_service_on_sysvinit() {
sleep 1 sleep 1
# Install taosd service # Install taosd service
${csudo} cp %{init_d_dir}/taosd ${service_config_dir} && ${csudo} chmod a+x ${service_config_dir}/taosd ${csudo} cp %{init_d_dir}/taosd ${service_config_dir} && ${csudo} chmod a+x ${service_config_dir}/taosd
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start" #restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
#${csudo} grep -q -F "$restart_config_str" /etc/inittab || ${csudo} bash -c "echo '${restart_config_str}' >> /etc/inittab" #${csudo} grep -q -F "$restart_config_str" /etc/inittab || ${csudo} bash -c "echo '${restart_config_str}' >> /etc/inittab"
if ((${initd_mod}==1)); then if ((${initd_mod}==1)); then
${csudo} chkconfig --add taosd || : ${csudo} chkconfig --add taosd || :
${csudo} chkconfig --level 2345 taosd on || : ${csudo} chkconfig --level 2345 taosd on || :
...@@ -427,6 +456,7 @@ function install_service() { ...@@ -427,6 +456,7 @@ function install_service() {
install_service_on_sysvinit install_service_on_sysvinit
else else
# manual start taosd # manual start taosd
kill_blm3
kill_taosd kill_taosd
fi fi
} }
...@@ -436,20 +466,21 @@ function install_TDengine() { ...@@ -436,20 +466,21 @@ function install_TDengine() {
#install log and data dir , then ln to /usr/local/taos #install log and data dir , then ln to /usr/local/taos
${csudo} mkdir -p ${log_dir} && ${csudo} chmod 777 ${log_dir} ${csudo} mkdir -p ${log_dir} && ${csudo} chmod 777 ${log_dir}
${csudo} mkdir -p ${data_dir} ${csudo} mkdir -p ${data_dir}
${csudo} rm -rf ${log_link_dir} || : ${csudo} rm -rf ${log_link_dir} || :
${csudo} rm -rf ${data_link_dir} || : ${csudo} rm -rf ${data_link_dir} || :
${csudo} ln -s ${log_dir} ${log_link_dir} || : ${csudo} ln -s ${log_dir} ${log_link_dir} || :
${csudo} ln -s ${data_dir} ${data_link_dir} || : ${csudo} ln -s ${data_dir} ${data_link_dir} || :
# Install include, lib, binary and service # Install include, lib, binary and service
install_include install_include
install_lib install_lib
install_bin install_bin
install_service install_service
install_config install_config
install_blm3_config
# Ask if to start the service # Ask if to start the service
#echo #echo
...@@ -461,12 +492,12 @@ function install_TDengine() { ...@@ -461,12 +492,12 @@ function install_TDengine() {
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} update-rc.d taosd default ${RED} for the first time${NC}" echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} update-rc.d taosd default ${RED} for the first time${NC}"
echo -e " : ${csudo} service taosd start ${RED} after${NC}" echo -e " : ${csudo} service taosd start ${RED} after${NC}"
else else
echo -e "${GREEN_DARK}To start TDengine ${NC}: ./taosd${NC}" echo -e "${GREEN_DARK}To start TDengine ${NC}: ./taosd${NC}"
fi fi
if [ ! -z "$firstEp" ]; then if [ ! -z "$firstEp" ]; then
tmpFqdn=${firstEp%%:*} tmpFqdn=${firstEp%%:*}
substr=":" substr=":"
...@@ -476,16 +507,16 @@ function install_TDengine() { ...@@ -476,16 +507,16 @@ function install_TDengine() {
tmpPort="" tmpPort=""
fi fi
if [[ "$tmpPort" != "" ]];then if [[ "$tmpPort" != "" ]];then
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn -P $tmpPort${GREEN_DARK} to login into cluster, then${NC}" echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn -P $tmpPort${GREEN_DARK} to login into cluster, then${NC}"
else else
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn${GREEN_DARK} to login into cluster, then${NC}" echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn${GREEN_DARK} to login into cluster, then${NC}"
fi fi
echo -e "${GREEN_DARK}execute ${NC}: create dnode 'newDnodeFQDN:port'; ${GREEN_DARK}to add this new node${NC}" echo -e "${GREEN_DARK}execute ${NC}: create dnode 'newDnodeFQDN:port'; ${GREEN_DARK}to add this new node${NC}"
echo echo
elif [ ! -z "$serverFqdn" ]; then elif [ ! -z "$serverFqdn" ]; then
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $serverFqdn${GREEN_DARK} to login into TDengine server${NC}" echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $serverFqdn${GREEN_DARK} to login into TDengine server${NC}"
echo echo
fi fi
echo echo
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}" echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
} }
......
...@@ -27,11 +27,11 @@ initd_mod=0 ...@@ -27,11 +27,11 @@ initd_mod=0
service_mod=2 service_mod=2
if pidof systemd &> /dev/null; then if pidof systemd &> /dev/null; then
service_mod=0 service_mod=0
elif $(which service &> /dev/null); then elif $(which service &> /dev/null); then
service_mod=1 service_mod=1
service_config_dir="/etc/init.d" service_config_dir="/etc/init.d"
if $(which chkconfig &> /dev/null); then if $(which chkconfig &> /dev/null); then
initd_mod=1 initd_mod=1
elif $(which insserv &> /dev/null); then elif $(which insserv &> /dev/null); then
initd_mod=2 initd_mod=2
elif $(which update-rc.d &> /dev/null); then elif $(which update-rc.d &> /dev/null); then
...@@ -39,10 +39,17 @@ elif $(which service &> /dev/null); then ...@@ -39,10 +39,17 @@ elif $(which service &> /dev/null); then
else else
service_mod=2 service_mod=2
fi fi
else else
service_mod=2 service_mod=2
fi fi
function kill_blm3() {
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo} kill -9 $pid || :
fi
}
function kill_taosd() { function kill_taosd() {
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
...@@ -59,13 +66,13 @@ function clean_service_on_systemd() { ...@@ -59,13 +66,13 @@ function clean_service_on_systemd() {
fi fi
${csudo} systemctl disable ${taos_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl disable ${taos_service_name} &> /dev/null || echo &> /dev/null
${csudo} rm -f ${taosd_service_config} ${csudo} rm -f ${taosd_service_config}
} }
function clean_service_on_sysvinit() { function clean_service_on_sysvinit() {
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start" #restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
#${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || : #${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || :
if pidof taosd &> /dev/null; then if pidof taosd &> /dev/null; then
echo "TDengine taosd is running, stopping it..." echo "TDengine taosd is running, stopping it..."
${csudo} service taosd stop || : ${csudo} service taosd stop || :
...@@ -78,9 +85,9 @@ function clean_service_on_sysvinit() { ...@@ -78,9 +85,9 @@ function clean_service_on_sysvinit() {
elif ((${initd_mod}==3)); then elif ((${initd_mod}==3)); then
${csudo} update-rc.d -f taosd remove || : ${csudo} update-rc.d -f taosd remove || :
fi fi
${csudo} rm -f ${service_config_dir}/taosd || : ${csudo} rm -f ${service_config_dir}/taosd || :
if $(which init &> /dev/null); then if $(which init &> /dev/null); then
${csudo} init q || : ${csudo} init q || :
fi fi
...@@ -93,6 +100,7 @@ function clean_service() { ...@@ -93,6 +100,7 @@ function clean_service() {
clean_service_on_sysvinit clean_service_on_sysvinit
else else
# must manual stop taosd # must manual stop taosd
kill_blm3
kill_taosd kill_taosd
fi fi
} }
...@@ -103,6 +111,7 @@ clean_service ...@@ -103,6 +111,7 @@ clean_service
# Remove all links # Remove all links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/set_core || : ${csudo} rm -f ${bin_link_dir}/set_core || :
...@@ -116,6 +125,7 @@ ${csudo} rm -f ${log_link_dir} || : ...@@ -116,6 +125,7 @@ ${csudo} rm -f ${log_link_dir} || :
${csudo} rm -f ${data_link_dir} || : ${csudo} rm -f ${data_link_dir} || :
if ((${service_mod}==2)); then if ((${service_mod}==2)); then
kill_blm3
kill_taosd kill_taosd
fi fi
......
...@@ -38,11 +38,11 @@ initd_mod=0 ...@@ -38,11 +38,11 @@ initd_mod=0
service_mod=2 service_mod=2
if pidof systemd &> /dev/null; then if pidof systemd &> /dev/null; then
service_mod=0 service_mod=0
elif $(which service &> /dev/null); then elif $(which service &> /dev/null); then
service_mod=1 service_mod=1
service_config_dir="/etc/init.d" service_config_dir="/etc/init.d"
if $(which chkconfig &> /dev/null); then if $(which chkconfig &> /dev/null); then
initd_mod=1 initd_mod=1
elif $(which insserv &> /dev/null); then elif $(which insserv &> /dev/null); then
initd_mod=2 initd_mod=2
elif $(which update-rc.d &> /dev/null); then elif $(which update-rc.d &> /dev/null); then
...@@ -50,10 +50,17 @@ elif $(which service &> /dev/null); then ...@@ -50,10 +50,17 @@ elif $(which service &> /dev/null); then
else else
service_mod=2 service_mod=2
fi fi
else else
service_mod=2 service_mod=2
fi fi
function kill_blm3() {
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo} kill -9 $pid || :
fi
}
function kill_taosd() { function kill_taosd() {
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
...@@ -71,6 +78,7 @@ function clean_bin() { ...@@ -71,6 +78,7 @@ function clean_bin() {
# Remove link # Remove link
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
...@@ -93,7 +101,7 @@ function clean_header() { ...@@ -93,7 +101,7 @@ function clean_header() {
function clean_config() { function clean_config() {
# Remove link # Remove link
${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${cfg_link_dir}/* || :
} }
function clean_log() { function clean_log() {
...@@ -109,7 +117,7 @@ function clean_service_on_systemd() { ...@@ -109,7 +117,7 @@ function clean_service_on_systemd() {
fi fi
${csudo} systemctl disable ${taos_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl disable ${taos_service_name} &> /dev/null || echo &> /dev/null
${csudo} rm -f ${taosd_service_config} ${csudo} rm -f ${taosd_service_config}
tarbitratord_service_config="${service_config_dir}/${tarbitrator_service_name}.service" tarbitratord_service_config="${service_config_dir}/${tarbitrator_service_name}.service"
if systemctl is-active --quiet ${tarbitrator_service_name}; then if systemctl is-active --quiet ${tarbitrator_service_name}; then
echo "TDengine tarbitrator is running, stopping it..." echo "TDengine tarbitrator is running, stopping it..."
...@@ -117,60 +125,60 @@ function clean_service_on_systemd() { ...@@ -117,60 +125,60 @@ function clean_service_on_systemd() {
fi fi
${csudo} systemctl disable ${tarbitrator_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl disable ${tarbitrator_service_name} &> /dev/null || echo &> /dev/null
${csudo} rm -f ${tarbitratord_service_config} ${csudo} rm -f ${tarbitratord_service_config}
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
nginx_service_config="${service_config_dir}/${nginx_service_name}.service" nginx_service_config="${service_config_dir}/${nginx_service_name}.service"
if [ -d ${install_nginxd_dir} ]; then if [ -d ${install_nginxd_dir} ]; then
if systemctl is-active --quiet ${nginx_service_name}; then if systemctl is-active --quiet ${nginx_service_name}; then
echo "Nginx for TDengine is running, stopping it..." echo "Nginx for TDengine is running, stopping it..."
${csudo} systemctl stop ${nginx_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl stop ${nginx_service_name} &> /dev/null || echo &> /dev/null
fi fi
${csudo} systemctl disable ${nginx_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl disable ${nginx_service_name} &> /dev/null || echo &> /dev/null
${csudo} rm -f ${nginx_service_config} ${csudo} rm -f ${nginx_service_config}
fi fi
fi fi
} }
function clean_service_on_sysvinit() { function clean_service_on_sysvinit() {
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start" #restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
#${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || : #${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || :
if pidof taosd &> /dev/null; then if pidof taosd &> /dev/null; then
echo "TDengine taosd is running, stopping it..." echo "TDengine taosd is running, stopping it..."
${csudo} service taosd stop || : ${csudo} service taosd stop || :
fi fi
if pidof tarbitrator &> /dev/null; then if pidof tarbitrator &> /dev/null; then
echo "TDengine tarbitrator is running, stopping it..." echo "TDengine tarbitrator is running, stopping it..."
${csudo} service tarbitratord stop || : ${csudo} service tarbitratord stop || :
fi fi
if ((${initd_mod}==1)); then if ((${initd_mod}==1)); then
if [ -e ${service_config_dir}/taosd ]; then if [ -e ${service_config_dir}/taosd ]; then
${csudo} chkconfig --del taosd || : ${csudo} chkconfig --del taosd || :
fi fi
if [ -e ${service_config_dir}/tarbitratord ]; then if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo} chkconfig --del tarbitratord || : ${csudo} chkconfig --del tarbitratord || :
fi fi
elif ((${initd_mod}==2)); then elif ((${initd_mod}==2)); then
if [ -e ${service_config_dir}/taosd ]; then if [ -e ${service_config_dir}/taosd ]; then
${csudo} insserv -r taosd || : ${csudo} insserv -r taosd || :
fi fi
if [ -e ${service_config_dir}/tarbitratord ]; then if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo} insserv -r tarbitratord || : ${csudo} insserv -r tarbitratord || :
fi fi
elif ((${initd_mod}==3)); then elif ((${initd_mod}==3)); then
if [ -e ${service_config_dir}/taosd ]; then if [ -e ${service_config_dir}/taosd ]; then
${csudo} update-rc.d -f taosd remove || : ${csudo} update-rc.d -f taosd remove || :
fi fi
if [ -e ${service_config_dir}/tarbitratord ]; then if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo} update-rc.d -f tarbitratord remove || : ${csudo} update-rc.d -f tarbitratord remove || :
fi fi
fi fi
${csudo} rm -f ${service_config_dir}/taosd || : ${csudo} rm -f ${service_config_dir}/taosd || :
${csudo} rm -f ${service_config_dir}/tarbitratord || : ${csudo} rm -f ${service_config_dir}/tarbitratord || :
if $(which init &> /dev/null); then if $(which init &> /dev/null); then
${csudo} init q || : ${csudo} init q || :
fi fi
...@@ -183,6 +191,7 @@ function clean_service() { ...@@ -183,6 +191,7 @@ function clean_service() {
clean_service_on_sysvinit clean_service_on_sysvinit
else else
# must manual stop taosd # must manual stop taosd
kill_blm3
kill_taosd kill_taosd
kill_tarbitrator kill_tarbitrator
fi fi
...@@ -201,7 +210,7 @@ clean_log ...@@ -201,7 +210,7 @@ clean_log
# Remove link configuration file # Remove link configuration file
clean_config clean_config
# Remove data link directory # Remove data link directory
${csudo} rm -rf ${data_link_dir} || : ${csudo} rm -rf ${data_link_dir} || :
${csudo} rm -rf ${install_main_dir} ${csudo} rm -rf ${install_main_dir}
${csudo} rm -rf ${install_nginxd_dir} ${csudo} rm -rf ${install_nginxd_dir}
...@@ -213,14 +222,14 @@ fi ...@@ -213,14 +222,14 @@ fi
if echo $osinfo | grep -qwi "ubuntu" ; then if echo $osinfo | grep -qwi "ubuntu" ; then
# echo "this is ubuntu system" # echo "this is ubuntu system"
${csudo} dpkg --force-all -P tdengine || : ${csudo} dpkg --force-all -P tdengine > /dev/null 2>&1 || :
elif echo $osinfo | grep -qwi "debian" ; then elif echo $osinfo | grep -qwi "debian" ; then
# echo "this is debian system" # echo "this is debian system"
${csudo} dpkg --force-all -P tdengine || : ${csudo} dpkg --force-all -P tdengine > /dev/null 2>&1 || :
elif echo $osinfo | grep -qwi "centos" ; then elif echo $osinfo | grep -qwi "centos" ; then
# echo "this is centos system" # echo "this is centos system"
${csudo} rpm -e --noscripts tdengine || : ${csudo} rpm -e --noscripts tdengine > /dev/null 2>&1 || :
fi fi
echo -e "${GREEN}TDengine is removed successfully!${NC}" echo -e "${GREEN}TDengine is removed successfully!${NC}"
echo echo
...@@ -19,7 +19,7 @@ if [[ ! -e ${startSeqFile} ]]; then ...@@ -19,7 +19,7 @@ if [[ ! -e ${startSeqFile} ]]; then
else else
startSeq=$(cat ${startSeqFile}) startSeq=$(cat ${startSeqFile})
fi fi
nextSeq=`expr $startSeq + 1` nextSeq=`expr $startSeq + 1`
echo "${nextSeq}" > ${startSeqFile} echo "${nextSeq}" > ${startSeqFile}
...@@ -48,3 +48,4 @@ if [ ${coreFlag} = "unlimited" ];then ...@@ -48,3 +48,4 @@ if [ ${coreFlag} = "unlimited" ];then
fi fi
fi fi
/usr/bin/blm3 &
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "tsclient.h" #include "tsclient.h"
#include "ttimer.h" #include "ttimer.h"
#include "ttokendef.h" #include "ttokendef.h"
#include "httpInt.h"
#ifdef HTTP_EMBEDDED #ifdef HTTP_EMBEDDED
#include "httpInt.h" #include "httpInt.h"
...@@ -125,11 +124,11 @@ SCond* tsGetSTableQueryCond(STagCond* pTagCond, uint64_t uid) { ...@@ -125,11 +124,11 @@ SCond* tsGetSTableQueryCond(STagCond* pTagCond, uint64_t uid) {
if (pTagCond->pCond == NULL) { if (pTagCond->pCond == NULL) {
return NULL; return NULL;
} }
size_t size = taosArrayGetSize(pTagCond->pCond); size_t size = taosArrayGetSize(pTagCond->pCond);
for (int32_t i = 0; i < size; ++i) { for (int32_t i = 0; i < size; ++i) {
SCond* pCond = taosArrayGet(pTagCond->pCond, i); SCond* pCond = taosArrayGet(pTagCond->pCond, i);
if (uid == pCond->uid) { if (uid == pCond->uid) {
return pCond; return pCond;
} }
...@@ -142,11 +141,11 @@ STblCond* tsGetTableFilter(SArray* filters, uint64_t uid, int16_t idx) { ...@@ -142,11 +141,11 @@ STblCond* tsGetTableFilter(SArray* filters, uint64_t uid, int16_t idx) {
if (filters == NULL) { if (filters == NULL) {
return NULL; return NULL;
} }
size_t size = taosArrayGetSize(filters); size_t size = taosArrayGetSize(filters);
for (int32_t i = 0; i < size; ++i) { for (int32_t i = 0; i < size; ++i) {
STblCond* cond = taosArrayGet(filters, i); STblCond* cond = taosArrayGet(filters, i);
if (uid == cond->uid && (idx >= 0 && cond->idx == idx)) { if (uid == cond->uid && (idx >= 0 && cond->idx == idx)) {
return cond; return cond;
} }
...@@ -160,19 +159,19 @@ void tsSetSTableQueryCond(STagCond* pTagCond, uint64_t uid, SBufferWriter* bw) { ...@@ -160,19 +159,19 @@ void tsSetSTableQueryCond(STagCond* pTagCond, uint64_t uid, SBufferWriter* bw) {
if (tbufTell(bw) == 0) { if (tbufTell(bw) == 0) {
return; return;
} }
SCond cond = { SCond cond = {
.uid = uid, .uid = uid,
.len = (int32_t)(tbufTell(bw)), .len = (int32_t)(tbufTell(bw)),
.cond = NULL, .cond = NULL,
}; };
cond.cond = tbufGetData(bw, true); cond.cond = tbufGetData(bw, true);
if (pTagCond->pCond == NULL) { if (pTagCond->pCond == NULL) {
pTagCond->pCond = taosArrayInit(3, sizeof(SCond)); pTagCond->pCond = taosArrayInit(3, sizeof(SCond));
} }
taosArrayPush(pTagCond->pCond, &cond); taosArrayPush(pTagCond->pCond, &cond);
} }
...@@ -220,7 +219,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) { ...@@ -220,7 +219,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
if (pTableMetaInfo == NULL) { if (pTableMetaInfo == NULL) {
return false; return false;
} }
if ((pQueryInfo->type & TSDB_QUERY_TYPE_FREE_RESOURCE) == TSDB_QUERY_TYPE_FREE_RESOURCE) { if ((pQueryInfo->type & TSDB_QUERY_TYPE_FREE_RESOURCE) == TSDB_QUERY_TYPE_FREE_RESOURCE) {
return false; return false;
} }
...@@ -239,7 +238,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) { ...@@ -239,7 +238,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) { bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, tableIndex); STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, tableIndex);
/* /*
* In following cases, return false for non ordered project query on super table * In following cases, return false for non ordered project query on super table
* 1. failed to get tableMeta from server; 2. not a super table; 3. limitation is 0; * 1. failed to get tableMeta from server; 2. not a super table; 3. limitation is 0;
...@@ -250,7 +249,7 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) { ...@@ -250,7 +249,7 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
pQueryInfo->command == TSDB_SQL_RETRIEVE_EMPTY_RESULT || numOfExprs == 0) { pQueryInfo->command == TSDB_SQL_RETRIEVE_EMPTY_RESULT || numOfExprs == 0) {
return false; return false;
} }
for (int32_t i = 0; i < numOfExprs; ++i) { for (int32_t i = 0; i < numOfExprs; ++i) {
int32_t functionId = tscExprGet(pQueryInfo, i)->base.functionId; int32_t functionId = tscExprGet(pQueryInfo, i)->base.functionId;
...@@ -281,7 +280,7 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) { ...@@ -281,7 +280,7 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
return false; return false;
} }
} }
return true; return true;
} }
...@@ -290,7 +289,7 @@ bool tscNonOrderedProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableI ...@@ -290,7 +289,7 @@ bool tscNonOrderedProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableI
if (!tscIsProjectionQueryOnSTable(pQueryInfo, tableIndex)) { if (!tscIsProjectionQueryOnSTable(pQueryInfo, tableIndex)) {
return false; return false;
} }
// order by columnIndex exists, not a non-ordered projection query // order by columnIndex exists, not a non-ordered projection query
return pQueryInfo->order.orderColId < 0; return pQueryInfo->order.orderColId < 0;
} }
...@@ -299,7 +298,7 @@ bool tscOrderedProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableInde ...@@ -299,7 +298,7 @@ bool tscOrderedProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableInde
if (!tscIsProjectionQueryOnSTable(pQueryInfo, tableIndex)) { if (!tscIsProjectionQueryOnSTable(pQueryInfo, tableIndex)) {
return false; return false;
} }
// order by columnIndex exists, a non-ordered projection query // order by columnIndex exists, a non-ordered projection query
return pQueryInfo->order.orderColId >= 0; return pQueryInfo->order.orderColId >= 0;
} }
...@@ -879,7 +878,7 @@ static void doSetupSDataBlock(SSqlRes* pRes, SSDataBlock* pBlock, void* pFilterI ...@@ -879,7 +878,7 @@ static void doSetupSDataBlock(SSqlRes* pRes, SSDataBlock* pBlock, void* pFilterI
if (pFilterInfo) { if (pFilterInfo) {
SColumnDataParam param = {.numOfCols = pBlock->info.numOfCols, .pDataBlock = pBlock->pDataBlock}; SColumnDataParam param = {.numOfCols = pBlock->info.numOfCols, .pDataBlock = pBlock->pDataBlock};
filterSetColFieldData(pFilterInfo, &param, getColumnDataFromId); filterSetColFieldData(pFilterInfo, &param, getColumnDataFromId);
bool gotNchar = false; bool gotNchar = false;
filterConverNcharColumns(pFilterInfo, pBlock->info.rows, &gotNchar); filterConverNcharColumns(pFilterInfo, pBlock->info.rows, &gotNchar);
int8_t* p = NULL; int8_t* p = NULL;
...@@ -987,7 +986,7 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) { ...@@ -987,7 +986,7 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
if (pOperator->status == OP_EXEC_DONE) { if (pOperator->status == OP_EXEC_DONE) {
return pJoinInfo->pRes; return pJoinInfo->pRes;
} }
SJoinStatus* st0 = &pJoinInfo->status[0]; SJoinStatus* st0 = &pJoinInfo->status[0];
SColumnInfoData* p0 = taosArrayGet(st0->pBlock->pDataBlock, 0); SColumnInfoData* p0 = taosArrayGet(st0->pBlock->pDataBlock, 0);
int64_t* ts0 = (int64_t*) p0->pData; int64_t* ts0 = (int64_t*) p0->pData;
...@@ -1020,7 +1019,7 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) { ...@@ -1020,7 +1019,7 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
if (ts[st->index] < ts0[st0->index]) { // less than the first if (ts[st->index] < ts0[st0->index]) { // less than the first
prefixEqual = false; prefixEqual = false;
if ((++(st->index)) >= st->pBlock->info.rows) { if ((++(st->index)) >= st->pBlock->info.rows) {
fetchNextBlockIfCompleted(pOperator, newgroup); fetchNextBlockIfCompleted(pOperator, newgroup);
if (pOperator->status == OP_EXEC_DONE) { if (pOperator->status == OP_EXEC_DONE) {
return pJoinInfo->pRes; return pJoinInfo->pRes;
...@@ -1464,7 +1463,7 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool clearCachedMeta, uint64_t id) { ...@@ -1464,7 +1463,7 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool clearCachedMeta, uint64_t id) {
tscFreeQueryInfo(pCmd, clearCachedMeta, id); tscFreeQueryInfo(pCmd, clearCachedMeta, id);
pCmd->pTableMetaMap = tscCleanupTableMetaMap(pCmd->pTableMetaMap); pCmd->pTableMetaMap = tscCleanupTableMetaMap(pCmd->pTableMetaMap);
taosReleaseRef(tscObjRef, id); taosReleaseRef(tscObjRef, id);
} }
void* tscCleanupTableMetaMap(SHashObj* pTableMetaMap) { void* tscCleanupTableMetaMap(SHashObj* pTableMetaMap) {
...@@ -2289,7 +2288,7 @@ static void destroyFilterInfo(SColumnFilterList* pFilterList) { ...@@ -2289,7 +2288,7 @@ static void destroyFilterInfo(SColumnFilterList* pFilterList) {
pFilterList->numOfFilters = 0; pFilterList->numOfFilters = 0;
return; return;
} }
for(int32_t i = 0; i < pFilterList->numOfFilters; ++i) { for(int32_t i = 0; i < pFilterList->numOfFilters; ++i) {
if (pFilterList->filterInfo[i].filterstr) { if (pFilterList->filterInfo[i].filterstr) {
tfree(pFilterList->filterInfo[i].pz); tfree(pFilterList->filterInfo[i].pz);
...@@ -2871,7 +2870,7 @@ void tscRmEscapeAndTrimToken(SStrToken* pToken) { ...@@ -2871,7 +2870,7 @@ void tscRmEscapeAndTrimToken(SStrToken* pToken) {
int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded) { int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded) {
if (pToken == NULL || pToken->z == NULL if (pToken == NULL || pToken->z == NULL
|| (pToken->type != TK_STRING && pToken->type != TK_ID)) { || (pToken->type != TK_STRING && pToken->type != TK_ID)) {
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
} }
...@@ -2883,16 +2882,16 @@ int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded) ...@@ -2883,16 +2882,16 @@ int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded)
} }
char* sep = NULL; char* sep = NULL;
if (escapeEnabled) { if (escapeEnabled) {
sep = tableNameGetPosition(pToken, TS_PATH_DELIMITER[0]); sep = tableNameGetPosition(pToken, TS_PATH_DELIMITER[0]);
} else { } else {
sep = strnchr(pToken->z, TS_PATH_DELIMITER[0], pToken->n, true); sep = strnchr(pToken->z, TS_PATH_DELIMITER[0], pToken->n, true);
} }
if (sep == NULL) { // single part if (sep == NULL) { // single part
if (dbIncluded) *dbIncluded = false; if (dbIncluded) *dbIncluded = false;
if (pToken->type == TK_STRING) { if (pToken->type == TK_STRING) {
tscDequoteAndTrimToken(pToken); tscDequoteAndTrimToken(pToken);
...@@ -2915,11 +2914,11 @@ int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded) ...@@ -2915,11 +2914,11 @@ int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded)
} }
} else if (pToken->type == TK_ID) { } else if (pToken->type == TK_ID) {
tscRmEscapeAndTrimToken(pToken); tscRmEscapeAndTrimToken(pToken);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} else { } else {
if (isNumber(pToken)) { if (isNumber(pToken)) {
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
} }
} }
} else { // two part } else { // two part
int32_t oldLen = pToken->n; int32_t oldLen = pToken->n;
...@@ -3074,10 +3073,10 @@ int32_t tscColCondCopy(SArray** dest, const SArray* src, uint64_t uid, int16_t t ...@@ -3074,10 +3073,10 @@ int32_t tscColCondCopy(SArray** dest, const SArray* src, uint64_t uid, int16_t t
if (src == NULL) { if (src == NULL) {
return 0; return 0;
} }
size_t s = taosArrayGetSize(src); size_t s = taosArrayGetSize(src);
*dest = taosArrayInit(s, sizeof(SCond)); *dest = taosArrayInit(s, sizeof(SCond));
for (int32_t i = 0; i < s; ++i) { for (int32_t i = 0; i < s; ++i) {
STblCond* pCond = taosArrayGet(src, i); STblCond* pCond = taosArrayGet(src, i);
STblCond c = {0}; STblCond c = {0};
...@@ -3091,10 +3090,10 @@ int32_t tscColCondCopy(SArray** dest, const SArray* src, uint64_t uid, int16_t t ...@@ -3091,10 +3090,10 @@ int32_t tscColCondCopy(SArray** dest, const SArray* src, uint64_t uid, int16_t t
} else { } else {
c.idx = pCond->idx; c.idx = pCond->idx;
} }
c.len = pCond->len; c.len = pCond->len;
c.uid = pCond->uid; c.uid = pCond->uid;
if (pCond->len > 0) { if (pCond->len > 0) {
assert(pCond->cond != NULL); assert(pCond->cond != NULL);
c.cond = malloc(c.len); c.cond = malloc(c.len);
...@@ -3104,7 +3103,7 @@ int32_t tscColCondCopy(SArray** dest, const SArray* src, uint64_t uid, int16_t t ...@@ -3104,7 +3103,7 @@ int32_t tscColCondCopy(SArray** dest, const SArray* src, uint64_t uid, int16_t t
memcpy(c.cond, pCond->cond, c.len); memcpy(c.cond, pCond->cond, c.len);
} }
taosArrayPush(*dest, &c); taosArrayPush(*dest, &c);
} }
...@@ -3115,7 +3114,7 @@ void tscColCondRelease(SArray** pCond) { ...@@ -3115,7 +3114,7 @@ void tscColCondRelease(SArray** pCond) {
if (*pCond == NULL) { if (*pCond == NULL) {
return; return;
} }
size_t s = taosArrayGetSize(*pCond); size_t s = taosArrayGetSize(*pCond);
for (int32_t i = 0; i < s; ++i) { for (int32_t i = 0; i < s; ++i) {
STblCond* p = taosArrayGet(*pCond, i); STblCond* p = taosArrayGet(*pCond, i);
...@@ -3732,7 +3731,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t ...@@ -3732,7 +3731,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t
pNew->pTscObj = pSql->pTscObj; pNew->pTscObj = pSql->pTscObj;
pNew->signature = pNew; pNew->signature = pNew;
pNew->sqlstr = strdup(pSql->sqlstr); pNew->sqlstr = strdup(pSql->sqlstr);
pNew->rootObj = pSql->rootObj; pNew->rootObj = pSql->rootObj;
tsem_init(&pNew->rspSem, 0, 0); tsem_init(&pNew->rspSem, 0, 0);
...@@ -3818,7 +3817,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t ...@@ -3818,7 +3817,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t
} }
if (pQueryInfo->fillType != TSDB_FILL_NONE) { if (pQueryInfo->fillType != TSDB_FILL_NONE) {
//just make memory memory sanitizer happy //just make memory memory sanitizer happy
//refactor later //refactor later
pNewQueryInfo->fillVal = calloc(1, pQueryInfo->fieldsInfo.numOfOutput * sizeof(int64_t)); pNewQueryInfo->fillVal = calloc(1, pQueryInfo->fieldsInfo.numOfOutput * sizeof(int64_t));
if (pNewQueryInfo->fillVal == NULL) { if (pNewQueryInfo->fillVal == NULL) {
...@@ -4054,9 +4053,9 @@ static void tscSubqueryCompleteCallback(void* param, TAOS_RES* tres, int code) { ...@@ -4054,9 +4053,9 @@ static void tscSubqueryCompleteCallback(void* param, TAOS_RES* tres, int code) {
if (pSql->cmd.command == TSDB_SQL_RETRIEVE_EMPTY_RESULT) { if (pSql->cmd.command == TSDB_SQL_RETRIEVE_EMPTY_RESULT) {
SSqlObj* pParentSql = ps->pParentSql; SSqlObj* pParentSql = ps->pParentSql;
pParentSql->cmd.command = TSDB_SQL_RETRIEVE_EMPTY_RESULT; pParentSql->cmd.command = TSDB_SQL_RETRIEVE_EMPTY_RESULT;
(*pParentSql->fp)(pParentSql->param, pParentSql, 0); (*pParentSql->fp)(pParentSql->param, pParentSql, 0);
return; return;
} }
...@@ -4117,7 +4116,7 @@ void executeQuery(SSqlObj* pSql, SQueryInfo* pQueryInfo) { ...@@ -4117,7 +4116,7 @@ void executeQuery(SSqlObj* pSql, SQueryInfo* pQueryInfo) {
pNew->sqlstr = strdup(pSql->sqlstr); pNew->sqlstr = strdup(pSql->sqlstr);
pNew->fp = tscSubqueryCompleteCallback; pNew->fp = tscSubqueryCompleteCallback;
pNew->fetchFp = tscSubqueryCompleteCallback; pNew->fetchFp = tscSubqueryCompleteCallback;
pNew->maxRetry = pSql->maxRetry; pNew->maxRetry = pSql->maxRetry;
pNew->rootObj = pSql->rootObj; pNew->rootObj = pSql->rootObj;
pNew->cmd.resColumnId = TSDB_RES_COL_ID; pNew->cmd.resColumnId = TSDB_RES_COL_ID;
...@@ -4694,7 +4693,7 @@ int32_t tscCreateTableMetaFromSTableMeta(SSqlObj *pSql, STableMeta** ppChild, co ...@@ -4694,7 +4693,7 @@ int32_t tscCreateTableMetaFromSTableMeta(SSqlObj *pSql, STableMeta** ppChild, co
if (NULL == taosHashGetCloneExt(UTIL_GET_TABLEMETA(pSql), pChild->sTableName, strnlen(pChild->sTableName, TSDB_TABLE_FNAME_LEN), NULL, (void **)&p, &sz)) { if (NULL == taosHashGetCloneExt(UTIL_GET_TABLEMETA(pSql), pChild->sTableName, strnlen(pChild->sTableName, TSDB_TABLE_FNAME_LEN), NULL, (void **)&p, &sz)) {
tfree(p); tfree(p);
} }
*ppSTable = p; *ppSTable = p;
// tableMeta exists, build child table meta according to the super table meta // tableMeta exists, build child table meta according to the super table meta
...@@ -4705,7 +4704,7 @@ int32_t tscCreateTableMetaFromSTableMeta(SSqlObj *pSql, STableMeta** ppChild, co ...@@ -4705,7 +4704,7 @@ int32_t tscCreateTableMetaFromSTableMeta(SSqlObj *pSql, STableMeta** ppChild, co
if (*tableMetaCapacity < tableMetaSize) { if (*tableMetaCapacity < tableMetaSize) {
STableMeta* pChild1 = realloc(pChild, tableMetaSize); STableMeta* pChild1 = realloc(pChild, tableMetaSize);
if(pChild1 == NULL) return -1; if(pChild1 == NULL) return -1;
pChild = pChild1; pChild = pChild1;
*tableMetaCapacity = (size_t)tableMetaSize; *tableMetaCapacity = (size_t)tableMetaSize;
} }
...@@ -5115,7 +5114,7 @@ static int32_t doAddTableName(char* nextStr, char** str, SArray* pNameArray, SSq ...@@ -5115,7 +5114,7 @@ static int32_t doAddTableName(char* nextStr, char** str, SArray* pNameArray, SSq
tGetToken(tablename, &sToken.type); tGetToken(tablename, &sToken.type);
bool dbIncluded = false; bool dbIncluded = false;
// Check if the table name available or not // Check if the table name available or not
if (tscValidateName(&sToken, true, &dbIncluded) != TSDB_CODE_SUCCESS) { if (tscValidateName(&sToken, true, &dbIncluded) != TSDB_CODE_SUCCESS) {
sprintf(pCmd->payload, "table name is invalid"); sprintf(pCmd->payload, "table name is invalid");
...@@ -5238,7 +5237,7 @@ SNewVgroupInfo createNewVgroupInfo(SVgroupMsg *pVgroupMsg) { ...@@ -5238,7 +5237,7 @@ SNewVgroupInfo createNewVgroupInfo(SVgroupMsg *pVgroupMsg) {
void tscRemoveCachedTableMeta(STableMetaInfo* pTableMetaInfo, uint64_t id) { void tscRemoveCachedTableMeta(STableMetaInfo* pTableMetaInfo, uint64_t id) {
char fname[TSDB_TABLE_FNAME_LEN] = {0}; char fname[TSDB_TABLE_FNAME_LEN] = {0};
SSqlObj *p = (SSqlObj *)taosAcquireRef(tscObjRef, id); SSqlObj *p = (SSqlObj *)taosAcquireRef(tscObjRef, id);
tNameExtractFullName(&pTableMetaInfo->name, fname); tNameExtractFullName(&pTableMetaInfo->name, fname);
int32_t len = (int32_t) strnlen(fname, TSDB_TABLE_FNAME_LEN); int32_t len = (int32_t) strnlen(fname, TSDB_TABLE_FNAME_LEN);
...@@ -5251,7 +5250,7 @@ void tscRemoveCachedTableMeta(STableMetaInfo* pTableMetaInfo, uint64_t id) { ...@@ -5251,7 +5250,7 @@ void tscRemoveCachedTableMeta(STableMetaInfo* pTableMetaInfo, uint64_t id) {
taosHashRemove(UTIL_GET_TABLEMETA(p), fname, len); taosHashRemove(UTIL_GET_TABLEMETA(p), fname, len);
tscDebug("0x%"PRIx64" remove table meta %s, numOfRemain:%d", id, fname, (int32_t) taosHashGetSize(UTIL_GET_TABLEMETA(p))); tscDebug("0x%"PRIx64" remove table meta %s, numOfRemain:%d", id, fname, (int32_t) taosHashGetSize(UTIL_GET_TABLEMETA(p)));
taosReleaseRef(tscObjRef, id); taosReleaseRef(tscObjRef, id);
} }
char* cloneCurrentDBName(SSqlObj* pSql) { char* cloneCurrentDBName(SSqlObj* pSql) {
......
Subproject commit 72ecc6d636453c6a9b71d78d3edce385165cc35f Subproject commit 9a99388c7fc4e54a14aa4d63981e28e00ef1b83c
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20)
PROJECT(TDengine) PROJECT(TDengine)
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()
ADD_SUBDIRECTORY(monitor) ADD_SUBDIRECTORY(monitor)
IF (TD_BUILD_HTTP) IF (TD_BUILD_HTTP)
MESSAGE("")
MESSAGE("${Yellow} use original embedded httpd ${ColourReset}")
MESSAGE("")
ADD_SUBDIRECTORY(http) ADD_SUBDIRECTORY(http)
ELSE ()
MESSAGE("")
MESSAGE("${Green} use blm3 as httpd ${ColourReset}")
MESSAGE("")
include(ExternalProject)
ExternalProject_Add(blm3
PREFIX "blm3"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/blm3
BUILD_ALWAYS off
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "blm3 no need cmake to config"
BUILD_COMMAND CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../inc CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib go build
INSTALL_COMMAND cmake -E copy blm3 ${CMAKE_BINARY_DIR}/build/bin COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test/cfg/ COMMAND cmake -E copy ./example/config/blm.toml ${CMAKE_BINARY_DIR}/test/cfg/
)
ENDIF () ENDIF ()
IF (TD_LINUX AND TD_MQTT) IF (TD_LINUX AND TD_MQTT)
......
Subproject commit 38372fa8f5a6c58eb9158f128bd4da145b18ec2b
...@@ -30,7 +30,7 @@ python3 ./test.py -f insert/modify_column.py ...@@ -30,7 +30,7 @@ python3 ./test.py -f insert/modify_column.py
python3 ./test.py -f insert/line_insert.py python3 ./test.py -f insert/line_insert.py
python3 ./test.py -f insert/specialSql.py python3 ./test.py -f insert/specialSql.py
# timezone # timezone
python3 ./test.py -f TimeZone/TestCaseTimeZone.py python3 ./test.py -f TimeZone/TestCaseTimeZone.py
...@@ -49,7 +49,7 @@ python3 ./test.py -f table/del_stable.py ...@@ -49,7 +49,7 @@ python3 ./test.py -f table/del_stable.py
#stable #stable
python3 ./test.py -f stable/insert.py python3 ./test.py -f stable/insert.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
# tag # tag
python3 ./test.py -f tag_lite/filter.py python3 ./test.py -f tag_lite/filter.py
...@@ -174,8 +174,8 @@ python3 test.py -f tools/taosdemoTestInterlace.py ...@@ -174,8 +174,8 @@ python3 test.py -f tools/taosdemoTestInterlace.py
python3 test.py -f tools/taosdemoTestQuery.py python3 test.py -f tools/taosdemoTestQuery.py
# restful test for python # restful test for python
python3 test.py -f restful/restful_bind_db1.py # python3 test.py -f restful/restful_bind_db1.py
python3 test.py -f restful/restful_bind_db2.py # python3 test.py -f restful/restful_bind_db2.py
# nano support # nano support
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
...@@ -185,7 +185,7 @@ python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_ste ...@@ -185,7 +185,7 @@ python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_ste
python3 test.py -f tools/taosdumpTestNanoSupport.py python3 test.py -f tools/taosdumpTestNanoSupport.py
# #
python3 ./test.py -f tsdb/tsdbComp.py python3 ./test.py -f tsdb/tsdbComp.py
# update # update
python3 ./test.py -f update/allow_update.py python3 ./test.py -f update/allow_update.py
...@@ -218,12 +218,12 @@ python3 ./test.py -f perfbenchmark/bug3433.py ...@@ -218,12 +218,12 @@ python3 ./test.py -f perfbenchmark/bug3433.py
python3 ./test.py -f perfbenchmark/taosdemoInsert.py python3 ./test.py -f perfbenchmark/taosdemoInsert.py
#taosdemo #taosdemo
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py
#query #query
python3 test.py -f query/distinctOneColTb.py python3 test.py -f query/distinctOneColTb.py
python3 ./test.py -f query/filter.py python3 ./test.py -f query/filter.py
python3 ./test.py -f query/filterCombo.py python3 ./test.py -f query/filterCombo.py
python3 ./test.py -f query/queryNormal.py python3 ./test.py -f query/queryNormal.py
...@@ -318,7 +318,7 @@ python3 test.py -f query/queryInterval.py ...@@ -318,7 +318,7 @@ python3 test.py -f query/queryInterval.py
python3 test.py -f query/queryFillTest.py python3 test.py -f query/queryFillTest.py
# subscribe # subscribe
python3 test.py -f subscribe/singlemeter.py python3 test.py -f subscribe/singlemeter.py
#python3 test.py -f subscribe/stability.py #python3 test.py -f subscribe/stability.py
python3 test.py -f subscribe/supertable.py python3 test.py -f subscribe/supertable.py
# topic # topic
python3 ./test.py -f topic/topicQuery.py python3 ./test.py -f topic/topicQuery.py
...@@ -328,7 +328,7 @@ python3 ./test.py -f topic/topicQuery.py ...@@ -328,7 +328,7 @@ python3 ./test.py -f topic/topicQuery.py
python3 ./test.py -f update/merge_commit_data-0.py python3 ./test.py -f update/merge_commit_data-0.py
# wal # wal
python3 ./test.py -f wal/addOldWalTest.py python3 ./test.py -f wal/addOldWalTest.py
python3 ./test.py -f wal/sdbComp.py python3 ./test.py -f wal/sdbComp.py
# function # function
python3 ./test.py -f functions/all_null_value.py python3 ./test.py -f functions/all_null_value.py
...@@ -344,7 +344,7 @@ python3 ./test.py -f functions/function_last_row.py -r 1 ...@@ -344,7 +344,7 @@ python3 ./test.py -f functions/function_last_row.py -r 1
python3 ./test.py -f functions/function_leastsquares.py -r 1 python3 ./test.py -f functions/function_leastsquares.py -r 1
python3 ./test.py -f functions/function_max.py -r 1 python3 ./test.py -f functions/function_max.py -r 1
python3 ./test.py -f functions/function_min.py -r 1 python3 ./test.py -f functions/function_min.py -r 1
python3 ./test.py -f functions/function_operations.py -r 1 python3 ./test.py -f functions/function_operations.py -r 1
python3 ./test.py -f functions/function_percentile.py -r 1 python3 ./test.py -f functions/function_percentile.py -r 1
python3 ./test.py -f functions/function_spread.py -r 1 python3 ./test.py -f functions/function_spread.py -r 1
python3 ./test.py -f functions/function_stddev.py -r 1 python3 ./test.py -f functions/function_stddev.py -r 1
...@@ -395,7 +395,7 @@ python3 ./test.py -f tag_lite/drop_auto_create.py ...@@ -395,7 +395,7 @@ python3 ./test.py -f tag_lite/drop_auto_create.py
python3 test.py -f insert/insert_before_use_db.py python3 test.py -f insert/insert_before_use_db.py
python3 test.py -f alter/alter_keep.py python3 test.py -f alter/alter_keep.py
python3 test.py -f alter/alter_cacheLastRow.py python3 test.py -f alter/alter_cacheLastRow.py
python3 ./test.py -f query/querySession.py python3 ./test.py -f query/querySession.py
python3 test.py -f alter/alter_create_exception.py python3 test.py -f alter/alter_create_exception.py
python3 ./test.py -f insert/flushwhiledrop.py python3 ./test.py -f insert/flushwhiledrop.py
#python3 ./test.py -f insert/schemalessInsert.py #python3 ./test.py -f insert/schemalessInsert.py
......
...@@ -275,6 +275,7 @@ class TDDnode: ...@@ -275,6 +275,7 @@ class TDDnode:
tdLog.info("taosd found in %s" % buildPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/taosd" binPath = buildPath + "/build/bin/taosd"
blm3BinPath = buildPath + "/build/bin/blm3"
if self.deployed == 0: if self.deployed == 0:
tdLog.exit("dnode:%d is not deployed" % (self.index)) tdLog.exit("dnode:%d is not deployed" % (self.index))
...@@ -290,8 +291,14 @@ class TDDnode: ...@@ -290,8 +291,14 @@ class TDDnode:
print(cmd) print(cmd)
blm3Cmd = "nohup %s > /dev/null 2>&1 & " % (
blm3BinPath)
if os.system(blm3Cmd) != 0:
tdLog.exit(blm3Cmd)
if os.system(cmd) != 0: if os.system(cmd) != 0:
tdLog.exit(cmd) tdLog.exit(cmd)
self.running = 1 self.running = 1
tdLog.debug("dnode:%d is running with %s " % (self.index, cmd)) tdLog.debug("dnode:%d is running with %s " % (self.index, cmd))
if self.valgrind == 0: if self.valgrind == 0:
...@@ -333,6 +340,7 @@ class TDDnode: ...@@ -333,6 +340,7 @@ class TDDnode:
tdLog.info("taosd found in %s" % buildPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/taosd" binPath = buildPath + "/build/bin/taosd"
blm3BinPath = buildPath + "/build/bin/blm3"
if self.deployed == 0: if self.deployed == 0:
tdLog.exit("dnode:%d is not deployed" % (self.index)) tdLog.exit("dnode:%d is not deployed" % (self.index))
...@@ -348,12 +356,29 @@ class TDDnode: ...@@ -348,12 +356,29 @@ class TDDnode:
print(cmd) print(cmd)
blm3Cmd = "%s > /dev/null 2>&1 & " % (blm3BinPath)
if os.system(blm3Cmd) != 0:
tdLog.exit(blm3Cmd)
if os.system(cmd) != 0: if os.system(cmd) != 0:
tdLog.exit(cmd) tdLog.exit(cmd)
self.running = 1 self.running = 1
tdLog.debug("dnode:%d is running with %s " % (self.index, cmd)) tdLog.debug("dnode:%d is running with %s " % (self.index, cmd))
def stop(self): def stop(self):
blm3ToBeKilled = "blm3"
blm3PsCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % blm3ToBeKilled
blm3ProcessID = subprocess.check_output(
blm3PsCmd, shell=True).decode("utf-8")
while(blm3ProcessID):
blm3KillCmd = "kill -INT %s > /dev/null 2>&1" % blm3ProcessID
os.system(blm3KillCmd)
time.sleep(1)
blm3ProcessID = subprocess.check_output(
blm3PsCmd, shell=True).decode("utf-8")
if self.valgrind == 0: if self.valgrind == 0:
toBeKilled = "taosd" toBeKilled = "taosd"
else: else:
......
...@@ -15,17 +15,17 @@ cd ../../../debug; make ...@@ -15,17 +15,17 @@ cd ../../../debug; make
./test.sh -f general/field/smallint.sim ./test.sh -f general/field/smallint.sim
./test.sh -f general/field/tinyint.sim ./test.sh -f general/field/tinyint.sim
./test.sh -f general/http/autocreate.sim # ./test.sh -f general/http/autocreate.sim
./test.sh -f general/http/chunked.sim # ./test.sh -f general/http/chunked.sim
./test.sh -f general/http/gzip.sim # ./test.sh -f general/http/gzip.sim
./test.sh -f general/http/restful.sim # ./test.sh -f general/http/restful.sim
./test.sh -f general/http/restful_insert.sim # ./test.sh -f general/http/restful_insert.sim
./test.sh -f general/http/restful_limit.sim # ./test.sh -f general/http/restful_limit.sim
./test.sh -f general/http/restful_full.sim # ./test.sh -f general/http/restful_full.sim
./test.sh -f general/http/prepare.sim # ./test.sh -f general/http/prepare.sim
./test.sh -f general/http/telegraf.sim # ./test.sh -f general/http/telegraf.sim
./test.sh -f general/http/grafana_bug.sim # ./test.sh -f general/http/grafana_bug.sim
./test.sh -f general/http/grafana.sim # ./test.sh -f general/http/grafana.sim
./test.sh -f general/insert/basic.sim ./test.sh -f general/insert/basic.sim
./test.sh -f general/insert/insert_drop.sim ./test.sh -f general/insert/insert_drop.sim
...@@ -90,8 +90,8 @@ cd ../../../debug; make ...@@ -90,8 +90,8 @@ cd ../../../debug; make
./test.sh -f general/parser/function.sim ./test.sh -f general/parser/function.sim
./test.sh -f unique/cluster/vgroup100.sim ./test.sh -f unique/cluster/vgroup100.sim
./test.sh -f unique/http/admin.sim # ./test.sh -f unique/http/admin.sim
./test.sh -f unique/http/opentsdb.sim # ./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim ./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim ./test.sh -f unique/import/replica3.sim
...@@ -142,8 +142,8 @@ cd ../../../debug; make ...@@ -142,8 +142,8 @@ cd ../../../debug; make
./test.sh -f unique/cluster/alter.sim ./test.sh -f unique/cluster/alter.sim
./test.sh -f unique/cluster/cache.sim ./test.sh -f unique/cluster/cache.sim
./test.sh -f unique/http/admin.sim #./test.sh -f unique/http/admin.sim
./test.sh -f unique/http/opentsdb.sim #./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim ./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim ./test.sh -f unique/import/replica3.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册