Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3156ab2f
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
3156ab2f
编写于
2月 06, 2021
作者:
H
huili
提交者:
GitHub
2月 06, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5165 from taosdata/hotfix/test
[TD-2947]<fix>when update version, first stop nginx
上级
121c4ed9
14a9d4a0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
94 addition
and
20 deletion
+94
-20
packaging/tools/install.sh
packaging/tools/install.sh
+21
-5
packaging/tools/install_power.sh
packaging/tools/install_power.sh
+16
-4
src/kit/taosdemox/insert.json
src/kit/taosdemox/insert.json
+1
-0
src/kit/taosdemox/query.json
src/kit/taosdemox/query.json
+1
-0
src/kit/taosdemox/taosdemox.c
src/kit/taosdemox/taosdemox.c
+55
-11
未找到文件。
packaging/tools/install.sh
浏览文件 @
3156ab2f
...
@@ -147,8 +147,8 @@ done
...
@@ -147,8 +147,8 @@ done
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
function
kill_
taosd
()
{
function
kill_
process
()
{
pid
=
$(
ps
-ef
|
grep
"
taosd
"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
pid
=
$(
ps
-ef
|
grep
"
$1
"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
if
[
-n
"
$pid
"
]
;
then
if
[
-n
"
$pid
"
]
;
then
${
csudo
}
kill
-9
$pid
||
:
${
csudo
}
kill
-9
$pid
||
:
fi
fi
...
@@ -168,7 +168,10 @@ function install_main_path() {
...
@@ -168,7 +168,10 @@ function install_main_path() {
if
[
"
$verMode
"
==
"cluster"
]
;
then
if
[
"
$verMode
"
==
"cluster"
]
;
then
${
csudo
}
mkdir
-p
${
nginx_dir
}
${
csudo
}
mkdir
-p
${
nginx_dir
}
fi
fi
${
csudo
}
cp
${
script_dir
}
/email
${
install_main_dir
}
/
||
:
if
[[
-e
${
script_dir
}
/email
]]
;
then
${
csudo
}
cp
${
script_dir
}
/email
${
install_main_dir
}
/
||
:
fi
}
}
function
install_bin
()
{
function
install_bin
()
{
...
@@ -680,7 +683,7 @@ function install_service() {
...
@@ -680,7 +683,7 @@ function install_service() {
install_service_on_sysvinit
install_service_on_sysvinit
else
else
# must manual stop taosd
# must manual stop taosd
kill_taosd
kill_
process
taosd
fi
fi
}
}
...
@@ -749,9 +752,22 @@ function update_TDengine() {
...
@@ -749,9 +752,22 @@ function update_TDengine() {
elif
((
${
service_mod
}
==
1
))
;
then
elif
((
${
service_mod
}
==
1
))
;
then
${
csudo
}
service taosd stop
||
:
${
csudo
}
service taosd stop
||
:
else
else
kill_taosd
kill_process taosd
fi
sleep
1
fi
if
[
"
$verMode
"
==
"cluster"
]
;
then
if
pidof nginx &> /dev/null
;
then
if
((
${
service_mod
}
==
0
))
;
then
${
csudo
}
systemctl stop nginxd
||
:
elif
((
${
service_mod
}
==
1
))
;
then
${
csudo
}
service nginxd stop
||
:
else
kill_process nginx
fi
fi
sleep
1
sleep
1
fi
fi
fi
install_main_path
install_main_path
...
...
packaging/tools/install_power.sh
浏览文件 @
3156ab2f
...
@@ -146,8 +146,8 @@ done
...
@@ -146,8 +146,8 @@ done
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
function
kill_p
owerd
()
{
function
kill_p
rocess
()
{
pid
=
$(
ps
-ef
|
grep
"
powerd
"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
pid
=
$(
ps
-ef
|
grep
"
$1
"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
if
[
-n
"
$pid
"
]
;
then
if
[
-n
"
$pid
"
]
;
then
${
csudo
}
kill
-9
$pid
||
:
${
csudo
}
kill
-9
$pid
||
:
fi
fi
...
@@ -652,7 +652,7 @@ function install_service() {
...
@@ -652,7 +652,7 @@ function install_service() {
install_service_on_sysvinit
install_service_on_sysvinit
else
else
# must manual stop powerd
# must manual stop powerd
kill_powerd
kill_p
rocess p
owerd
fi
fi
}
}
...
@@ -721,9 +721,21 @@ function update_PowerDB() {
...
@@ -721,9 +721,21 @@ function update_PowerDB() {
elif
((
${
service_mod
}
==
1
))
;
then
elif
((
${
service_mod
}
==
1
))
;
then
${
csudo
}
service powerd stop
||
:
${
csudo
}
service powerd stop
||
:
else
else
kill_powerd
kill_p
rocess p
owerd
fi
fi
sleep
1
sleep
1
fi
if
[
"
$verMode
"
==
"cluster"
]
;
then
if
pidof nginx &> /dev/null
;
then
if
((
${
service_mod
}
==
0
))
;
then
${
csudo
}
systemctl stop nginxd
||
:
elif
((
${
service_mod
}
==
1
))
;
then
${
csudo
}
service nginxd stop
||
:
else
kill_process nginx
fi
sleep
1
fi
fi
fi
install_main_path
install_main_path
...
...
src/kit/taosdemox/insert.json
浏览文件 @
3156ab2f
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
"thread_count"
:
4
,
"thread_count"
:
4
,
"thread_count_create_tbl"
:
1
,
"thread_count_create_tbl"
:
1
,
"result_file"
:
"./insert_res.txt"
,
"result_file"
:
"./insert_res.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"databases"
:
[{
"databases"
:
[{
"dbinfo"
:
{
"dbinfo"
:
{
"name"
:
"db"
,
"name"
:
"db"
,
...
...
src/kit/taosdemox/query.json
浏览文件 @
3156ab2f
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
"port"
:
6030
,
"port"
:
6030
,
"user"
:
"root"
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"password"
:
"taosdata"
,
"confirm_parameter_prompt"
:
"yes"
,
"databases"
:
"db01"
,
"databases"
:
"db01"
,
"specified_table_query"
:
"specified_table_query"
:
{
"query_interval"
:
1
,
"concurrent"
:
1
,
{
"query_interval"
:
1
,
"concurrent"
:
1
,
...
...
src/kit/taosdemox/taosdemox.c
浏览文件 @
3156ab2f
...
@@ -181,6 +181,7 @@ typedef struct SArguments_S {
...
@@ -181,6 +181,7 @@ typedef struct SArguments_S {
char
*
sqlFile
;
char
*
sqlFile
;
bool
use_metric
;
bool
use_metric
;
bool
insert_only
;
bool
insert_only
;
bool
answer_yes
;
char
*
output_file
;
char
*
output_file
;
int
mode
;
int
mode
;
char
*
datatype
[
MAX_NUM_DATATYPE
+
1
];
char
*
datatype
[
MAX_NUM_DATATYPE
+
1
];
...
@@ -430,13 +431,14 @@ typedef struct curlMemInfo_S {
...
@@ -430,13 +431,14 @@ typedef struct curlMemInfo_S {
{
0
,
'w'
,
"length_of_chartype"
,
0
,
"The length of data_type 'BINARY' or 'NCHAR'. Default is 16"
,
4
},
{
0
,
'w'
,
"length_of_chartype"
,
0
,
"The length of data_type 'BINARY' or 'NCHAR'. Default is 16"
,
4
},
{
0
,
'l'
,
"num_of_cols_per_record"
,
0
,
"The number of columns per record. Default is 10."
,
4
},
{
0
,
'l'
,
"num_of_cols_per_record"
,
0
,
"The number of columns per record. Default is 10."
,
4
},
{
0
,
'T'
,
"num_of_threads"
,
0
,
"The number of threads. Default is 10."
,
4
},
{
0
,
'T'
,
"num_of_threads"
,
0
,
"The number of threads. Default is 10."
,
4
},
// {0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 100.",
4},
// {0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 100.", 4},
{
0
,
't'
,
"num_of_tables"
,
0
,
"The number of tables. Default is 10000."
,
4
},
{
0
,
't'
,
"num_of_tables"
,
0
,
"The number of tables. Default is 10000."
,
4
},
{
0
,
'n'
,
"num_of_records_per_table"
,
0
,
"The number of records per table. Default is 10000."
,
4
},
{
0
,
'n'
,
"num_of_records_per_table"
,
0
,
"The number of records per table. Default is 10000."
,
4
},
{
0
,
'x'
,
0
,
0
,
"Not insert only flag."
,
4
},
{
0
,
'x'
,
0
,
0
,
"Not insert only flag."
,
4
},
{
0
,
'y'
,
0
,
0
,
"Default input yes for prompt."
,
4
},
{
0
,
'O'
,
"disorderRatio"
,
0
,
"Insert mode--0: In order, > 0: disorder ratio. Default is in order."
,
4
},
{
0
,
'O'
,
"disorderRatio"
,
0
,
"Insert mode--0: In order, > 0: disorder ratio. Default is in order."
,
4
},
{
0
,
'R'
,
"disorderRang"
,
0
,
"Out of order data's range, ms, default is 1000."
,
4
},
{
0
,
'R'
,
"disorderRang"
,
0
,
"Out of order data's range, ms, default is 1000."
,
4
},
//{0, 'D', "delete database", 0, "if elete database if exists. 0: no, 1: yes, default is 1",
5},
//{0, 'D', "delete database", 0, "if elete database if exists. 0: no, 1: yes, default is 1", 5},
{
0
}};
{
0
}};
/* Parse a single option. */
/* Parse a single option. */
...
@@ -529,6 +531,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -529,6 +531,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break
;
break
;
case
'x'
:
case
'x'
:
arguments
->
insert_only
=
false
;
arguments
->
insert_only
=
false
;
case
'y'
:
arguments
->
answer_yes
=
true
;
break
;
break
;
case
'c'
:
case
'c'
:
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
...
@@ -644,6 +648,7 @@ SArguments g_args = {NULL,
...
@@ -644,6 +648,7 @@ SArguments g_args = {NULL,
NULL
,
// sqlFile
NULL
,
// sqlFile
false
,
// use_metric
false
,
// use_metric
true
,
// insert_only
true
,
// insert_only
false
,
// answer_yes;
"./output.txt"
,
// output_file
"./output.txt"
,
// output_file
0
,
// mode : sync or async
0
,
// mode : sync or async
{
{
...
@@ -2535,6 +2540,22 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -2535,6 +2540,22 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
}
else
{
}
else
{
printf
(
"failed to read json, threads2 not found"
);
printf
(
"failed to read json, threads2 not found"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
cJSON
*
answerPrompt
=
cJSON_GetObjectItem
(
root
,
"confirm_parameter_prompt"
);
// yes, no,
if
(
answerPrompt
&&
answerPrompt
->
type
==
cJSON_String
&&
answerPrompt
->
valuestring
!=
NULL
)
{
if
(
0
==
strncasecmp
(
answerPrompt
->
valuestring
,
"yes"
,
3
))
{
g_args
.
answer_yes
=
false
;
}
else
if
(
0
==
strncasecmp
(
answerPrompt
->
valuestring
,
"no"
,
2
))
{
g_args
.
answer_yes
=
true
;
}
else
{
g_args
.
answer_yes
=
false
;
}
}
else
if
(
!
answerPrompt
)
{
g_args
.
answer_yes
=
false
;
}
else
{
printf
(
"failed to read json, confirm_parameter_prompt not found"
);
goto
PARSE_OVER
;
}
}
cJSON
*
dbs
=
cJSON_GetObjectItem
(
root
,
"databases"
);
cJSON
*
dbs
=
cJSON_GetObjectItem
(
root
,
"databases"
);
...
@@ -3052,6 +3073,22 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
...
@@ -3052,6 +3073,22 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
strncpy
(
g_queryInfo
.
password
,
"taosdata"
,
MAX_DB_NAME_SIZE
);;
strncpy
(
g_queryInfo
.
password
,
"taosdata"
,
MAX_DB_NAME_SIZE
);;
}
}
cJSON
*
answerPrompt
=
cJSON_GetObjectItem
(
root
,
"confirm_parameter_prompt"
);
// yes, no,
if
(
answerPrompt
&&
answerPrompt
->
type
==
cJSON_String
&&
answerPrompt
->
valuestring
!=
NULL
)
{
if
(
0
==
strncasecmp
(
answerPrompt
->
valuestring
,
"yes"
,
3
))
{
g_args
.
answer_yes
=
false
;
}
else
if
(
0
==
strncasecmp
(
answerPrompt
->
valuestring
,
"no"
,
2
))
{
g_args
.
answer_yes
=
true
;
}
else
{
g_args
.
answer_yes
=
false
;
}
}
else
if
(
!
answerPrompt
)
{
g_args
.
answer_yes
=
false
;
}
else
{
printf
(
"failed to read json, confirm_parameter_prompt not found"
);
goto
PARSE_OVER
;
}
cJSON
*
dbs
=
cJSON_GetObjectItem
(
root
,
"databases"
);
cJSON
*
dbs
=
cJSON_GetObjectItem
(
root
,
"databases"
);
if
(
dbs
&&
dbs
->
type
==
cJSON_String
&&
dbs
->
valuestring
!=
NULL
)
{
if
(
dbs
&&
dbs
->
type
==
cJSON_String
&&
dbs
->
valuestring
!=
NULL
)
{
strncpy
(
g_queryInfo
.
dbName
,
dbs
->
valuestring
,
MAX_DB_NAME_SIZE
);
strncpy
(
g_queryInfo
.
dbName
,
dbs
->
valuestring
,
MAX_DB_NAME_SIZE
);
...
@@ -4289,9 +4326,11 @@ int insertTestProcess() {
...
@@ -4289,9 +4326,11 @@ int insertTestProcess() {
printfInsertMeta
();
printfInsertMeta
();
printfInsertMetaToFile
(
g_fpOfInsertResult
);
printfInsertMetaToFile
(
g_fpOfInsertResult
);
printf
(
"Press enter key to continue
\n\n
"
);
if
(
!
g_args
.
answer_yes
)
{
(
void
)
getchar
();
printf
(
"Press enter key to continue
\n\n
"
);
(
void
)
getchar
();
}
init_rand_data
();
init_rand_data
();
// create database and super tables
// create database and super tables
...
@@ -4469,9 +4508,12 @@ int queryTestProcess() {
...
@@ -4469,9 +4508,12 @@ int queryTestProcess() {
}
}
printfQueryMeta
();
printfQueryMeta
();
printf
(
"Press enter key to continue
\n\n
"
);
(
void
)
getchar
();
if
(
!
g_args
.
answer_yes
)
{
printf
(
"Press enter key to continue
\n\n
"
);
(
void
)
getchar
();
}
printfQuerySystemInfo
(
taos
);
printfQuerySystemInfo
(
taos
);
pthread_t
*
pids
=
NULL
;
pthread_t
*
pids
=
NULL
;
...
@@ -4724,8 +4766,10 @@ void *superSubscribeProcess(void *sarg) {
...
@@ -4724,8 +4766,10 @@ void *superSubscribeProcess(void *sarg) {
int
subscribeTestProcess
()
{
int
subscribeTestProcess
()
{
printfQueryMeta
();
printfQueryMeta
();
printf
(
"Press enter key to continue
\n\n
"
);
if
(
!
g_args
.
answer_yes
)
{
(
void
)
getchar
();
printf
(
"Press enter key to continue
\n\n
"
);
(
void
)
getchar
();
}
TAOS
*
taos
=
NULL
;
TAOS
*
taos
=
NULL
;
taos_init
();
taos_init
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录