提交 57ec3859 编写于 作者: H Hui Li

[TD-1228]

上级 29532fff
...@@ -19,6 +19,7 @@ SET(TD_MEM_CHECK FALSE) ...@@ -19,6 +19,7 @@ SET(TD_MEM_CHECK FALSE)
SET(TD_PAGMODE_LITE FALSE) SET(TD_PAGMODE_LITE FALSE)
SET(TD_SOMODE_STATIC FALSE) SET(TD_SOMODE_STATIC FALSE)
SET(TD_OEM_POWER FALSE)
SET(TD_GODLL FALSE) SET(TD_GODLL FALSE)
SET(TD_COMMUNITY_DIR ${PROJECT_SOURCE_DIR}) SET(TD_COMMUNITY_DIR ${PROJECT_SOURCE_DIR})
......
...@@ -17,6 +17,10 @@ IF (TD_GODLL) ...@@ -17,6 +17,10 @@ IF (TD_GODLL)
ADD_DEFINITIONS(-D_TD_GO_DLL_) ADD_DEFINITIONS(-D_TD_GO_DLL_)
ENDIF () ENDIF ()
IF (TD_OEM_POWER)
ADD_DEFINITIONS(-D_TD_OEM_POWER_)
ENDIF ()
IF (TD_MEM_CHECK) IF (TD_MEM_CHECK)
ADD_DEFINITIONS(-DTAOS_MEM_CHECK) ADD_DEFINITIONS(-DTAOS_MEM_CHECK)
ENDIF () ENDIF ()
......
...@@ -27,6 +27,11 @@ IF (${SOMODE} MATCHES "static") ...@@ -27,6 +27,11 @@ IF (${SOMODE} MATCHES "static")
MESSAGE(STATUS "Link so using static mode") MESSAGE(STATUS "Link so using static mode")
ENDIF () ENDIF ()
IF (${DBNAME} MATCHES "power")
SET(TD_OEM_POWER TRUE)
MESSAGE(STATUS "OEM power is true")
ENDIF ()
IF (${DLLTYPE} MATCHES "go") IF (${DLLTYPE} MATCHES "go")
SET(TD_GODLL TRUE) SET(TD_GODLL TRUE)
MESSAGE(STATUS "input dll type: " ${DLLTYPE}) MESSAGE(STATUS "input dll type: " ${DLLTYPE})
......
...@@ -4,7 +4,12 @@ IF (TD_LINUX) ...@@ -4,7 +4,12 @@ IF (TD_LINUX)
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})") INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})")
ELSEIF (TD_WINDOWS) ELSEIF (TD_WINDOWS)
IF (TD_OEM_POWER)
SET(CMAKE_INSTALL_PREFIX C:/PowerDB)
ELSE ()
SET(CMAKE_INSTALL_PREFIX C:/TDengine) SET(CMAKE_INSTALL_PREFIX C:/TDengine)
ENDIF ()
IF (NOT TD_GODLL) IF (NOT TD_GODLL)
#INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector) #INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector)
#INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/grafana DESTINATION connector) #INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/grafana DESTINATION connector)
......
...@@ -11,6 +11,7 @@ set -e ...@@ -11,6 +11,7 @@ set -e
# -V [stable | beta] # -V [stable | beta]
# -l [full | lite] # -l [full | lite]
# -s [static | dynamic] # -s [static | dynamic]
# -d [taos | power]
# -n [2.0.0.3] # -n [2.0.0.3]
# -m [2.0.0.0] # -m [2.0.0.0]
...@@ -21,10 +22,11 @@ cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...] ...@@ -21,10 +22,11 @@ cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...]
osType=Linux # [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...] osType=Linux # [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...]
pagMode=full # [full | lite] pagMode=full # [full | lite]
soMode=dynamic # [static | dynamic] soMode=dynamic # [static | dynamic]
dbName=taos # [taos | power]
verNumber="" verNumber=""
verNumberComp="2.0.0.0" verNumberComp="2.0.0.0"
while getopts "hv:V:c:o:l:s:n:m:" arg while getopts "hv:V:c:o:l:s:d:n:m:" arg
do do
case $arg in case $arg in
v) v)
...@@ -47,6 +49,10 @@ do ...@@ -47,6 +49,10 @@ do
#echo "soMode=$OPTARG" #echo "soMode=$OPTARG"
soMode=$(echo $OPTARG) soMode=$(echo $OPTARG)
;; ;;
d)
#echo "dbName=$OPTARG"
dbName=$(echo $OPTARG)
;;
n) n)
#echo "verNumber=$OPTARG" #echo "verNumber=$OPTARG"
verNumber=$(echo $OPTARG) verNumber=$(echo $OPTARG)
...@@ -66,6 +72,7 @@ do ...@@ -66,6 +72,7 @@ do
echo " -V [stable | beta] " echo " -V [stable | beta] "
echo " -l [full | lite] " echo " -l [full | lite] "
echo " -s [static | dynamic] " echo " -s [static | dynamic] "
echo " -d [taos | power] "
echo " -n [version number] " echo " -n [version number] "
echo " -m [compatible version number] " echo " -m [compatible version number] "
exit 0 exit 0
...@@ -77,7 +84,7 @@ do ...@@ -77,7 +84,7 @@ do
esac esac
done done
echo "verMode=${verMode} verType=${verType} cpuType=${cpuType} osType=${osType} pagMode=${pagMode} soMode=${soMode} verNumber=${verNumber} verNumberComp=${verNumberComp}" echo "verMode=${verMode} verType=${verType} cpuType=${cpuType} osType=${osType} pagMode=${pagMode} soMode=${soMode} dbName=${dbName} verNumber=${verNumber} verNumberComp=${verNumberComp}"
curr_dir=$(pwd) curr_dir=$(pwd)
...@@ -170,9 +177,9 @@ cd ${compile_dir} ...@@ -170,9 +177,9 @@ cd ${compile_dir}
# 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} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} cmake ../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode}
else else
cmake ../../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} cmake ../../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp}
fi fi
else else
echo "input cpuType=${cpuType} error!!!" echo "input cpuType=${cpuType} error!!!"
...@@ -185,7 +192,7 @@ cd ${curr_dir} ...@@ -185,7 +192,7 @@ cd ${curr_dir}
# 3. Call the corresponding script for packaging # 3. Call the corresponding script for packaging
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
if [[ "$verMode" != "cluster" ]] && [[ "$cpuType" == "x64" ]]; then if [[ "$verMode" != "cluster" ]] && [[ "$cpuType" == "x64" ]] && [[ "$dbName" == "taos" ]]; then
echo "====do deb package for the ubuntu system====" echo "====do deb package for the ubuntu system===="
output_dir="${top_dir}/debs" output_dir="${top_dir}/debs"
if [ -d ${output_dir} ]; then if [ -d ${output_dir} ]; then
...@@ -208,11 +215,17 @@ if [ "$osType" != "Darwin" ]; then ...@@ -208,11 +215,17 @@ if [ "$osType" != "Darwin" ]; then
echo "====do tar.gz package for all systems====" echo "====do tar.gz package for all systems===="
cd ${script_dir}/tools cd ${script_dir}/tools
if [[ "$dbName" == "taos" ]]; then
${csudo} ./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${csudo} ./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode}
${csudo} ./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${csudo} ./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode}
${csudo} ./makearbi.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${csudo} ./makearbi.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode}
else
${csudo} ./makepkg_power.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName}
${csudo} ./makeclient_power.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName}
${csudo} ./makearbi_power.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode}
fi
else else
cd ${script_dir}/tools cd ${script_dir}/tools
./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${dbName}
fi fi
...@@ -85,7 +85,7 @@ function install_bin() { ...@@ -85,7 +85,7 @@ function install_bin() {
# Remove links # Remove links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
if [ "$osType" == "Darwin" ]; then if [ "$osType" == "Darwin" ]; then
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
fi fi
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
${csudo} rm -f ${bin_link_dir}/set_core || : ${csudo} rm -f ${bin_link_dir}/set_core || :
...@@ -95,7 +95,7 @@ function install_bin() { ...@@ -95,7 +95,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 || :
if [ "$osType" == "Darwin" ]; then if [ "$osType" == "Darwin" ]; then
[ -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 || :
fi fi
[ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/rmtaos || : [ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/rmtaos || :
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo} ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo} ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
......
...@@ -41,7 +41,7 @@ fi ...@@ -41,7 +41,7 @@ fi
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
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
bin_files="${build_dir}/bin/taos ${script_dir}/remove_client.sh" bin_files="${build_dir}/bin/taos ${script_dir}/remove_client.sh"
else else
......
...@@ -102,26 +102,22 @@ function clean_log() { ...@@ -102,26 +102,22 @@ function clean_log() {
function clean_service_on_systemd() { function clean_service_on_systemd() {
taosd_service_config="${service_config_dir}/${taos_service_name}.service" taosd_service_config="${service_config_dir}/${taos_service_name}.service"
if systemctl is-active --quiet ${taos_service_name}; then if systemctl is-active --quiet ${taos_service_name}; then
echo "TDengine taosd is running, stopping it..." echo "TDengine taosd is running, stopping it..."
${csudo} systemctl stop ${taos_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl stop ${taos_service_name} &> /dev/null || echo &> /dev/null
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}
if [ "$verMode" == "cluster" ]; then
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..."
${csudo} systemctl stop ${tarbitrator_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl stop ${tarbitrator_service_name} &> /dev/null || echo &> /dev/null
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
nginx_service_config="${service_config_dir}/${nginx_service_name}.service" nginx_service_config="${service_config_dir}/${nginx_service_name}.service"
if [ -d ${bin_dir}/web ]; then if [ -d ${bin_dir}/web ]; then
if systemctl is-active --quiet ${nginx_service_name}; then if systemctl is-active --quiet ${nginx_service_name}; then
...@@ -129,7 +125,6 @@ function clean_service_on_systemd() { ...@@ -129,7 +125,6 @@ function clean_service_on_systemd() {
${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
...@@ -227,3 +222,4 @@ elif echo $osinfo | grep -qwi "centos" ; then ...@@ -227,3 +222,4 @@ elif echo $osinfo | grep -qwi "centos" ; then
fi fi
echo -e "${GREEN}TDengine is removed successfully!${NC}" echo -e "${GREEN}TDengine is removed successfully!${NC}"
echo
\ No newline at end of file
...@@ -39,6 +39,7 @@ function clean_bin() { ...@@ -39,6 +39,7 @@ function clean_bin() {
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
${csudo} rm -f ${bin_link_dir}/set_core || :
} }
function clean_lib() { function clean_lib() {
...@@ -80,3 +81,4 @@ clean_config ...@@ -80,3 +81,4 @@ clean_config
${csudo} rm -rf ${install_main_dir} ${csudo} rm -rf ${install_main_dir}
echo -e "${GREEN}TDengine client is removed successfully!${NC}" echo -e "${GREEN}TDengine client is removed successfully!${NC}"
echo
...@@ -85,7 +85,11 @@ extern const int32_t TYPE_BYTES[11]; ...@@ -85,7 +85,11 @@ extern const int32_t TYPE_BYTES[11];
#define TSDB_DATA_NULL_STR_L "null" #define TSDB_DATA_NULL_STR_L "null"
#define TSDB_DEFAULT_USER "root" #define TSDB_DEFAULT_USER "root"
#ifdef _TD_OEM_POWER_
#define TSDB_DEFAULT_PASS "powerdb"
#else
#define TSDB_DEFAULT_PASS "taosdata" #define TSDB_DEFAULT_PASS "taosdata"
#endif
#define TSDB_TRUE 1 #define TSDB_TRUE 1
#define TSDB_FALSE 0 #define TSDB_FALSE 0
......
...@@ -30,11 +30,22 @@ ...@@ -30,11 +30,22 @@
#include <regex.h> #include <regex.h>
/**************** Global variables ****************/ /**************** Global variables ****************/
#ifdef _TD_OEM_POWER_
char CLIENT_VERSION[] = "Welcome to the PowerDB shell from %s, Client Version:%s\n"
"Copyright (c) 2017 by PowerDB, Inc. All rights reserved.\n\n";
char PROMPT_HEADER[] = "power> ";
char CONTINUE_PROMPT[] = " -> ";
int prompt_size = 7;
#else
char CLIENT_VERSION[] = "Welcome to the TDengine shell from %s, Client Version:%s\n" char CLIENT_VERSION[] = "Welcome to the TDengine shell from %s, Client Version:%s\n"
"Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.\n\n"; "Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.\n\n";
char PROMPT_HEADER[] = "taos> "; char PROMPT_HEADER[] = "taos> ";
char CONTINUE_PROMPT[] = " -> "; char CONTINUE_PROMPT[] = " -> ";
int prompt_size = 6; int prompt_size = 6;
#endif
TAOS_RES *result = NULL; TAOS_RES *result = NULL;
SShellHistory history; SShellHistory history;
......
...@@ -89,7 +89,11 @@ typedef struct DemoArguments { ...@@ -89,7 +89,11 @@ typedef struct DemoArguments {
{0, 'h', "host", 0, "The host to connect to TDengine. Default is localhost.", 0}, {0, 'h', "host", 0, "The host to connect to TDengine. Default is localhost.", 0},
{0, 'p', "port", 0, "The TCP/IP port number to use for the connection. Default is 0.", 1}, {0, 'p', "port", 0, "The TCP/IP port number to use for the connection. Default is 0.", 1},
{0, 'u', "user", 0, "The TDengine user name to use when connecting to the server. Default is 'root'.", 2}, {0, 'u', "user", 0, "The TDengine user name to use when connecting to the server. Default is 'root'.", 2},
#ifdef _TD_OEM_POWER_
{0, 'P', "password", 0, "The password to use when connecting to the server. Default is 'powerdb'.", 3},
#else
{0, 'P', "password", 0, "The password to use when connecting to the server. Default is 'taosdata'.", 3}, {0, 'P', "password", 0, "The password to use when connecting to the server. Default is 'taosdata'.", 3},
#endif
{0, 'd', "database", 0, "Destination database. Default is 'test'.", 3}, {0, 'd', "database", 0, "Destination database. Default is 'test'.", 3},
{0, 'a', "replica", 0, "Set the replica parameters of the database, Default 1, min: 1, max: 3.", 3}, {0, 'a', "replica", 0, "Set the replica parameters of the database, Default 1, min: 1, max: 3.", 3},
{0, 'm', "table_prefix", 0, "Table prefix name. Default is 't'.", 3}, {0, 'm', "table_prefix", 0, "Table prefix name. Default is 't'.", 3},
...@@ -104,7 +108,11 @@ typedef struct DemoArguments { ...@@ -104,7 +108,11 @@ typedef struct DemoArguments {
{0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 1000.", 10}, {0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 1000.", 10},
{0, 't', "num_of_tables", 0, "The number of tables. Default is 10000.", 11}, {0, 't', "num_of_tables", 0, "The number of tables. Default is 10000.", 11},
{0, 'n', "num_of_records_per_table", 0, "The number of records per table. Default is 100000.", 12}, {0, 'n', "num_of_records_per_table", 0, "The number of records per table. Default is 100000.", 12},
#ifdef _TD_OEM_POWER_
{0, 'c', "config_directory", 0, "Configuration directory. Default is '/etc/power/'.", 14},
#else
{0, 'c', "config_directory", 0, "Configuration directory. Default is '/etc/taos/'.", 14}, {0, 'c', "config_directory", 0, "Configuration directory. Default is '/etc/taos/'.", 14},
#endif
{0, 'x', 0, 0, "Insert only flag.", 13}, {0, 'x', 0, 0, "Insert only flag.", 13},
{0, 'O', "order", 0, "Insert mode--0: In order, 1: Out of order. Default is in order.", 14}, {0, 'O', "order", 0, "Insert mode--0: In order, 1: Out of order. Default is in order.", 14},
{0, 'R', "rate", 0, "Out of order data's rate--if order=1 Default 10, min: 0, max: 50.", 14}, {0, 'R', "rate", 0, "Out of order data's rate--if order=1 Default 10, min: 0, max: 50.", 14},
...@@ -279,7 +287,11 @@ typedef struct DemoArguments { ...@@ -279,7 +287,11 @@ typedef struct DemoArguments {
printf("%s%s\n", indent, "-u"); printf("%s%s\n", indent, "-u");
printf("%s%s%s\n", indent, indent, "user, The user name to use when connecting to the server. Default is 'root'."); printf("%s%s%s\n", indent, indent, "user, The user name to use when connecting to the server. Default is 'root'.");
printf("%s%s\n", indent, "-p"); printf("%s%s\n", indent, "-p");
#ifdef _TD_OEM_POWER_
printf("%s%s%s\n", indent, indent, "password, The password to use when connecting to the server. Default is 'powerdb'.");
#else
printf("%s%s%s\n", indent, indent, "password, The password to use when connecting to the server. Default is 'taosdata'."); printf("%s%s%s\n", indent, indent, "password, The password to use when connecting to the server. Default is 'taosdata'.");
#endif
printf("%s%s\n", indent, "-d"); printf("%s%s\n", indent, "-d");
printf("%s%s%s\n", indent, indent, "database, Destination database. Default is 'test'."); printf("%s%s%s\n", indent, indent, "database, Destination database. Default is 'test'.");
printf("%s%s\n", indent, "-a"); printf("%s%s\n", indent, "-a");
...@@ -309,7 +321,11 @@ typedef struct DemoArguments { ...@@ -309,7 +321,11 @@ typedef struct DemoArguments {
printf("%s%s\n", indent, "-n"); printf("%s%s\n", indent, "-n");
printf("%s%s%s\n", indent, indent, "num_of_records_per_table, The number of records per table. Default is 100000."); printf("%s%s%s\n", indent, indent, "num_of_records_per_table, The number of records per table. Default is 100000.");
printf("%s%s\n", indent, "-c"); printf("%s%s\n", indent, "-c");
#ifdef _TD_OEM_POWER_
printf("%s%s%s\n", indent, indent, "config_directory, Configuration directory. Default is '/etc/power/'.");
#else
printf("%s%s%s\n", indent, indent, "config_directory, Configuration directory. Default is '/etc/taos/'."); printf("%s%s%s\n", indent, indent, "config_directory, Configuration directory. Default is '/etc/taos/'.");
#endif
printf("%s%s\n", indent, "-x"); printf("%s%s\n", indent, "-x");
printf("%s%s%s\n", indent, indent, "flag, Insert only flag."); printf("%s%s%s\n", indent, indent, "flag, Insert only flag.");
printf("%s%s\n", indent, "-O"); printf("%s%s\n", indent, "-O");
...@@ -513,7 +529,11 @@ int main(int argc, char *argv[]) { ...@@ -513,7 +529,11 @@ int main(int argc, char *argv[]) {
SDemoArguments arguments = { NULL, // host SDemoArguments arguments = { NULL, // host
0, // port 0, // port
"root", // user "root", // user
#ifdef _TD_OEM_POWER_
"powerdb", // password
#else
"taosdata", // password "taosdata", // password
#endif
"test", // database "test", // database
1, // replica 1, // replica
"t", // tb_prefix "t", // tb_prefix
......
...@@ -18,15 +18,25 @@ ...@@ -18,15 +18,25 @@
#include "tglobal.h" #include "tglobal.h"
void osInit() { void osInit() {
#ifdef _TD_OEM_POWER_
if (configDir[0] == 0) {
strcpy(configDir, "/etc/power");
}
strcpy(tsDataDir, "/var/lib/power");
strcpy(tsLogDir, "/var/log/power");
strcpy(tsScriptDir, "/etc/power");
#else
if (configDir[0] == 0) { if (configDir[0] == 0) {
strcpy(configDir, "/etc/taos"); strcpy(configDir, "/etc/taos");
} }
strcpy(tsDataDir, "/var/lib/taos");
strcpy(tsLogDir, "/var/log/taos");
strcpy(tsScriptDir, "/etc/taos");
#endif
strcpy(tsVnodeDir, ""); strcpy(tsVnodeDir, "");
strcpy(tsDnodeDir, ""); strcpy(tsDnodeDir, "");
strcpy(tsMnodeDir, ""); strcpy(tsMnodeDir, "");
strcpy(tsDataDir, "/var/lib/taos");
strcpy(tsLogDir, "/var/log/taos");
strcpy(tsScriptDir, "/etc/taos");
strcpy(tsOsName, "Linux"); strcpy(tsOsName, "Linux");
} }
\ No newline at end of file
...@@ -260,8 +260,13 @@ void taosReadGlobalLogCfg() { ...@@ -260,8 +260,13 @@ void taosReadGlobalLogCfg() {
} }
strcpy(configDir, full_path.we_wordv[0]); strcpy(configDir, full_path.we_wordv[0]);
} else { } else {
#ifdef _TD_OEM_POWER_
printf("configDir:%s not there, use default value: /etc/power", configDir);
strcpy(configDir, "/etc/power");
#else
printf("configDir:%s not there, use default value: /etc/taos", configDir); printf("configDir:%s not there, use default value: /etc/taos", configDir);
strcpy(configDir, "/etc/taos"); strcpy(configDir, "/etc/taos");
#endif
} }
wordfree(&full_path); wordfree(&full_path);
......
...@@ -66,7 +66,11 @@ int32_t tsAsyncLog = 1; ...@@ -66,7 +66,11 @@ int32_t tsAsyncLog = 1;
float tsTotalLogDirGB = 0; float tsTotalLogDirGB = 0;
float tsAvailLogDirGB = 0; float tsAvailLogDirGB = 0;
float tsMinimalLogDirGB = 0.1f; float tsMinimalLogDirGB = 0.1f;
#ifdef _TD_OEM_POWER_
char tsLogDir[TSDB_FILENAME_LEN] = "/var/log/power";
#else
char tsLogDir[TSDB_FILENAME_LEN] = "/var/log/taos"; char tsLogDir[TSDB_FILENAME_LEN] = "/var/log/taos";
#endif
static SLogObj tsLogObj = { .fileNum = 1 }; static SLogObj tsLogObj = { .fileNum = 1 };
static void * taosAsyncOutputLog(void *param); static void * taosAsyncOutputLog(void *param);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册