Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b2cf6b34
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
b2cf6b34
编写于
12月 29, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add support vnodes config
上级
dd4af327
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
197 addition
and
210 deletion
+197
-210
include/common/tglobal.h
include/common/tglobal.h
+31
-40
include/common/tmsg.h
include/common/tmsg.h
+2
-2
include/dnode/mgmt/dnode.h
include/dnode/mgmt/dnode.h
+2
-2
include/os/osEnv.h
include/os/osEnv.h
+0
-1
source/common/src/tglobal.c
source/common/src/tglobal.c
+70
-100
source/dnode/mgmt/daemon/src/daemon.c
source/dnode/mgmt/daemon/src/daemon.c
+1
-1
source/dnode/mgmt/impl/src/dndDnode.c
source/dnode/mgmt/impl/src/dndDnode.c
+2
-2
source/dnode/mgmt/impl/test/dnode/dnode.cpp
source/dnode/mgmt/impl/test/dnode/dnode.cpp
+1
-1
source/dnode/mgmt/impl/test/sut/src/base.cpp
source/dnode/mgmt/impl/test/sut/src/base.cpp
+0
-1
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-2
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+3
-3
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+1
-1
source/util/src/tlog.c
source/util/src/tlog.c
+0
-1
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+1
-0
tests/script/tmp/dnodes.sim
tests/script/tmp/dnodes.sim
+81
-53
未找到文件。
include/common/tglobal.h
浏览文件 @
b2cf6b34
...
...
@@ -30,11 +30,12 @@ extern char tsLocalEp[];
extern
uint16_t
tsServerPort
;
extern
int32_t
tsStatusInterval
;
extern
int8_t
tsEnableTelemetryReporting
;
extern
int32_t
tsNumOfSupportVnodes
;
// common
extern
int
tsRpcTimer
;
extern
int
tsRpcMaxTime
;
extern
int
tsRpcForceTcp
;
// all commands go to tcp protocol if this is enabled
extern
int
tsRpcForceTcp
;
// all commands go to tcp protocol if this is enabled
extern
int32_t
tsMaxConnections
;
extern
int32_t
tsMaxShellConns
;
extern
int32_t
tsShellActivityTimer
;
...
...
@@ -48,14 +49,18 @@ extern int32_t tsCompressMsgSize;
extern
int32_t
tsCompressColData
;
extern
int32_t
tsMaxNumOfDistinctResults
;
extern
char
tsTempDir
[];
extern
int64_t
tsMaxVnodeQueuedBytes
;
extern
int
tsCompatibleModel
;
// 2.0 compatible model
//query buffer management
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer size in MB for each data node during query processing
extern
int64_t
tsQueryBufferSizeBytes
;
// maximum allowed usage buffer size in byte for each data node during query processing
extern
int32_t
tsRetrieveBlockingModel
;
// retrieve threads will be blocked
extern
int8_t
tsKeepOriginalColumnName
;
extern
int
tsCompatibleModel
;
// 2.0 compatible model
extern
int8_t
tsEnableSlaveQuery
;
extern
int8_t
tsEnableAdjustMaster
;
extern
int8_t
tsPrintAuth
;
extern
int64_t
tsTickPerDay
[
3
];
// query buffer management
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer size in MB for each data node during query processing
extern
int64_t
tsQueryBufferSizeBytes
;
// maximum allowed usage buffer size in byte for each data node
extern
int32_t
tsRetrieveBlockingModel
;
// retrieve threads will be blocked
extern
int8_t
tsKeepOriginalColumnName
;
extern
int8_t
tsDeadLockKillQuery
;
// client
extern
int32_t
tsMaxSQLStringLen
;
...
...
@@ -72,27 +77,17 @@ extern float tsStreamComputDelayRatio; // the delayed computing ration of the
extern
int32_t
tsProjectExecInterval
;
extern
int64_t
tsMaxRetentWindow
;
// balance
extern
int8_t
tsEnableSlaveQuery
;
// interna
extern
int8_t
tsPrintAuth
;
extern
char
tsVnodeDir
[];
extern
char
tsMnodeDir
[];
extern
int64_t
tsTickPerDay
[
3
];
// system info
extern
float
tsTotalLogDirGB
;
extern
float
tsTotalTmpDirGB
;
extern
float
tsTotalDataDirGB
;
extern
float
tsAvailLogDirGB
;
extern
float
tsAvailTmpDirectorySpace
;
extern
float
tsAvailDataDirGB
;
extern
float
tsUsedDataDirGB
;
extern
float
tsMinimalLogDirGB
;
extern
float
tsReservedTmpDirectorySpace
;
extern
float
tsMinimalDataDirGB
;
extern
float
tsTotalLogDirGB
;
extern
float
tsTotalTmpDirGB
;
extern
float
tsTotalDataDirGB
;
extern
float
tsAvailLogDirGB
;
extern
float
tsAvailTmpDirectorySpace
;
extern
float
tsAvailDataDirGB
;
extern
float
tsUsedDataDirGB
;
extern
float
tsMinimalLogDirGB
;
extern
float
tsReservedTmpDirectorySpace
;
extern
float
tsMinimalDataDirGB
;
extern
uint32_t
tsVersion
;
// build info
...
...
@@ -102,17 +97,13 @@ extern char gitinfo[];
extern
char
gitinfoOfInternal
[];
extern
char
buildinfo
[];
#ifdef TD_TSZ
// lossy
extern
char
lossyColumns
[];
extern
double
fPrecision
;
extern
double
dPrecision
;
extern
uint32_t
maxRange
;
extern
uint32_t
curRange
;
extern
char
Compressor
[];
#endif
// long query
extern
int8_t
tsDeadLockKillQuery
;
// lossy
extern
char
tsLossyColumns
[];
extern
double
tsFPrecision
;
extern
double
tsDPrecision
;
extern
uint32_t
tsMaxRange
;
extern
uint32_t
tsCurRange
;
extern
char
tsCompressor
[];
typedef
struct
{
char
dir
[
TSDB_FILENAME_LEN
];
...
...
include/common/tmsg.h
浏览文件 @
b2cf6b34
...
...
@@ -651,8 +651,8 @@ typedef struct {
int64_t
clusterId
;
int64_t
rebootTime
;
int64_t
updateTime
;
int
16
_t
numOfCores
;
int
16
_t
numOfSupportVnodes
;
int
32
_t
numOfCores
;
int
32
_t
numOfSupportVnodes
;
char
dnodeEp
[
TSDB_EP_LEN
];
SClusterCfg
clusterCfg
;
SVnodeLoads
vnodeLoads
;
...
...
include/dnode/mgmt/dnode.h
浏览文件 @
b2cf6b34
...
...
@@ -27,8 +27,8 @@ typedef struct SDnode SDnode;
typedef
struct
{
int32_t
sver
;
int
16
_t
numOfCores
;
int
16
_t
numOfSupportVnodes
;
int
32
_t
numOfCores
;
int
32
_t
numOfSupportVnodes
;
int16_t
numOfCommitThreads
;
int8_t
enableTelem
;
int32_t
statusInterval
;
...
...
include/os/osEnv.h
浏览文件 @
b2cf6b34
...
...
@@ -21,7 +21,6 @@ extern "C" {
#endif
extern
char
tsOsName
[];
extern
char
tsDnodeDir
[];
extern
char
tsDataDir
[];
extern
char
tsLogDir
[];
extern
char
tsScriptDir
[];
...
...
source/common/src/tglobal.c
浏览文件 @
b2cf6b34
...
...
@@ -15,17 +15,18 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include "taosdef.h"
#include "taoserror.h"
#include "ulog.h"
#include "tlog.h"
#include "tcompare.h"
#include "tconfig.h"
#include "tep.h"
#include "tglobal.h"
#include "tcompare.h"
#include "tutil.h"
#include "ttimezone.h"
#include "tlocale.h"
#include "tep.h"
#include "tlog.h"
#include "ttimezone.h"
#include "tutil.h"
#include "ulog.h"
// cluster
char
tsFirst
[
TSDB_EP_LEN
]
=
{
0
};
...
...
@@ -36,22 +37,24 @@ uint16_t tsServerPort = 6030;
int32_t
tsStatusInterval
=
1
;
// second
int8_t
tsEnableTelemetryReporting
=
0
;
char
tsEmail
[
TSDB_FQDN_LEN
]
=
{
0
};
int32_t
tsNumOfSupportVnodes
=
16
;
// common
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
int32_t
tsRpcForceTcp
=
1
;
//
disable this, means query, show command use udp protocol as default
int32_t
tsMaxShellConns
=
50000
;
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
int32_t
tsRpcForceTcp
=
1
;
//
disable this, means query, show command use udp protocol as default
int32_t
tsMaxShellConns
=
50000
;
int32_t
tsMaxConnections
=
5000
;
int32_t
tsShellActivityTimer
=
3
;
// second
int32_t
tsShellActivityTimer
=
3
;
// second
float
tsNumOfThreadsPerCore
=
1
.
0
f
;
int32_t
tsNumOfCommitThreads
=
4
;
float
tsRatioOfQueryCores
=
1
.
0
f
;
int8_t
tsDaylight
=
0
;
int8_t
tsDaylight
=
0
;
int8_t
tsEnableCoreFile
=
0
;
int32_t
tsMaxBinaryDisplayWidth
=
30
;
int64_t
tsMaxVnodeQueuedBytes
=
1024
*
1024
*
1024
;
//1GB
int8_t
tsEnableSlaveQuery
=
1
;
int8_t
tsEnableAdjustMaster
=
1
;
int8_t
tsPrintAuth
=
0
;
/*
* denote if the server needs to compress response message at the application layer to client, including query rsp,
* metricmeta rsp, and multi-meter query rsp message body. The client compress the submit message to server.
...
...
@@ -79,7 +82,7 @@ int32_t tsMaxSQLStringLen = TSDB_MAX_ALLOWED_SQL_LEN;
int32_t
tsMaxWildCardsLen
=
TSDB_PATTERN_STRING_DEFAULT_LEN
;
int32_t
tsMaxRegexStringLen
=
TSDB_REGEX_STRING_DEFAULT_LEN
;
int8_t
tsTscEnableRecordSql
=
0
;
int8_t
tsTscEnableRecordSql
=
0
;
// the maximum number of results for projection query on super table that are returned from
// one virtual node, to order according to timestamp
...
...
@@ -89,7 +92,7 @@ int32_t tsMaxNumOfOrderedResults = 100000;
int32_t
tsMinSlidingTime
=
10
;
// the maxinum number of distict query result
int32_t
tsMaxNumOfDistinctResults
=
1000
*
10000
;
int32_t
tsMaxNumOfDistinctResults
=
1000
*
10000
;
// 1 us for interval time range, changed accordingly
int32_t
tsMinIntervalTime
=
1
;
...
...
@@ -101,7 +104,7 @@ int32_t tsMaxStreamComputDelay = 20000;
int32_t
tsStreamCompStartDelay
=
10000
;
// the stream computing delay time after executing failed, change accordingly
int32_t
tsRetryStreamCompDelay
=
10
*
1000
;
int32_t
tsRetryStreamCompDelay
=
10
*
1000
;
// The delayed computing ration. 10% of the whole computing time window by default.
float
tsStreamComputDelayRatio
=
0
.
1
f
;
...
...
@@ -120,30 +123,16 @@ int64_t tsQueryBufferSizeBytes = -1;
int32_t
tsRetrieveBlockingModel
=
0
;
// last_row(*), first(*), last_row(ts, col1, col2) query, the result fields will be the original column name
int8_t
tsKeepOriginalColumnName
=
0
;
int8_t
tsKeepOriginalColumnName
=
0
;
// long query death-lock
int8_t
tsDeadLockKillQuery
=
0
;
// tsdb config
// tsdb config
// For backward compatibility
bool
tsdbForceKeepFile
=
false
;
// balance
int8_t
tsEnableFlowCtrl
=
1
;
int8_t
tsEnableSlaveQuery
=
1
;
int8_t
tsEnableAdjustMaster
=
1
;
// monitor
char
tsMonitorDbName
[
TSDB_DB_NAME_LEN
]
=
"log"
;
char
tsInternalPass
[]
=
"secretkey"
;
// internal
int8_t
tsCompactMnodeWal
=
0
;
int8_t
tsPrintAuth
=
0
;
char
tsVnodeDir
[
PATH_MAX
]
=
{
0
};
char
tsDnodeDir
[
PATH_MAX
]
=
{
0
};
char
tsMnodeDir
[
PATH_MAX
]
=
{
0
};
int32_t
tsDiskCfgNum
=
0
;
int32_t
tsDiskCfgNum
=
0
;
#ifndef _STORAGE
SDiskCfg
tsDiskCfg
[
1
];
...
...
@@ -160,31 +149,28 @@ SDiskCfg tsDiskCfg[TSDB_MAX_DISKS];
int64_t
tsTickPerDay
[]
=
{
86400000L
,
86400000000L
,
86400000000000L
};
// system info
float
tsTotalTmpDirGB
=
0
;
float
tsTotalDataDirGB
=
0
;
float
tsAvailTmpDirectorySpace
=
0
;
float
tsAvailDataDirGB
=
0
;
float
tsUsedDataDirGB
=
0
;
float
tsReservedTmpDirectorySpace
=
1
.
0
f
;
float
tsMinimalDataDirGB
=
2
.
0
f
;
int32_t
tsTotalMemoryMB
=
0
;
float
tsTotalTmpDirGB
=
0
;
float
tsTotalDataDirGB
=
0
;
float
tsAvailTmpDirectorySpace
=
0
;
float
tsAvailDataDirGB
=
0
;
float
tsUsedDataDirGB
=
0
;
float
tsReservedTmpDirectorySpace
=
1
.
0
f
;
float
tsMinimalDataDirGB
=
2
.
0
f
;
int32_t
tsTotalMemoryMB
=
0
;
uint32_t
tsVersion
=
0
;
#ifdef TD_TSZ
//
// lossy compress 6
//
char
lossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty can close lossy compress.
// below option can take effect when tsLossyColumns not empty
double
fPrecision
=
1E-8
;
// float column precision
double
dPrecision
=
1E-16
;
// double
column precision
uint32_t
maxRange
=
500
;
// max range
uint32_t
curRange
=
100
;
//
range
char
Compressor
[
32
]
=
"ZSTD_COMPRESSOR"
;
// ZSTD_COMPRESSOR or GZIP_COMPRESSOR
#endif
char
tsLossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty
// can close lossy compress.
// below option can take effect when tsLossyColumns not empty
double
tsFPrecision
=
1E-8
;
// float
column precision
double
tsDPrecision
=
1E-16
;
// double column precision
uint32_t
tsMaxRange
=
500
;
// max
range
uint32_t
tsCurRange
=
100
;
// range
char
tsCompressor
[
32
]
=
"ZSTD_COMPRESSOR"
;
// ZSTD_COMPRESSOR or GZIP_COMPRESSOR
// long query death-lock
int8_t
tsDeadLockKillQuery
=
0
;
int32_t
(
*
monStartSystemFp
)()
=
NULL
;
void
(
*
monStopSystemFp
)()
=
NULL
;
...
...
@@ -195,13 +181,12 @@ char *qtypeStr[] = {"rpc", "fwd", "wal", "cq", "query"};
static
pthread_once_t
tsInitGlobalCfgOnce
=
PTHREAD_ONCE_INIT
;
void
taosSetAllDebugFlag
()
{
if
(
debugFlag
!=
0
)
{
if
(
debugFlag
!=
0
)
{
mDebugFlag
=
debugFlag
;
dDebugFlag
=
debugFlag
;
vDebugFlag
=
debugFlag
;
jniDebugFlag
=
debugFlag
;
odbcDebugFlag
=
debugFlag
;
qDebugFlag
=
debugFlag
;
qDebugFlag
=
debugFlag
;
rpcDebugFlag
=
debugFlag
;
uDebugFlag
=
debugFlag
;
sDebugFlag
=
debugFlag
;
...
...
@@ -213,12 +198,12 @@ void taosSetAllDebugFlag() {
}
int32_t
taosCfgDynamicOptions
(
char
*
msg
)
{
char
*
option
,
*
value
;
int32_t
olen
,
vlen
;
int32_t
vint
=
0
;
char
*
option
,
*
value
;
int32_t
olen
,
vlen
;
int32_t
vint
=
0
;
paGetToken
(
msg
,
&
option
,
&
olen
);
if
(
olen
==
0
)
return
-
1
;
;
if
(
olen
==
0
)
return
-
1
;
paGetToken
(
option
+
olen
+
1
,
&
value
,
&
vlen
);
if
(
vlen
==
0
)
...
...
@@ -231,9 +216,9 @@ int32_t taosCfgDynamicOptions(char *msg) {
for
(
int32_t
i
=
0
;
i
<
tsGlobalConfigNum
;
++
i
)
{
SGlobalCfg
*
cfg
=
tsGlobalConfig
+
i
;
//if (!(cfg->cfgType & TSDB_CFG_CTYPE_B_LOG)) continue;
//
if (!(cfg->cfgType & TSDB_CFG_CTYPE_B_LOG)) continue;
if
(
cfg
->
valType
!=
TAOS_CFG_VTYPE_INT32
&&
cfg
->
valType
!=
TAOS_CFG_VTYPE_INT8
)
continue
;
int32_t
cfgLen
=
(
int32_t
)
strlen
(
cfg
->
option
);
if
(
cfgLen
!=
olen
)
continue
;
if
(
strncasecmp
(
option
,
cfg
->
option
,
olen
)
!=
0
)
continue
;
...
...
@@ -262,7 +247,7 @@ int32_t taosCfgDynamicOptions(char *msg) {
return
0
;
}
if
(
strncasecmp
(
cfg
->
option
,
"debugFlag"
,
olen
)
==
0
)
{
taosSetAllDebugFlag
();
taosSetAllDebugFlag
();
}
return
0
;
}
...
...
@@ -323,7 +308,7 @@ static void doInitGlobalConfig(void) {
srand
(
taosSafeRand
());
SGlobalCfg
cfg
=
{
0
};
// ip address
cfg
.
option
=
"firstEp"
;
cfg
.
ptr
=
tsFirst
;
...
...
@@ -366,6 +351,16 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
cfg
.
option
=
"supportVnodes"
;
cfg
.
ptr
=
&
tsNumOfSupportVnodes
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
65536
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
// directory
cfg
.
option
=
"configDir"
;
cfg
.
ptr
=
configDir
;
...
...
@@ -442,8 +437,8 @@ static void doInitGlobalConfig(void) {
cfg
.
ptr
=
&
tsMaxNumOfDistinctResults
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
10
*
10000
;
cfg
.
maxValue
=
10000
*
10000
;
cfg
.
minValue
=
10
*
10000
;
cfg
.
maxValue
=
10000
*
10000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
...
...
@@ -749,17 +744,6 @@ static void doInitGlobalConfig(void) {
cfg
.
maxValue
=
10000000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_GB
;
taosAddConfigOption
(
cfg
);
// module configs
cfg
.
option
=
"flowctrl"
;
cfg
.
ptr
=
&
tsEnableFlowCtrl
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT8
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
1
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
cfg
.
option
=
"slaveQuery"
;
...
...
@@ -893,16 +877,6 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
cfg
.
option
=
"odbcDebugFlag"
;
cfg
.
ptr
=
&
odbcDebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
255
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
cfg
.
option
=
"uDebugFlag"
;
cfg
.
ptr
=
&
uDebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
...
...
@@ -1034,7 +1008,7 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
// enable kill long query
// enable kill long query
cfg
.
option
=
"deadLockKillQuery"
;
cfg
.
ptr
=
&
tsDeadLockKillQuery
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT8
;
...
...
@@ -1066,7 +1040,6 @@ static void doInitGlobalConfig(void) {
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosAddConfigOption
(
cfg
);
cfg
.
option
=
"dPrecision"
;
...
...
@@ -1100,23 +1073,20 @@ static void doInitGlobalConfig(void) {
taosAddConfigOption
(
cfg
);
assert
(
tsGlobalConfigNum
==
TSDB_CFG_MAX_NUM
);
#else
//assert(tsGlobalConfigNum == TSDB_CFG_MAX_NUM - 5);
//
assert(tsGlobalConfigNum == TSDB_CFG_MAX_NUM - 5);
#endif
}
void
taosInitGlobalCfg
()
{
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
}
void
taosInitGlobalCfg
()
{
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
}
int32_t
taosCheckAndPrintCfg
()
{
char
fqdn
[
TSDB_FQDN_LEN
];
char
fqdn
[
TSDB_FQDN_LEN
];
uint16_t
port
;
if
(
debugFlag
&
DEBUG_TRACE
||
debugFlag
&
DEBUG_DEBUG
||
debugFlag
&
DEBUG_DUMP
)
{
taosSetAllDebugFlag
();
}
if
(
tsLocalFqdn
[
0
]
==
0
)
{
taosGetFqdn
(
tsLocalFqdn
);
}
...
...
@@ -1143,7 +1113,7 @@ int32_t taosCheckAndPrintCfg() {
if
(
taosDirExist
(
tsTempDir
)
!=
0
)
{
return
-
1
;
}
taosGetSystemInfo
();
tsSetLocale
();
...
...
source/dnode/mgmt/daemon/src/daemon.c
浏览文件 @
b2cf6b34
...
...
@@ -139,7 +139,7 @@ void dmnWaitSignal() {
void
dmnInitOption
(
SDnodeOpt
*
pOption
)
{
pOption
->
sver
=
30000000
;
//3.0.0.0
pOption
->
numOfCores
=
tsNumOfCores
;
pOption
->
numOfSupportVnodes
=
16
;
pOption
->
numOfSupportVnodes
=
tsNumOfSupportVnodes
;
pOption
->
numOfCommitThreads
=
1
;
pOption
->
statusInterval
=
tsStatusInterval
;
pOption
->
numOfThreadsPerCore
=
tsNumOfThreadsPerCore
;
...
...
source/dnode/mgmt/impl/src/dndDnode.c
浏览文件 @
b2cf6b34
...
...
@@ -370,8 +370,8 @@ void dndSendStatusMsg(SDnode *pDnode) {
pStatus
->
clusterId
=
htobe64
(
pMgmt
->
clusterId
);
pStatus
->
rebootTime
=
htobe64
(
pMgmt
->
rebootTime
);
pStatus
->
updateTime
=
htobe64
(
pMgmt
->
updateTime
);
pStatus
->
numOfCores
=
hton
s
(
pDnode
->
opt
.
numOfCores
);
pStatus
->
numOfSupportVnodes
=
hton
s
(
pDnode
->
opt
.
numOfSupportVnodes
);
pStatus
->
numOfCores
=
hton
l
(
pDnode
->
opt
.
numOfCores
);
pStatus
->
numOfSupportVnodes
=
hton
l
(
pDnode
->
opt
.
numOfSupportVnodes
);
tstrncpy
(
pStatus
->
dnodeEp
,
pDnode
->
opt
.
localEp
,
TSDB_EP_LEN
);
pStatus
->
clusterCfg
.
statusInterval
=
htonl
(
pDnode
->
opt
.
statusInterval
);
...
...
source/dnode/mgmt/impl/test/dnode/dnode.cpp
浏览文件 @
b2cf6b34
...
...
@@ -57,7 +57,7 @@ TEST_F(DndTestDnode, 01_ShowDnode) {
CHECK_SCHEMA
(
0
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"id"
);
CHECK_SCHEMA
(
1
,
TSDB_DATA_TYPE_BINARY
,
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
,
"endpoint"
);
CHECK_SCHEMA
(
2
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"vnodes"
);
CHECK_SCHEMA
(
3
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"
max
_vnodes"
);
CHECK_SCHEMA
(
3
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"
support
_vnodes"
);
CHECK_SCHEMA
(
4
,
TSDB_DATA_TYPE_BINARY
,
10
+
VARSTR_HEADER_SIZE
,
"status"
);
CHECK_SCHEMA
(
5
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create_time"
);
CHECK_SCHEMA
(
6
,
TSDB_DATA_TYPE_BINARY
,
24
+
VARSTR_HEADER_SIZE
,
"offline_reason"
);
...
...
source/dnode/mgmt/impl/test/sut/src/base.cpp
浏览文件 @
b2cf6b34
...
...
@@ -24,7 +24,6 @@ void Testbase::InitLog(const char* path) {
tmrDebugFlag
=
0
;
uDebugFlag
=
143
;
rpcDebugFlag
=
0
;
odbcDebugFlag
=
0
;
qDebugFlag
=
0
;
wDebugFlag
=
0
;
sDebugFlag
=
0
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
b2cf6b34
...
...
@@ -125,8 +125,8 @@ typedef struct {
int64_t
lastAccessTime
;
int32_t
accessTimes
;
int16_t
numOfVnodes
;
int
16
_t
numOfSupportVnodes
;
int
16
_t
numOfCores
;
int
32
_t
numOfSupportVnodes
;
int
32
_t
numOfCores
;
EDndStatus
status
;
EDndReason
offlineReason
;
uint16_t
port
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
b2cf6b34
...
...
@@ -278,8 +278,8 @@ static void mndParseStatusMsg(SStatusMsg *pStatus) {
pStatus
->
clusterId
=
htobe64
(
pStatus
->
clusterId
);
pStatus
->
rebootTime
=
htobe64
(
pStatus
->
rebootTime
);
pStatus
->
updateTime
=
htobe64
(
pStatus
->
updateTime
);
pStatus
->
numOfCores
=
hton
s
(
pStatus
->
numOfCores
);
pStatus
->
numOfSupportVnodes
=
hton
s
(
pStatus
->
numOfSupportVnodes
);
pStatus
->
numOfCores
=
hton
l
(
pStatus
->
numOfCores
);
pStatus
->
numOfSupportVnodes
=
hton
l
(
pStatus
->
numOfSupportVnodes
);
pStatus
->
clusterCfg
.
statusInterval
=
htonl
(
pStatus
->
clusterCfg
.
statusInterval
);
pStatus
->
clusterCfg
.
checkTime
=
htobe64
(
pStatus
->
clusterCfg
.
checkTime
);
}
...
...
@@ -638,7 +638,7 @@ static int32_t mndGetDnodeMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
strcpy
(
pSchema
[
cols
].
name
,
"
max
_vnodes"
);
strcpy
(
pSchema
[
cols
].
name
,
"
support
_vnodes"
);
pSchema
[
cols
].
bytes
=
htonl
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
b2cf6b34
...
...
@@ -265,7 +265,7 @@ static SArray *mndBuildDnodesArray(SMnode *pMnode) {
taosArrayPush
(
pArray
,
pDnode
);
}
mDebug
(
"dnode:%d,
numOfVnodes:%d numOfS
upportVnodes:%d isMnode:%d ready:%d"
,
pDnode
->
id
,
numOfVnodes
,
mDebug
(
"dnode:%d,
vnodes:%d s
upportVnodes:%d isMnode:%d ready:%d"
,
pDnode
->
id
,
numOfVnodes
,
pDnode
->
numOfSupportVnodes
,
isMnode
,
isReady
);
sdbRelease
(
pSdb
,
pDnode
);
}
...
...
source/util/src/tlog.c
浏览文件 @
b2cf6b34
...
...
@@ -85,7 +85,6 @@ int32_t dDebugFlag = 135;
int32_t
vDebugFlag
=
135
;
int32_t
cDebugFlag
=
131
;
int32_t
jniDebugFlag
=
131
;
int32_t
odbcDebugFlag
=
131
;
int32_t
qDebugFlag
=
131
;
int32_t
rpcDebugFlag
=
131
;
int32_t
uDebugFlag
=
131
;
...
...
tests/script/sh/deploy.sh
浏览文件 @
b2cf6b34
...
...
@@ -120,6 +120,7 @@ echo "firstEp ${HOSTNAME}:7100" >> $TAOS_CFG
echo
"secondEp
${
HOSTNAME
}
:7200"
>>
$TAOS_CFG
echo
"fqdn
${
HOSTNAME
}
"
>>
$TAOS_CFG
echo
"serverPort
${
NODE
}
"
>>
$TAOS_CFG
echo
"supportVnodes 16"
>>
$TAOS_CFG
echo
"dataDir
$DATA_DIR
"
>>
$TAOS_CFG
echo
"logDir
$LOG_DIR
"
>>
$TAOS_CFG
echo
"debugFlag 0"
>>
$TAOS_CFG
...
...
tests/script/tmp/dnodes.sim
浏览文件 @
b2cf6b34
system sh/stop_dnodes.sh
############## config parameter #####################
$node1 =
192.168.0.201
$node1 =
192.168.101.12
$node2 = 192.168.0.202
$node3 = 192.168.0.203
$node4 = 192.168.0.204
$self = $node1
$num =
2
5
$num = 5
############### deploy firstEp #####################
#deploy = 0, start = 1, stop = 2
$option = 0
print =============== option:$option
############### stop dnodes #####################
if $option == 0 then
system sh/stop_dnodes.sh
endi
############### process firstEp #####################
$firstEp = $node1 . :7100
$firstPort = 7100
if $self == $node1 then
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c firstEp -v $firstEp
system sh/cfg.sh -n dnode1 -c secondEp -v $firstEp
system sh/cfg.sh -n dnode1 -c fqdn -v $node1
system sh/cfg.sh -n dnode1 -c serverPort -v $firstPort
system sh/exec.sh -n dnode1 -s start
sql connect
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node1 port $port
endw
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node2 port $port
endw
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node3 port $port
endw
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node4 port $port
endw
if $option == 1 then
system sh/exec.sh -n dnode1 -s start
endi
if $option == 2 then
system sh/exec.sh -n dnode1 -s stop -x SIGINT
endi
if $option == 0 then
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c firstEp -v $firstEp
system sh/cfg.sh -n dnode1 -c secondEp -v $firstEp
system sh/cfg.sh -n dnode1 -c fqdn -v $node1
system sh/cfg.sh -n dnode1 -c serverPort -v $firstPort
system sh/cfg.sh -n dnode1 -c supportVnodes -v 0
system sh/exec.sh -n dnode1 -s start
sql connect
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node1 port $port
endw
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node2 port $port
endw
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node3 port $port
endw
$i = 0
while $i < $num
$port = $i * 100
$port = $port + 8100
$i = $i + 1
sql create dnode $node4 port $port
endw
endi
endi
###############
deploy nodes
#####################
###############
process nodes
#####################
$i = 0
while $i < $num
...
...
@@ -67,11 +85,21 @@ while $i < $num
$dnodename = dnode . $index
$i = $i + 1
system sh/deploy.sh -n $dnodename -i 1
system sh/cfg.sh -n $dnodename -c firstEp -v $firstEp
system sh/cfg.sh -n $dnodename -c secondEp -v $firstEp
system sh/cfg.sh -n $dnodename -c fqdn -v $self
system sh/cfg.sh -n $dnodename -c serverPort -v $port
if $option == 1 then
system sh/exec.sh -n $dnodename -s start
endi
if $option == 2 then
system sh/exec.sh -n $dnodename -s stop -x SIGINT
endi
if $option == 0 then
system sh/deploy.sh -n $dnodename -i 1
system sh/cfg.sh -n $dnodename -c firstEp -v $firstEp
system sh/cfg.sh -n $dnodename -c secondEp -v $firstEp
system sh/cfg.sh -n $dnodename -c fqdn -v $self
system sh/cfg.sh -n $dnodename -c serverPort -v $port
system sh/exec.sh -n $dnodename -s start
system sh/exec.sh -n $dnodename -s start
endi
endw
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录