Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
fe4fb353
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
fe4fb353
编写于
12月 09, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TBASE-1241]
上级
b9a62d60
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
20 addition
and
46 deletion
+20
-46
src/inc/tglobalcfg.h
src/inc/tglobalcfg.h
+1
-1
src/modules/monitor/src/monitorSystem.c
src/modules/monitor/src/monitorSystem.c
+1
-19
src/os/linux/src/tsystem.c
src/os/linux/src/tsystem.c
+2
-2
src/system/detail/src/dnodeSystem.c
src/system/detail/src/dnodeSystem.c
+1
-1
src/system/detail/src/mgmtShell.c
src/system/detail/src/mgmtShell.c
+2
-5
src/system/detail/src/vnodeShell.c
src/system/detail/src/vnodeShell.c
+3
-5
src/system/lite/src/mgmtDnode.spec.c
src/system/lite/src/mgmtDnode.spec.c
+1
-1
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+9
-12
未找到文件。
src/inc/tglobalcfg.h
浏览文件 @
fe4fb353
...
...
@@ -74,7 +74,6 @@ extern int tsMetricMetaKeepTimer;
extern
float
tsNumOfThreadsPerCore
;
extern
float
tsRatioOfQueryThreads
;
extern
char
tsPublicIp
[];
extern
char
tsInternalIp
[];
extern
char
tsPrivateIp
[];
extern
char
tsServerIpStr
[];
extern
short
tsNumOfVnodesPerCore
;
...
...
@@ -151,6 +150,7 @@ extern int tsTelegrafUseFieldNum;
extern
int
tsAdminRowLimit
;
extern
int
tsTscEnableRecordSql
;
extern
int
tsAnyIp
;
extern
char
tsMonitorDbName
[];
extern
char
tsInternalPass
[];
...
...
src/modules/monitor/src/monitorSystem.c
浏览文件 @
fe4fb353
...
...
@@ -113,11 +113,7 @@ void monitorInitConn(void *para, void *unused) {
monitor
->
state
=
MONITOR_STATE_INITIALIZING
;
if
(
monitor
->
privateIpStr
[
0
]
==
0
)
{
#ifdef CLUSTER
strcpy
(
monitor
->
privateIpStr
,
tsPrivateIp
);
#else
strcpy
(
monitor
->
privateIpStr
,
tsInternalIp
);
#endif
for
(
int
i
=
0
;
i
<
TSDB_IPv4ADDR_LEN
;
++
i
)
{
if
(
monitor
->
privateIpStr
[
i
]
==
'.'
)
{
monitor
->
privateIpStr
[
i
]
=
'_'
;
...
...
@@ -167,11 +163,7 @@ void dnodeBuildMonitorSql(char *sql, int cmd) {
tsMonitorDbName
,
IP_LEN_STR
+
1
);
}
else
if
(
cmd
==
MONITOR_CMD_CREATE_TB_DN
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.dn_%s using %s.dn tags('%s')"
,
tsMonitorDbName
,
#ifdef CLUSTER
monitor
->
privateIpStr
,
tsMonitorDbName
,
tsPrivateIp
);
#else
monitor
->
privateIpStr
,
tsMonitorDbName
,
tsInternalIp
);
#endif
}
else
if
(
cmd
==
MONITOR_CMD_CREATE_MT_ACCT
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.acct(ts timestamp "
...
...
@@ -226,10 +218,8 @@ void monitorInitDatabaseCb(void *param, TAOS_RES *result, int code) {
taosLogSqlFp
=
monitorExecuteSQL
;
#ifdef CLUSTER
taosLogAcctFp
=
monitorSaveAcctLog
;
monitorLPrint
(
"dnode:%s is started"
,
tsPrivateIp
);
#else
monitorLPrint
(
"dnode:%s is started"
,
tsInternalIp
);
#endif
monitorLPrint
(
"dnode:%s is started"
,
tsPrivateIp
);
}
monitor
->
cmdIndex
++
;
monitorInitDatabase
();
...
...
@@ -245,11 +235,7 @@ void monitorStopSystem() {
return
;
}
#ifdef CLUSTER
monitorLPrint
(
"dnode:%s monitor module is stopped"
,
tsPrivateIp
);
#else
monitorLPrint
(
"dnode:%s monitor module is stopped"
,
tsInternalIp
);
#endif
monitor
->
state
=
MONITOR_STATE_STOPPED
;
taosLogFp
=
NULL
;
if
(
monitor
->
initTimer
!=
NULL
)
{
...
...
@@ -439,11 +425,7 @@ void monitorSaveLog(int level, const char *const format, ...) {
va_end
(
argpointer
);
if
(
len
>
max_length
)
len
=
max_length
;
#ifdef CLUSTER
len
+=
sprintf
(
sql
+
len
,
"', '%s')"
,
tsPrivateIp
);
#else
len
+=
sprintf
(
sql
+
len
,
"', '%s')"
,
tsInternalIp
);
#endif
sql
[
len
++
]
=
0
;
monitorTrace
(
"monitor:%p, save log, sql: %s"
,
monitor
->
conn
,
sql
);
...
...
src/os/linux/src/tsystem.c
浏览文件 @
fe4fb353
...
...
@@ -381,8 +381,8 @@ bool taosGetCardName(char *ip, char *name) {
bool
taosGetCardInfo
(
int64_t
*
bytes
)
{
static
char
tsPublicCard
[
1000
]
=
{
0
};
if
(
tsPublicCard
[
0
]
==
0
)
{
if
(
!
taosGetCardName
(
ts
Internal
Ip
,
tsPublicCard
))
{
pError
(
"can't get card name from ip:%s"
,
ts
Internal
Ip
);
if
(
!
taosGetCardName
(
ts
Private
Ip
,
tsPublicCard
))
{
pError
(
"can't get card name from ip:%s"
,
ts
Private
Ip
);
return
false
;
}
int
cardNameLen
=
(
int
)
strlen
(
tsPublicCard
);
...
...
src/system/detail/src/dnodeSystem.c
浏览文件 @
fe4fb353
...
...
@@ -139,7 +139,7 @@ int dnodeInitSystem() {
vnodeInitMgmtIp
();
tsPrintGlobalConfig
();
dPrint
(
"Server IP address is:%s"
,
ts
Internal
Ip
);
dPrint
(
"Server IP address is:%s"
,
ts
Private
Ip
);
taosSetCoreDump
();
...
...
src/system/detail/src/mgmtShell.c
浏览文件 @
fe4fb353
...
...
@@ -79,11 +79,8 @@ int mgmtInitShell() {
if
(
numOfThreads
<
1
)
numOfThreads
=
1
;
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
#ifdef CLUSTER
rpcInit
.
localIp
=
tsInternalIp
;
#else
rpcInit
.
localIp
=
"0.0.0.0"
;
#endif
rpcInit
.
localIp
=
tsAnyIp
?
"0.0.0.0"
:
tsPrivateIp
;;
rpcInit
.
localPort
=
tsMgmtShellPort
;
rpcInit
.
label
=
"MND-shell"
;
rpcInit
.
numOfThreads
=
numOfThreads
;
...
...
src/system/detail/src/vnodeShell.c
浏览文件 @
fe4fb353
...
...
@@ -143,11 +143,9 @@ int vnodeInitShell() {
if
(
numOfThreads
<
1
)
numOfThreads
=
1
;
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
#ifdef CLUSTER
rpcInit
.
localIp
=
tsInternalIp
;
#else
rpcInit
.
localIp
=
"0.0.0.0"
;
#endif
rpcInit
.
localIp
=
tsAnyIp
?
"0.0.0.0"
:
tsPrivateIp
;
rpcInit
.
localPort
=
tsVnodeShellPort
;
rpcInit
.
label
=
"DND-shell"
;
rpcInit
.
numOfThreads
=
numOfThreads
;
...
...
src/system/lite/src/mgmtDnode.spec.c
浏览文件 @
fe4fb353
...
...
@@ -27,7 +27,7 @@ int mgmtUpdateDnode(SDnodeObj *pDnode) { return 0; }
void
mgmtCleanUpDnodes
()
{}
int
mgmtInitDnodes
()
{
dnodeObj
.
privateIp
=
inet_addr
(
ts
Internal
Ip
);;
dnodeObj
.
privateIp
=
inet_addr
(
ts
Private
Ip
);;
dnodeObj
.
createdTime
=
(
int64_t
)
tsRebootTime
*
1000
;
dnodeObj
.
lastReboot
=
tsRebootTime
;
dnodeObj
.
numOfCores
=
(
uint16_t
)
tsNumOfCores
;
...
...
src/util/src/tglobalcfg.c
浏览文件 @
fe4fb353
...
...
@@ -75,7 +75,6 @@ int tsMetricMetaKeepTimer = 600; // second
float
tsNumOfThreadsPerCore
=
1
.
0
;
float
tsRatioOfQueryThreads
=
0
.
5
;
char
tsPublicIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
char
tsInternalIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
char
tsPrivateIp
[
TSDB_IPv4ADDR_LEN
]
=
{
0
};
char
tsServerIpStr
[
TSDB_IPv4ADDR_LEN
]
=
"127.0.0.1"
;
short
tsNumOfVnodesPerCore
=
8
;
...
...
@@ -164,6 +163,7 @@ int tsAdminRowLimit = 10240;
int
tsTscEnableRecordSql
=
0
;
int
tsEnableCoreFile
=
0
;
int
tsAnyIp
=
1
;
int
tsRpcTimer
=
300
;
int
tsRpcMaxTime
=
600
;
// seconds;
...
...
@@ -448,9 +448,6 @@ static void doInitGlobalConfig() {
tsInitConfigOption
(
cfg
++
,
"privateIp"
,
tsPrivateIp
,
TSDB_CFG_VTYPE_IPSTR
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLUSTER
,
0
,
0
,
TSDB_IPv4ADDR_LEN
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"internalIp"
,
tsInternalIp
,
TSDB_CFG_VTYPE_IPSTR
,
TSDB_CFG_CTYPE_B_CONFIG
,
0
,
0
,
TSDB_IPv4ADDR_LEN
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"localIp"
,
tsLocalIp
,
TSDB_CFG_VTYPE_IPSTR
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
,
0
,
0
,
TSDB_IPv4ADDR_LEN
,
TSDB_CFG_UTYPE_NONE
);
...
...
@@ -709,7 +706,7 @@ static void doInitGlobalConfig() {
1
,
100000
,
0
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"httpEnableRecordSql"
,
&
tsHttpEnableRecordSql
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
,
1
,
100000
,
0
,
TSDB_CFG_UTYPE_NONE
);
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"telegrafUseFieldNum"
,
&
tsTelegrafUseFieldNum
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
,
0
,
1
,
1
,
TSDB_CFG_UTYPE_NONE
);
...
...
@@ -773,12 +770,16 @@ static void doInitGlobalConfig() {
tsInitConfigOption
(
cfg
++
,
"tscEnableRecordSql"
,
&
tsTscEnableRecordSql
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
,
1
,
100000
,
0
,
TSDB_CFG_UTYPE_NONE
);
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"enableCoreFile"
,
&
tsEnableCoreFile
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
,
1
,
100000
,
0
,
TSDB_CFG_UTYPE_NONE
);
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
tsInitConfigOption
(
cfg
++
,
"anyIp"
,
&
tsAnyIp
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
,
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
// version info
tsInitConfigOption
(
cfg
++
,
"gitinfo"
,
gitinfo
,
TSDB_CFG_VTYPE_STRING
,
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
,
...
...
@@ -904,10 +905,6 @@ bool tsReadGlobalConfig() {
strcpy
(
tsPublicIp
,
tsPrivateIp
);
}
if
(
tsInternalIp
[
0
]
==
0
)
{
strcpy
(
tsInternalIp
,
tsPrivateIp
);
}
if
(
tsLocalIp
[
0
]
==
0
)
{
strcpy
(
tsLocalIp
,
tsPrivateIp
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录