Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d9bc65e5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
d9bc65e5
编写于
2月 23, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
config
上级
cefb07bc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
50 addition
and
57 deletion
+50
-57
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+0
-5
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-46
source/dnode/mgmt/daemon/src/dmnCfg.c
source/dnode/mgmt/daemon/src/dmnCfg.c
+49
-6
未找到文件。
source/client/src/clientEnv.c
浏览文件 @
d9bc65e5
...
...
@@ -219,11 +219,6 @@ void taos_init_imp(void) {
return
;
}
if
(
taosCheckAndPrintCfg
())
{
tscInitRes
=
-
1
;
return
;
}
taosInitNotes
();
initMsgHandleFp
();
initQueryModuleMsgHandle
();
...
...
source/common/src/tglobal.c
浏览文件 @
d9bc65e5
...
...
@@ -274,13 +274,7 @@ void taosPrintDataDirCfg() {
}
#endif
static
void
taosCheckDataDirCfg
()
{
if
(
tsDiskCfgNum
<=
0
)
{
taosAddDataDir
(
0
,
tsDataDir
,
0
,
1
);
tsDiskCfgNum
=
1
;
uTrace
(
"dataDir:%s, level:0 primary:1 is configured by default"
,
tsDataDir
);
}
}
static
void
doInitGlobalConfig
(
void
)
{
osInit
();
...
...
@@ -678,45 +672,6 @@ static void doInitGlobalConfig(void) {
void
taosInitGlobalCfg
()
{
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
}
int32_t
taosCheckAndPrintCfg
()
{
#if 0
SEp ep = {0};
if (debugFlag & DEBUG_TRACE || debugFlag & DEBUG_DEBUG || debugFlag & DEBUG_DUMP) {
taosSetAllDebugFlag();
}
taosCheckDataDirCfg();
if (taosDirExist(tsTempDir) != 0) {
return -1;
}
taosGetSystemInfo();
tsSetLocale();
SGlobalCfg *cfg_timezone = taosGetConfigOption("timezone");
if (cfg_timezone && cfg_timezone->cfgStatus == TAOS_CFG_CSTATUS_FILE) {
tsSetTimeZone();
}
if (tsNumOfCores <= 0) {
tsNumOfCores = 1;
}
if (tsQueryBufferSize >= 0) {
tsQueryBufferSizeBytes = tsQueryBufferSize * 1048576UL;
}
uInfo(" check global cfg completed");
uInfo("==================================");
taosPrintCfg();
#endif
return
0
;
}
/*
* alter dnode 1 balance "vnode:1-dnode:2"
*/
...
...
source/dnode/mgmt/daemon/src/dmnCfg.c
浏览文件 @
d9bc65e5
...
...
@@ -15,6 +15,8 @@
#define _DEFAULT_SOURCE
#include "dmnInt.h"
#include "tlocale.h"
#include "ttimezone.h"
static
int32_t
dmnAddEpCfg
(
SConfig
*
pCfg
)
{
char
defaultFqdn
[
TSDB_FQDN_LEN
]
=
{
0
};
...
...
@@ -23,7 +25,7 @@ static int32_t dmnAddEpCfg(SConfig *pCfg) {
return
-
1
;
}
if
(
cfgAddString
(
pCfg
,
"fqdn"
,
defaultFqdn
)
!=
0
)
return
-
1
;
int32_t
defaultServerPort
=
6030
;
if
(
cfgAddInt32
(
pCfg
,
"serverPort"
,
defaultServerPort
,
1
,
65056
)
!=
0
)
return
-
1
;
...
...
@@ -37,15 +39,41 @@ static int32_t dmnAddEpCfg(SConfig *pCfg) {
return
0
;
}
static
int32_t
dmnAddDnodeCfg
(
SConfig
*
pCfg
)
{
if
(
dmnAddEpCfg
(
pCfg
)
!=
0
)
return
-
1
;
static
int32_t
dmnAddDirCfg
(
SConfig
*
pCfg
)
{
if
(
cfgAddDir
(
pCfg
,
"dataDir"
,
tsDataDir
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"tmpDir"
,
tsTempDir
)
!=
0
)
return
-
1
;
return
0
;
}
static
int32_t
dmnCheckDirCfg
(
SConfig
*
pCfg
)
{
SConfigItem
*
pItem
=
NULL
;
pItem
=
cfgGetItem
(
pCfg
,
"dataDir"
);
if
(
tsDiskCfgNum
<=
0
)
{
taosAddDataDir
(
0
,
pItem
->
str
,
0
,
1
);
tsDiskCfgNum
=
1
;
uTrace
(
"dataDir:%s, level:0 primary:1 is configured by default"
,
pItem
->
str
);
}
pItem
=
cfgGetItem
(
pCfg
,
"tmpDir"
);
if
(
taosDirExist
(
pItem
->
str
)
!=
0
)
{
return
-
1
;
}
return
0
;
}
static
int32_t
dmnAddVersionCfg
(
SConfig
*
pCfg
)
{
if
(
cfgAddString
(
pCfg
,
"buildinfo"
,
buildinfo
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"gitinfo"
,
gitinfo
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"version"
,
version
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"dataDir"
,
tsDataDir
)
!=
0
)
return
-
1
;
return
0
;
}
static
int32_t
dmnAddDnodeCfg
(
SConfig
*
pCfg
)
{
if
(
dmnAddEpCfg
(
pCfg
)
!=
0
)
return
-
1
;
if
(
dmnAddDirCfg
(
pCfg
)
!=
0
)
return
-
1
;
if
(
dmnAddVersionCfg
(
pCfg
)
!=
0
)
return
-
1
;
if
(
cfgAddTimezone
(
pCfg
,
"timezone"
,
""
)
!=
0
)
return
-
1
;
if
(
cfgAddLocale
(
pCfg
,
"locale"
,
""
)
!=
0
)
return
-
1
;
if
(
cfgAddCharset
(
pCfg
,
"charset"
,
""
)
!=
0
)
return
-
1
;
...
...
@@ -62,11 +90,26 @@ static int32_t dmnAddDnodeCfg(SConfig *pCfg) {
return
0
;
}
int32_t
dmnCheckCfg
(
SConfig
*
pCfg
)
{
static
int32_t
dmnCheckCfg
(
SConfig
*
pCfg
)
{
bool
enableCore
=
cfgGetItem
(
pCfg
,
"enableCoreFile"
)
->
bval
;
taosSetCoreDump
(
enableCore
);
if
(
dmnCheckDirCfg
(
pCfg
)
!=
0
)
{
return
-
1
;
}
taosGetSystemInfo
();
tsSetTimeZone
();
tsSetLocale
();
if
(
tsNumOfCores
<=
0
)
{
tsNumOfCores
=
1
;
}
if
(
tsQueryBufferSize
>=
0
)
{
tsQueryBufferSizeBytes
=
tsQueryBufferSize
*
1048576UL
;
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录