Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_44632607
TDengine
提交
84bc54c6
T
TDengine
项目概览
weixin_44632607
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
84bc54c6
编写于
3月 13, 2020
作者:
L
lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[modify for supporting oem]
上级
feea8174
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
100 addition
and
90 deletion
+100
-90
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+1
-1
src/kit/shell/src/shellDarwin.c
src/kit/shell/src/shellDarwin.c
+3
-3
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+14
-4
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+3
-3
src/kit/shell/src/shellWindows.c
src/kit/shell/src/shellWindows.c
+3
-3
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+5
-5
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+24
-24
src/modules/http/src/httpAuth.c
src/modules/http/src/httpAuth.c
+1
-1
src/modules/http/src/httpSql.c
src/modules/http/src/httpSql.c
+2
-2
src/modules/monitor/src/monitorSystem.c
src/modules/monitor/src/monitorSystem.c
+2
-2
src/os/darwin/src/tdarwin.c
src/os/darwin/src/tdarwin.c
+1
-1
src/os/linux/src/tlinux.c
src/os/linux/src/tlinux.c
+5
-5
src/os/linux/src/tsystem.c
src/os/linux/src/tsystem.c
+1
-1
src/os/windows/src/twindows.c
src/os/windows/src/twindows.c
+5
-5
src/system/detail/CMakeLists.txt
src/system/detail/CMakeLists.txt
+3
-3
src/system/detail/src/dnodeService.c
src/system/detail/src/dnodeService.c
+7
-7
src/system/detail/src/dnodeSystem.c
src/system/detail/src/dnodeSystem.c
+7
-7
src/system/detail/src/mgmtSystem.c
src/system/detail/src/mgmtSystem.c
+2
-2
src/system/lite/src/mgmtAcct.spec.c
src/system/lite/src/mgmtAcct.spec.c
+1
-1
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+6
-6
src/util/src/version.c
src/util/src/version.c
+4
-4
未找到文件。
src/client/src/tscSystem.c
浏览文件 @
84bc54c6
...
...
@@ -77,7 +77,7 @@ void taos_init_imp() {
// For log directory
if
(
stat
(
logDir
,
&
dirstat
)
<
0
)
mkdir
(
logDir
,
0755
);
sprintf
(
temp
,
"%s/
taoslog"
,
logDir
);
sprintf
(
temp
,
"%s/
%slog"
,
logDir
,
DB_CLIENT_NAME
);
if
(
taosInitLog
(
temp
,
tsNumOfLogLines
,
10
)
<
0
)
{
printf
(
"failed to open log file in directory:%s
\n
"
,
logDir
);
}
...
...
src/kit/shell/src/shellDarwin.c
浏览文件 @
84bc54c6
...
...
@@ -32,16 +32,16 @@ void insertChar(Command *cmd, char *c, int size);
void
printHelp
()
{
char
indent
[
10
]
=
" "
;
printf
(
"
taos shell is used to test the TDEngine database
\n
"
);
printf
(
"
%s shell is used to test the %s database
\n
"
,
DB_CLIENT_NAME
,
DB_FULL_NAME
);
printf
(
"%s%s
\n
"
,
indent
,
"-h"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"TDEngine
server IP address to connect. The default host is localhost."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
DB_FULL_NAME
"
server IP address to connect. The default host is localhost."
);
printf
(
"%s%s
\n
"
,
indent
,
"-p"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The password to use when connecting to the server."
);
printf
(
"%s%s
\n
"
,
indent
,
"-P"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The TCP/IP port number to use for the connection"
);
printf
(
"%s%s
\n
"
,
indent
,
"-u"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The
TDEngine
user name to use when connecting to the server."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The
"
DB_FULL_NAME
"
user name to use when connecting to the server."
);
printf
(
"%s%s
\n
"
,
indent
,
"-c"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Configuration directory."
);
printf
(
"%s%s
\n
"
,
indent
,
"-s"
);
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
84bc54c6
...
...
@@ -26,10 +26,12 @@
#include <regex.h>
/**************** Global variables ****************/
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
"
;
char
PROMPT_HEADER
[]
=
"taos> "
;
char
CONTINUE_PROMPT
[]
=
" -> "
;
char
CLIENT_VERSION
[]
=
"Welcome to the "
DB_FULL_NAME
" shell from %s, Client Version:%s
\n
"
"Copyright (c) 2017 by "
DB_COPYRIGHT
", Inc. All rights reserved.
\n\n
"
;
//char PROMPT_HEADER[] = "taos> ";
//char CONTINUE_PROMPT[] = " -> ";
char
PROMPT_HEADER
[
16
]
=
{
0
};
char
CONTINUE_PROMPT
[
16
]
=
{
0
};
int
prompt_size
=
6
;
TAOS_RES
*
result
=
NULL
;
History
history
;
...
...
@@ -38,6 +40,14 @@ History history;
* FUNCTION: Initialize the shell.
*/
TAOS
*
shellInit
(
struct
arguments
*
args
)
{
sprintf
(
PROMPT_HEADER
,
"%s> "
,
DB_CLIENT_NAME
);
int
len
=
strlen
(
PROMPT_HEADER
);
for
(
int
i
=
0
;
i
<
len
-
3
;
++
i
)
{
CONTINUE_PROMPT
[
i
]
=
' '
;
}
strcpy
(
CONTINUE_PROMPT
+
len
-
3
,
"-> "
);
prompt_size
=
strlen
(
DB_CLIENT_NAME
)
+
2
;
printf
(
"
\n
"
);
printf
(
CLIENT_VERSION
,
osName
,
taos_get_client_info
());
fflush
(
stdout
);
...
...
src/kit/shell/src/shellLinux.c
浏览文件 @
84bc54c6
...
...
@@ -29,14 +29,14 @@ struct termios oldtio;
extern
int
wcwidth
(
wchar_t
c
);
void
insertChar
(
Command
*
cmd
,
char
*
c
,
int
size
);
const
char
*
argp_program_version
=
version
;
const
char
*
argp_program_bug_address
=
"<support@
taosdata
.com>"
;
const
char
*
argp_program_bug_address
=
"<support@
"
DB_COMPANY
"
.com>"
;
static
char
doc
[]
=
""
;
static
char
args_doc
[]
=
""
;
static
struct
argp_option
options
[]
=
{
{
"host"
,
'h'
,
"HOST"
,
0
,
"TDEngine
server IP address to connect. The default host is localhost."
},
{
"host"
,
'h'
,
"HOST"
,
0
,
DB_FULL_NAME
"
server IP address to connect. The default host is localhost."
},
{
"password"
,
'p'
,
"PASSWORD"
,
OPTION_ARG_OPTIONAL
,
"The password to use when connecting to the server."
},
{
"port"
,
'P'
,
"PORT"
,
0
,
"The TCP/IP port number to use for the connection."
},
{
"user"
,
'u'
,
"USER"
,
0
,
"The
TDEngine
user name to use when connecting to the server."
},
{
"user"
,
'u'
,
"USER"
,
0
,
"The
"
DB_FULL_NAME
"
user name to use when connecting to the server."
},
{
"config-dir"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configuration directory."
},
{
"commands"
,
's'
,
"COMMANDS"
,
0
,
"Commands to run without enter the shell."
},
{
"raw-time"
,
'r'
,
0
,
0
,
"Output time as uint64_t."
},
...
...
src/kit/shell/src/shellWindows.c
浏览文件 @
84bc54c6
...
...
@@ -17,16 +17,16 @@
void
printHelp
()
{
char
indent
[
10
]
=
" "
;
printf
(
"
taos shell is used to test the TDEngine database
\n
"
);
printf
(
"
%s shell is used to test the %s database
\n
"
,
DB_CLIENT_NAME
,
DB_FULL_NAME
);
printf
(
"%s%s
\n
"
,
indent
,
"-h"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"TDEngine
server IP address to connect. The default host is localhost."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
DB_FULL_NAME
"
server IP address to connect. The default host is localhost."
);
printf
(
"%s%s
\n
"
,
indent
,
"-p"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The password to use when connecting to the server."
);
printf
(
"%s%s
\n
"
,
indent
,
"-P"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The TCP/IP port number to use for the connection"
);
printf
(
"%s%s
\n
"
,
indent
,
"-u"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The
TDEngine
user name to use when connecting to the server."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The
"
DB_FULL_NAME
"
user name to use when connecting to the server."
);
printf
(
"%s%s
\n
"
,
indent
,
"-c"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Configuration directory."
);
printf
(
"%s%s
\n
"
,
indent
,
"-s"
);
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
84bc54c6
...
...
@@ -46,10 +46,10 @@ extern char configDir[];
/* The options we understand. */
static
struct
argp_option
options
[]
=
{
{
0
,
'h'
,
"host"
,
0
,
"The host to connect to
TDEngine
. Default is localhost."
,
0
},
{
0
,
'h'
,
"host"
,
0
,
"The host to connect to
"
DB_CLIENT_NAME
"
. Default is localhost."
,
0
},
{
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
,
'a'
,
"password"
,
0
,
"The password to use when connecting to the server. Default is '
taosdata'."
,
3
},
{
0
,
'u'
,
"user"
,
0
,
"The
"
DB_FULL_NAME
"
user name to use when connecting to the server. Default is 'root'."
,
2
},
{
0
,
'a'
,
"password"
,
0
,
"The password to use when connecting to the server. Default is '
"
DB_COMPANY
"'."
,
3
},
{
0
,
'd'
,
"database"
,
0
,
"Destination database. Default is 'test'."
,
3
},
{
0
,
'm'
,
"table_prefix"
,
0
,
"Table prefix name. Default is 't'."
,
3
},
{
0
,
'M'
,
0
,
0
,
"Use metric flag."
,
13
},
...
...
@@ -272,7 +272,7 @@ int main(int argc, char *argv[]) {
struct
arguments
arguments
=
{
NULL
,
// host
0
,
// port
"root"
,
// user
"taosdata"
,
// password
DB_COMPANY
,
// password
"test"
,
// database
"t"
,
// tb_prefix
false
,
// use_metric
...
...
@@ -383,7 +383,7 @@ int main(int argc, char *argv[]) {
taos_init
();
TAOS
*
taos
=
taos_connect
(
ip_addr
,
user
,
pass
,
NULL
,
port
);
if
(
taos
==
NULL
)
{
fprintf
(
stderr
,
"Failed to connect to
TDengin
e, reason:%s
\n
"
,
taos_errstr
(
taos
));
fprintf
(
stderr
,
"Failed to connect to
databas
e, reason:%s
\n
"
,
taos_errstr
(
taos
));
taos_close
(
taos
);
return
1
;
}
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
84bc54c6
...
...
@@ -138,7 +138,7 @@ static int64_t totalDumpOutRows = 0;
SDbInfo
**
dbInfos
=
NULL
;
const
char
*
argp_program_version
=
version
;
const
char
*
argp_program_bug_address
=
"<support@
taosdata
.com>"
;
const
char
*
argp_program_bug_address
=
"<support@
"
DB_COMPANY
"
.com>"
;
/* Program documentation. */
static
char
doc
[]
=
""
;
...
...
@@ -157,28 +157,28 @@ static char args_doc[] = "dbname [tbname ...]\n--databases dbname ...\n--all-dat
/* The options we understand. */
static
struct
argp_option
options
[]
=
{
// connection option
{
"host"
,
'h'
,
"HOST"
,
0
,
"Server host dumping data from. Default is localhost."
,
0
},
{
"user"
,
'u'
,
"USER"
,
0
,
"User name used to connect to server. Default is root."
,
0
},
{
"password"
,
'p'
,
"PASSWORD"
,
0
,
"User password to connect to server. Default is
taosdata."
,
0
},
{
"port"
,
'P'
,
"PORT"
,
0
,
"Port to connect"
,
0
},
{
"cversion"
,
'v'
,
"CVERION"
,
0
,
"client version"
,
0
},
{
"host"
,
'h'
,
"HOST"
,
0
,
"Server host dumping data from. Default is localhost."
,
0
},
{
"user"
,
'u'
,
"USER"
,
0
,
"User name used to connect to server. Default is root."
,
0
},
{
"password"
,
'p'
,
"PASSWORD"
,
0
,
"User password to connect to server. Default is
"
DB_COMPANY
"."
,
0
},
{
"port"
,
'P'
,
"PORT"
,
0
,
"Port to connect"
,
0
},
{
"cversion"
,
'v'
,
"CVERION"
,
0
,
"client version"
,
0
},
// input/output file
{
"outpath"
,
'o'
,
"OUTPATH"
,
0
,
"Output file path."
,
1
},
{
"inpath"
,
'i'
,
"INPATH"
,
0
,
"Input file path."
,
1
},
{
"config"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configure directory. Default is /etc/
taos/taos.cfg."
,
1
},
{
"encode"
,
'e'
,
"ENCODE"
,
0
,
"Input file encoding."
,
1
},
{
"outpath"
,
'o'
,
"OUTPATH"
,
0
,
"Output file path."
,
1
},
{
"inpath"
,
'i'
,
"INPATH"
,
0
,
"Input file path."
,
1
},
{
"config"
,
'c'
,
"CONFIG_DIR"
,
0
,
"Configure directory. Default is /etc/
"
DB_CLIENT_NAME
"/"
DB_CLIENT_NAME
".cfg."
,
1
},
{
"encode"
,
'e'
,
"ENCODE"
,
0
,
"Input file encoding."
,
1
},
// dump unit options
{
"all-databases"
,
'A'
,
0
,
0
,
"Dump all databases."
,
2
},
{
"databases"
,
'B'
,
0
,
0
,
"Dump assigned databases"
,
2
},
{
"all-databases"
,
'A'
,
0
,
0
,
"Dump all databases."
,
2
},
{
"databases"
,
'B'
,
0
,
0
,
"Dump assigned databases"
,
2
},
// dump format options
{
"schemaonly"
,
's'
,
0
,
0
,
"Only dump schema."
,
3
},
{
"with-property"
,
'M'
,
0
,
0
,
"Dump schema with properties."
,
3
},
{
"start-time"
,
'S'
,
"START_TIME"
,
0
,
"Start time to dump."
,
3
},
{
"end-time"
,
'E'
,
"END_TIME"
,
0
,
"End time to dump."
,
3
},
{
"data-batch"
,
'N'
,
"DATA_BATCH"
,
0
,
"Number of data point per insert statement. Default is 1."
,
3
},
{
"table-batch"
,
'T'
,
"TABLE_BATCH"
,
0
,
"Number of table dumpout into one output file. Default is 1."
,
3
},
{
"thread_num"
,
't'
,
"THREAD_NUM"
,
0
,
"Number of thread for dump in file. Default is 5."
,
3
},
{
"allow-sys"
,
'a'
,
0
,
0
,
"Allow to dump sys database"
,
3
},
{
"schemaonly"
,
's'
,
0
,
0
,
"Only dump schema."
,
3
},
{
"with-property"
,
'M'
,
0
,
0
,
"Dump schema with properties."
,
3
},
{
"start-time"
,
'S'
,
"START_TIME"
,
0
,
"Start time to dump."
,
3
},
{
"end-time"
,
'E'
,
"END_TIME"
,
0
,
"End time to dump."
,
3
},
{
"data-batch"
,
'N'
,
"DATA_BATCH"
,
0
,
"Number of data point per insert statement. Default is 1."
,
3
},
{
"table-batch"
,
'T'
,
"TABLE_BATCH"
,
0
,
"Number of table dumpout into one output file. Default is 1."
,
3
},
{
"thread_num"
,
't'
,
"THREAD_NUM"
,
0
,
"Number of thread for dump in file. Default is 5."
,
3
},
{
"allow-sys"
,
'a'
,
0
,
0
,
"Allow to dump sys database"
,
3
},
{
0
}};
/* Used by main to communicate with parse_opt. */
...
...
@@ -337,7 +337,7 @@ struct arguments tsArguments = {
// connection option
NULL
,
"root"
,
"taosdata"
,
DB_COMPANY
,
0
,
""
,
// outpath and inpath
...
...
@@ -644,7 +644,7 @@ int taosDumpOut(struct arguments *arguments) {
/* Connect to server */
taos
=
taos_connect
(
arguments
->
host
,
arguments
->
user
,
arguments
->
password
,
NULL
,
arguments
->
port
);
if
(
taos
==
NULL
)
{
fprintf
(
stderr
,
"failed to connect to
TDengin
e server
\n
"
);
fprintf
(
stderr
,
"failed to connect to
databas
e server
\n
"
);
goto
_exit_failure
;
}
...
...
@@ -1457,7 +1457,7 @@ int taosCheckParam(struct arguments *arguments) {
if
(
arguments
->
arg_list_len
==
0
)
{
if
((
!
arguments
->
all_databases
)
&&
(
!
arguments
->
isDumpIn
))
{
fprintf
(
stderr
,
"taos
dump requires parameters
\n
"
);
fprintf
(
stderr
,
DB_CLIENT_NAME
"
dump requires parameters
\n
"
);
return
-
1
;
}
}
...
...
@@ -2059,7 +2059,7 @@ int taosDumpIn(struct arguments *arguments) {
taos
=
taos_connect
(
arguments
->
host
,
arguments
->
user
,
arguments
->
password
,
NULL
,
arguments
->
port
);
if
(
taos
==
NULL
)
{
fprintf
(
stderr
,
"failed to connect to
TDengin
e server
\n
"
);
fprintf
(
stderr
,
"failed to connect to
databas
e server
\n
"
);
return
-
1
;
}
...
...
src/modules/http/src/httpAuth.c
浏览文件 @
84bc54c6
...
...
@@ -113,7 +113,7 @@ bool httpGenTaosdAuthToken(HttpContext *pContext, char *token, int maxLen) {
free
(
encrypt
);
free
(
base64
);
httpTrace
(
"context:%p, fd:%d, ip:%s, gen
taosd token:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
token
);
httpTrace
(
"context:%p, fd:%d, ip:%s, gen
%s token:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
DB_SERVICE_NAME
,
token
);
return
true
;
}
src/modules/http/src/httpSql.c
浏览文件 @
84bc54c6
...
...
@@ -358,7 +358,7 @@ void httpProcessRequestCb(void *param, TAOS_RES *result, int code) {
return
;
}
httpTrace
(
"context:%p, fd:%d, ip:%s, user:%s, connect
tdengin
e success, taos:%p"
,
pContext
,
pContext
->
fd
,
httpTrace
(
"context:%p, fd:%d, ip:%s, user:%s, connect
databas
e success, taos:%p"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
taos
);
if
(
pContext
->
taos
==
NULL
)
{
httpError
(
"context:%p, fd:%d, ip:%s, user:%s, login error, taos is empty"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
...
...
@@ -384,7 +384,7 @@ void httpProcessRequest(HttpContext *pContext) {
pContext
->
reqType
==
HTTP_REQTYPE_LOGIN
)
{
taos_connect_a
(
NULL
,
pContext
->
user
,
pContext
->
pass
,
""
,
0
,
httpProcessRequestCb
,
(
void
*
)
pContext
,
&
(
pContext
->
taos
));
httpTrace
(
"context:%p, fd:%d, ip:%s, user:%s, try connect
tdengin
e, taos:%p"
,
pContext
,
pContext
->
fd
,
httpTrace
(
"context:%p, fd:%d, ip:%s, user:%s, try connect
databas
e, taos:%p"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
user
,
pContext
->
taos
);
}
else
{
httpAccessSession
(
pContext
);
...
...
src/modules/monitor/src/monitorSystem.c
浏览文件 @
84bc54c6
...
...
@@ -154,8 +154,8 @@ void dnodeBuildMonitorSql(char *sql, int cmd) {
}
else
if
(
cmd
==
MONITOR_CMD_CREATE_MT_DN
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.dn(ts timestamp"
", cpu_
taosd
float, cpu_system float, cpu_cores int"
", mem_
taosd
float, mem_system float, mem_total int"
", cpu_
"
DB_SERVICE_NAME
"
float, cpu_system float, cpu_cores int"
", mem_
"
DB_SERVICE_NAME
"
float, mem_system float, mem_total int"
", disk_used float, disk_total int"
", band_speed float"
", io_read float, io_write float"
...
...
src/os/darwin/src/tdarwin.c
浏览文件 @
84bc54c6
...
...
@@ -283,7 +283,7 @@ void taosGetSystemLocale() {
void
tsPrintOsInfo
()
{}
void
taosKillSystem
()
{
tError
(
"function
taosKillSystem, exit!"
);
tError
(
"function
%sKillSystem, exit!"
,
DB_CLIENT_NAME
);
exit
(
0
);
}
...
...
src/os/linux/src/tlinux.c
浏览文件 @
84bc54c6
...
...
@@ -34,11 +34,11 @@
#include "tutil.h"
#include "ttimer.h"
char
configDir
[
TSDB_FILENAME_LEN
]
=
"/etc/taos"
;
char
tsDirectory
[
TSDB_FILENAME_LEN
]
=
"/var/lib/
taos"
;
char
dataDir
[
TSDB_FILENAME_LEN
]
=
"/var/lib/taos"
;
char
logDir
[
TSDB_FILENAME_LEN
]
=
"/var/log/taos"
;
char
scriptDir
[
TSDB_FILENAME_LEN
]
=
"/etc/taos"
;
char
configDir
[
TSDB_FILENAME_LEN
]
=
"/etc/"
DB_CLIENT_NAME
;
char
tsDirectory
[
TSDB_FILENAME_LEN
]
=
"/var/lib/
"
DB_CLIENT_NAME
;
char
dataDir
[
TSDB_FILENAME_LEN
]
=
"/var/lib/"
DB_CLIENT_NAME
;
char
logDir
[
TSDB_FILENAME_LEN
]
=
"/var/log/"
DB_CLIENT_NAME
;
char
scriptDir
[
TSDB_FILENAME_LEN
]
=
"/etc/"
DB_CLIENT_NAME
;
char
osName
[]
=
"Linux"
;
int64_t
str2int64
(
char
*
str
)
{
...
...
src/os/linux/src/tsystem.c
浏览文件 @
84bc54c6
...
...
@@ -589,7 +589,7 @@ void tsPrintOsInfo() {
void
taosKillSystem
()
{
// SIGINT
pPrint
(
"
taosd will shut down soon"
);
pPrint
(
"
%s will shut down soon"
,
DB_SERVICE_NAME
);
kill
(
tsProcId
,
2
);
}
...
...
src/os/windows/src/twindows.c
浏览文件 @
84bc54c6
...
...
@@ -32,11 +32,11 @@
#include <winbase.h>
#include <Winsock2.h>
char
configDir
[
TSDB_FILENAME_LEN
]
=
"C:/TDengine
/cfg"
;
char
tsDirectory
[
TSDB_FILENAME_LEN
]
=
"C:/
TDengine
/data"
;
char
logDir
[
TSDB_FILENAME_LEN
]
=
"C:/TDengine
/log"
;
char
dataDir
[
TSDB_FILENAME_LEN
]
=
"C:/TDengine
/data"
;
char
scriptDir
[
TSDB_FILENAME_LEN
]
=
"C:/TDengine
/script"
;
char
configDir
[
TSDB_FILENAME_LEN
]
=
"C:/"
DB_FULL_NAME
"
/cfg"
;
char
tsDirectory
[
TSDB_FILENAME_LEN
]
=
"C:/
"
DB_FULL_NAME
"
/data"
;
char
logDir
[
TSDB_FILENAME_LEN
]
=
"C:/"
DB_FULL_NAME
"
/log"
;
char
dataDir
[
TSDB_FILENAME_LEN
]
=
"C:/"
DB_FULL_NAME
"
/data"
;
char
scriptDir
[
TSDB_FILENAME_LEN
]
=
"C:/"
DB_FULL_NAME
"
/script"
;
char
osName
[]
=
"Windows"
;
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
...
...
src/system/detail/CMakeLists.txt
浏览文件 @
84bc54c6
...
...
@@ -37,9 +37,9 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/log/
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
TD_TESTS_OUTPUT_DIR
}
/data/
COMMAND
${
CMAKE_COMMAND
}
-E echo dataDir
${
TD_TESTS_OUTPUT_DIR
}
/data >
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
taos
.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo logDir
${
TD_TESTS_OUTPUT_DIR
}
/log >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
taos
.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo charset UTF-8 >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
taos
.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo dataDir
${
TD_TESTS_OUTPUT_DIR
}
/data >
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
${
DB_CLIENT_NAME
}
.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo logDir
${
TD_TESTS_OUTPUT_DIR
}
/log >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
${
DB_CLIENT_NAME
}
.cfg
COMMAND
${
CMAKE_COMMAND
}
-E echo charset UTF-8 >>
${
TD_TESTS_OUTPUT_DIR
}
/cfg/
${
DB_CLIENT_NAME
}
.cfg
COMMENT
"prepare
${
DB_SERVICE_NAME
}
environment"
)
ADD_CUSTOM_TARGET
(
${
PREPARE_ENV_TARGET
}
ALL WORKING_DIRECTORY
${
TD_EXECUTABLE_OUTPUT_PATH
}
DEPENDS
${
PREPARE_ENV_CMD
}
)
...
...
src/system/detail/src/dnodeService.c
浏览文件 @
84bc54c6
...
...
@@ -33,13 +33,13 @@ void signal_handler(int signum, siginfo_t *sigInfo, void *context) {
return
;
}
syslog
(
LOG_INFO
,
"Shut down signal is %d"
,
signum
);
syslog
(
LOG_INFO
,
"Shutting down
TDengine
service..."
);
syslog
(
LOG_INFO
,
"Shutting down
"
DB_FULL_NAME
"
service..."
);
// clean the system.
dPrint
(
"shut down signal is %d, sender PID:%d"
,
signum
,
sigInfo
->
si_pid
);
dnodeCleanUpSystem
();
// close the syslog
syslog
(
LOG_INFO
,
"Shut down
TDengine
service successfully"
);
dPrint
(
"
TDengine is shut down!"
);
syslog
(
LOG_INFO
,
"Shut down
"
DB_FULL_NAME
"
service successfully"
);
dPrint
(
"
%s is shut down!"
,
DB_FULL_NAME
);
closelog
();
exit
(
EXIT_SUCCESS
);
}
...
...
@@ -92,19 +92,19 @@ int main(int argc, char *argv[]) {
// sigaction(SIGABRT, &act, NULL);
// Open /var/log/syslog file to record information.
openlog
(
"TDengine
:"
,
LOG_PID
|
LOG_CONS
|
LOG_NDELAY
,
LOG_LOCAL1
);
syslog
(
LOG_INFO
,
"Starting
TDengine
service..."
);
openlog
(
DB_FULL_NAME
"
:"
,
LOG_PID
|
LOG_CONS
|
LOG_NDELAY
,
LOG_LOCAL1
);
syslog
(
LOG_INFO
,
"Starting
"
DB_FULL_NAME
"
service..."
);
// Initialize the system
if
(
dnodeInitSystem
()
<
0
)
{
syslog
(
LOG_ERR
,
"Error initialize
TDengine
system"
);
syslog
(
LOG_ERR
,
"Error initialize
"
DB_FULL_NAME
"
system"
);
closelog
();
dnodeCleanUpSystem
();
exit
(
EXIT_FAILURE
);
}
syslog
(
LOG_INFO
,
"Started
TDengine
service successfully."
);
syslog
(
LOG_INFO
,
"Started
"
DB_FULL_NAME
"
service successfully."
);
while
(
1
)
{
sleep
(
1000
);
...
...
src/system/detail/src/dnodeSystem.c
浏览文件 @
84bc54c6
...
...
@@ -119,17 +119,17 @@ int dnodeInitSystem() {
if
(
stat
(
logDir
,
&
dirstat
)
<
0
)
mkdir
(
logDir
,
0755
);
sprintf
(
temp
,
"%s/
taosdlog"
,
logDir
);
sprintf
(
temp
,
"%s/
%slog"
,
logDir
,
DB_SERVICE_NAME
);
if
(
taosInitLog
(
temp
,
tsNumOfLogLines
,
1
)
<
0
)
printf
(
"failed to init log file
\n
"
);
if
(
!
tsReadGlobalConfig
())
{
// TODO : Change this function
tsPrintGlobalConfig
();
dError
(
"
TDengine read global config failed"
);
dError
(
"
%s read global config failed"
,
DB_FULL_NAME
);
return
-
1
;
}
if
(
taosCreateTierDirectory
()
!=
0
)
{
dError
(
"
TDengine init tier directory failed"
);
dError
(
"
%s init tier directory failed"
,
DB_FULL_NAME
);
return
-
1
;
}
...
...
@@ -145,7 +145,7 @@ int dnodeInitSystem() {
dnodeInitModules
();
pthread_mutex_init
(
&
dmutex
,
NULL
);
dPrint
(
"starting to initialize
TDengine ..."
);
dPrint
(
"starting to initialize
%s ..."
,
DB_FULL_NAME
);
vnodeInitQHandle
();
if
(
dnodeInitSystemSpec
()
<
0
)
{
...
...
@@ -155,14 +155,14 @@ int dnodeInitSystem() {
for
(
int
mod
=
0
;
mod
<
TSDB_MOD_MAX
;
++
mod
)
{
if
(
tsModule
[
mod
].
num
!=
0
&&
tsModule
[
mod
].
initFp
)
{
if
((
*
tsModule
[
mod
].
initFp
)()
!=
0
)
{
dError
(
"
TDengine initialization failed"
);
dError
(
"
%s initialization failed"
,
DB_FULL_NAME
);
return
-
1
;
}
}
}
if
(
vnodeInitSystem
()
!=
0
)
{
dError
(
"
TDengine vnodes initialization failed"
);
dError
(
"
%s vnodes initialization failed"
,
DB_FULL_NAME
);
return
-
1
;
}
...
...
@@ -170,7 +170,7 @@ int dnodeInitSystem() {
dnodeStartModuleSpec
();
dPrint
(
"
TDengine is initialized successfully"
);
dPrint
(
"
%s is initialized successfully"
,
DB_FULL_NAME
);
return
0
;
}
...
...
src/system/detail/src/mgmtSystem.c
浏览文件 @
84bc54c6
...
...
@@ -68,7 +68,7 @@ void mgmtCleanUpSystem() {
}
int
mgmtStartSystem
()
{
mPrint
(
"starting to initialize
TDengin
e mgmt ..."
);
mPrint
(
"starting to initialize
databas
e mgmt ..."
);
struct
stat
dirstat
;
if
(
stat
(
mgmtDirectory
,
&
dirstat
)
<
0
)
{
...
...
@@ -147,7 +147,7 @@ int mgmtStartSystem() {
mgmtStartMgmtTimer
();
mPrint
(
"
TDengin
e mgmt is initialized successfully"
);
mPrint
(
"
databas
e mgmt is initialized successfully"
);
return
0
;
}
src/system/lite/src/mgmtAcct.spec.c
浏览文件 @
84bc54c6
...
...
@@ -59,7 +59,7 @@ void mgmtCheckAcct() {
pAcct
->
acctId
=
0
;
strcpy
(
pAcct
->
user
,
"root"
);
mgmtCreateUser
(
pAcct
,
"root"
,
"taosdata"
);
mgmtCreateUser
(
pAcct
,
"root"
,
DB_COMPANY
);
mgmtCreateUser
(
pAcct
,
"monitor"
,
tsInternalPass
);
mgmtCreateUser
(
pAcct
,
"_root"
,
tsInternalPass
);
}
...
...
src/util/src/tglobalcfg.c
浏览文件 @
84bc54c6
...
...
@@ -119,7 +119,7 @@ char tsMgmtZone[16] = "rzone";
char
tsLocalIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
char
tsDefaultDB
[
TSDB_DB_NAME_LEN
]
=
{
0
};
char
tsDefaultUser
[
64
]
=
"root"
;
char
tsDefaultPass
[
64
]
=
"taosdata"
;
char
tsDefaultPass
[
64
]
=
DB_COMPANY
;
int
tsMaxMeterConnections
=
10000
;
int
tsMaxMgmtConnections
=
2000
;
int
tsMaxVnodeConnections
=
10000
;
...
...
@@ -863,13 +863,13 @@ void tsReadGlobalLogConfig() {
if
(
full_path
.
we_wordv
!=
NULL
&&
full_path
.
we_wordv
[
0
]
!=
NULL
)
{
strcpy
(
configDir
,
full_path
.
we_wordv
[
0
]);
}
else
{
printf
(
"configDir:%s not there, use default value: /etc/
taos"
,
configDir
);
s
trcpy
(
configDir
,
"/etc/taos"
);
printf
(
"configDir:%s not there, use default value: /etc/
%s"
,
configDir
,
DB_CLIENT_NAME
);
s
printf
(
configDir
,
"/etc/%s"
,
DB_CLIENT_NAME
);
}
wordfree
(
&
full_path
);
tsReadLogOption
(
"logDir"
,
logDir
);
sprintf
(
fileName
,
"%s/
taos.cfg"
,
configDir
);
sprintf
(
fileName
,
"%s/
%s.cfg"
,
configDir
,
DB_CLIENT_NAME
);
fp
=
fopen
(
fileName
,
"r"
);
if
(
fp
==
NULL
)
{
printf
(
"
\n
option file:%s not found, all options are set to system default
\n
"
,
fileName
);
...
...
@@ -909,7 +909,7 @@ bool tsReadGlobalConfig() {
int
olen
,
vlen
,
vlen1
;
char
fileName
[
128
];
sprintf
(
fileName
,
"%s/
taos.cfg"
,
configDir
);
sprintf
(
fileName
,
"%s/
%s.cfg"
,
configDir
,
DB_CLIENT_NAME
);
fp
=
fopen
(
fileName
,
"r"
);
if
(
fp
==
NULL
)
{
}
else
{
...
...
@@ -1061,7 +1061,7 @@ int tsCfgDynamicOptions(char *msg) {
}
void
tsPrintGlobalConfig
()
{
pPrint
(
"
taos config & system info:"
);
pPrint
(
"
%s config & system info:"
,
DB_CLIENT_NAME
);
pPrint
(
"=================================="
);
for
(
int
i
=
0
;
i
<
tsGlobalConfigNum
;
++
i
)
{
...
...
src/util/src/version.c
浏览文件 @
84bc54c6
char
version
[
64
]
=
"1.6.6.1"
;
char
compatible_version
[
64
]
=
"1.6.0.0"
;
char
gitinfo
[
128
]
=
"
0b5b412ef0ae2449ece538601a29b899b2b727b9
"
;
char
gitinfoOfInternal
[
128
]
=
"
8ae0d83a3610b9b4726373dd3073e4a8f444fb26
"
;
char
buildinfo
[
512
]
=
"Built by root at 2020-03-1
1 09:08
"
;
char
gitinfo
[
128
]
=
"
feea817446e25ff1ef77cefaeeda08f45564d6bc
"
;
char
gitinfoOfInternal
[
128
]
=
"
5c736133836e7a9f757216539986ddf746439a11
"
;
char
buildinfo
[
512
]
=
"Built by root at 2020-03-1
3 16:27
"
;
void
libtaos_1_6_6_1_Linux_x64
_beta
()
{};
void
libtaos_1_6_6_1_Linux_x64
()
{};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录