Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c71ec2b7
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
c71ec2b7
编写于
3月 12, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
f9685371
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
43 addition
and
42 deletion
+43
-42
source/dnode/mgmt/exec/inc/dndExec.h
source/dnode/mgmt/exec/inc/dndExec.h
+9
-8
source/dnode/mgmt/exec/src/dndCfg.c
source/dnode/mgmt/exec/src/dndCfg.c
+3
-4
source/dnode/mgmt/exec/src/dndMain.c
source/dnode/mgmt/exec/src/dndMain.c
+28
-27
source/dnode/mgmt/exec/src/dndUtil.c
source/dnode/mgmt/exec/src/dndUtil.c
+3
-3
未找到文件。
source/dnode/mgmt/exec/inc/dndExec.h
浏览文件 @
c71ec2b7
...
...
@@ -14,12 +14,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_D
MN_INT
_H_
#define _TD_D
MN_INT
_H_
#ifndef _TD_D
ND_EXEC
_H_
#define _TD_D
ND_EXEC
_H_
#include "tconfig.h"
#include "dnode.h"
#include "taoserror.h"
#include "tconfig.h"
#include "tglobal.h"
#include "tlog.h"
#include "version.h"
...
...
@@ -35,14 +36,14 @@ extern "C" {
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
void
d
mn
DumpCfg
();
void
d
mn
PrintVersion
();
void
d
mn
GenerateGrant
();
void
d
nd
DumpCfg
();
void
d
nd
PrintVersion
();
void
d
nd
GenerateGrant
();
SDnodeObjCfg
d
mn
GetObjCfg
();
SDnodeObjCfg
d
nd
GetObjCfg
();
#ifdef __cplusplus
}
#endif
#endif
/*_TD_D
MN_INT
_H_*/
#endif
/*_TD_D
ND_EXEC
_H_*/
source/dnode/mgmt/exec/src/dndCfg.c
浏览文件 @
c71ec2b7
...
...
@@ -14,10 +14,9 @@
*/
#define _DEFAULT_SOURCE
#include "dmnInt.h"
#include "tconfig.h"
#include "dndExec.h"
SDnodeObjCfg
d
mn
GetObjCfg
()
{
SDnodeObjCfg
d
nd
GetObjCfg
()
{
SConfig
*
pCfg
=
taosGetCfg
();
SDnodeObjCfg
objCfg
=
{
0
};
...
...
@@ -33,7 +32,7 @@ SDnodeObjCfg dmnGetObjCfg() {
return
objCfg
;
}
void
d
mn
DumpCfg
()
{
void
d
nd
DumpCfg
()
{
SConfig
*
pCfg
=
taosGetCfg
();
cfgDumpCfg
(
pCfg
,
0
,
1
);
}
\ No newline at end of file
source/dnode/mgmt/exec/src/dndMain.c
浏览文件 @
c71ec2b7
...
...
@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include "d
mnInt
.h"
#include "d
ndExec
.h"
static
struct
{
bool
dumpConfig
;
...
...
@@ -24,22 +24,22 @@ static struct {
char
envFile
[
PATH_MAX
];
char
apolloUrl
[
PATH_MAX
];
SDnode
*
pDnode
;
}
dmn
=
{
0
};
}
global
=
{
0
};
static
void
d
mn
SigintHandle
(
int
signum
,
void
*
info
,
void
*
ctx
)
{
static
void
d
nd
SigintHandle
(
int
signum
,
void
*
info
,
void
*
ctx
)
{
dInfo
(
"singal:%d is received"
,
signum
);
dndeHandleEvent
(
dmn
.
pDnode
,
DND_EVENT_STOP
);
dndeHandleEvent
(
global
.
pDnode
,
DND_EVENT_STOP
);
}
static
void
d
mn
SetSignalHandle
()
{
taosSetSignal
(
SIGTERM
,
d
mn
SigintHandle
);
taosSetSignal
(
SIGHUP
,
d
mn
SigintHandle
);
taosSetSignal
(
SIGINT
,
d
mn
SigintHandle
);
taosSetSignal
(
SIGABRT
,
d
mn
SigintHandle
);
taosSetSignal
(
SIGBREAK
,
d
mn
SigintHandle
);
static
void
d
nd
SetSignalHandle
()
{
taosSetSignal
(
SIGTERM
,
d
nd
SigintHandle
);
taosSetSignal
(
SIGHUP
,
d
nd
SigintHandle
);
taosSetSignal
(
SIGINT
,
d
nd
SigintHandle
);
taosSetSignal
(
SIGABRT
,
d
nd
SigintHandle
);
taosSetSignal
(
SIGBREAK
,
d
nd
SigintHandle
);
}
static
int32_t
d
mn
ParseOption
(
int32_t
argc
,
char
const
*
argv
[])
{
static
int32_t
d
nd
ParseOption
(
int32_t
argc
,
char
const
*
argv
[])
{
for
(
int32_t
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
...
...
@@ -53,11 +53,11 @@ static int32_t dmnParseOption(int32_t argc, char const *argv[]) {
return
-
1
;
}
}
else
if
(
strcmp
(
argv
[
i
],
"-C"
)
==
0
)
{
dmn
.
dumpConfig
=
true
;
global
.
dumpConfig
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-k"
)
==
0
)
{
dmn
.
generateGrant
=
true
;
global
.
generateGrant
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-V"
)
==
0
)
{
dmn
.
printVersion
=
true
;
global
.
printVersion
=
true
;
}
else
{
}
}
...
...
@@ -65,19 +65,20 @@ static int32_t dmnParseOption(int32_t argc, char const *argv[]) {
return
0
;
}
int32_t
dmn
RunDnode
()
{
static
int32_t
dnd
RunDnode
()
{
if
(
dndInit
()
!=
0
)
{
dInfo
(
"failed to initialize dnode environment since %s"
,
terrstr
());
return
-
1
;
}
SDnodeObjCfg
objCfg
=
d
mn
GetObjCfg
();
SDnodeObjCfg
objCfg
=
d
nd
GetObjCfg
();
SDnode
*
pDnode
=
dndCreate
(
&
objCfg
);
if
(
pDnode
==
NULL
)
{
dError
(
"failed to to create dnode object since %s"
,
terrstr
());
return
-
1
;
}
else
{
dmn
.
pDnode
=
pDnode
;
global
.
pDnode
=
pDnode
;
dndSetSignalHandle
();
}
dInfo
(
"start the TDengine service"
);
...
...
@@ -97,36 +98,36 @@ int main(int argc, char const *argv[]) {
return
-
1
;
}
if
(
d
mn
ParseOption
(
argc
,
argv
)
!=
0
)
{
if
(
d
nd
ParseOption
(
argc
,
argv
)
!=
0
)
{
return
-
1
;
}
if
(
dmn
.
generateGrant
)
{
d
mn
GenerateGrant
();
if
(
global
.
generateGrant
)
{
d
nd
GenerateGrant
();
return
0
;
}
if
(
dmn
.
printVersion
)
{
d
mn
PrintVersion
();
if
(
global
.
printVersion
)
{
d
nd
PrintVersion
();
return
0
;
}
if
(
taosCreateLog
(
"taosdlog"
,
1
,
configDir
,
dmn
.
envFile
,
dmn
.
apolloUrl
,
NULL
,
0
)
!=
0
)
{
if
(
taosCreateLog
(
"taosdlog"
,
1
,
configDir
,
global
.
envFile
,
global
.
apolloUrl
,
NULL
,
0
)
!=
0
)
{
dError
(
"failed to start TDengine since read log config error"
);
return
-
1
;
}
if
(
taosInitCfg
(
configDir
,
dmn
.
envFile
,
dmn
.
apolloUrl
,
NULL
,
0
)
!=
0
)
{
if
(
taosInitCfg
(
configDir
,
global
.
envFile
,
global
.
apolloUrl
,
NULL
,
0
)
!=
0
)
{
dError
(
"failed to start TDengine since read config error"
);
return
-
1
;
}
if
(
dmn
.
dumpConfig
)
{
d
mn
DumpCfg
();
if
(
global
.
dumpConfig
)
{
d
nd
DumpCfg
();
taosCleanupCfg
();
taosCloseLog
();
return
0
;
}
return
d
mn
RunDnode
();
return
d
nd
RunDnode
();
}
source/dnode/mgmt/exec/src/dndUtil.c
浏览文件 @
c71ec2b7
...
...
@@ -14,15 +14,15 @@
*/
#define _DEFAULT_SOURCE
#include "d
mnInt
.h"
#include "d
ndExec
.h"
void
d
mn
GenerateGrant
()
{
void
d
nd
GenerateGrant
()
{
#if 0
grantParseParameter();
#endif
}
void
d
mn
PrintVersion
()
{
void
d
nd
PrintVersion
()
{
#ifdef TD_ENTERPRISE
char
*
releaseName
=
"enterprise"
;
#else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录