Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
af5549d3
I
Iotdb
项目概览
apache
/
Iotdb
11 个月 前同步成功
通知
25
Star
3344
Fork
916
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iotdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
af5549d3
编写于
8月 11, 2022
作者:
任
任宇华
提交者:
GitHub
8月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[IOTDB-3966] [IOTDB-4079]Show leadership when show Regions && fix region id duplicated (#6939)
上级
f1787b83
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
300 addition
and
218 deletion
+300
-218
confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
...va/org/apache/iotdb/confignode/manager/ConfigManager.java
+20
-2
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
...org/apache/iotdb/confignode/manager/load/LoadManager.java
+23
-5
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java
...iotdb/confignode/manager/load/balancer/RouteBalancer.java
+4
-0
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/LazyGreedyRouter.java
...ignode/manager/load/balancer/router/LazyGreedyRouter.java
+4
-0
confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
...iotdb/confignode/persistence/partition/PartitionInfo.java
+4
-3
confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
...ode/persistence/partition/StorageGroupPartitionTable.java
+12
-12
confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
...fignode/service/thrift/ConfigNodeRPCServiceProcessor.java
+1
-2
docs/UserGuide/Maintenance-Tools/Maintenance-Command.md
docs/UserGuide/Maintenance-Tools/Maintenance-Command.md
+96
-96
docs/zh/UserGuide/Maintenance-Tools/Maintenance-Command.md
docs/zh/UserGuide/Maintenance-Tools/Maintenance-Command.md
+94
-97
node-commons/src/main/java/org/apache/iotdb/commons/cluster/RegionRoleType.java
...java/org/apache/iotdb/commons/cluster/RegionRoleType.java
+37
-0
server/src/main/java/org/apache/iotdb/db/mpp/common/header/HeaderConstant.java
...org/apache/iotdb/db/mpp/common/header/HeaderConstant.java
+3
-1
server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/metadata/ShowRegionTask.java
...db/mpp/plan/execution/config/metadata/ShowRegionTask.java
+1
-0
thrift-confignode/src/main/thrift/confignode.thrift
thrift-confignode/src/main/thrift/confignode.thrift
+1
-0
未找到文件。
confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
浏览文件 @
af5549d3
...
...
@@ -20,12 +20,14 @@
package
org.apache.iotdb.confignode.manager
;
import
org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation
;
import
org.apache.iotdb.common.rpc.thrift.TConsensusGroupId
;
import
org.apache.iotdb.common.rpc.thrift.TConsensusGroupType
;
import
org.apache.iotdb.common.rpc.thrift.TDataNodeConfiguration
;
import
org.apache.iotdb.common.rpc.thrift.TDataNodeLocation
;
import
org.apache.iotdb.common.rpc.thrift.TFlushReq
;
import
org.apache.iotdb.common.rpc.thrift.TSStatus
;
import
org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot
;
import
org.apache.iotdb.commons.cluster.RegionRoleType
;
import
org.apache.iotdb.commons.conf.CommonDescriptor
;
import
org.apache.iotdb.commons.conf.IoTDBConstant
;
import
org.apache.iotdb.commons.exception.IllegalPathException
;
...
...
@@ -849,10 +851,26 @@ public class ConfigManager implements IManager {
}
@Override
public
DataSet
showRegion
(
GetRegionInfoListPlan
getRegionInfoListPlan
)
{
public
RegionInfoListResp
showRegion
(
GetRegionInfoListPlan
getRegionInfoListPlan
)
{
TSStatus
status
=
confirmLeader
();
if
(
status
.
getCode
()
==
TSStatusCode
.
SUCCESS_STATUS
.
getStatusCode
())
{
return
partitionManager
.
getRegionInfoList
(
getRegionInfoListPlan
);
RegionInfoListResp
regionInfoListResp
=
(
RegionInfoListResp
)
partitionManager
.
getRegionInfoList
(
getRegionInfoListPlan
);
regionInfoListResp
.
getRegionInfoList
()
.
forEach
(
regionInfo
->
{
Map
<
TConsensusGroupId
,
Integer
>
allLeadership
=
loadManager
.
getAllLeadership
();
if
(!
allLeadership
.
isEmpty
())
{
String
regionType
=
regionInfo
.
getDataNodeId
()
==
allLeadership
.
get
(
regionInfo
.
getConsensusGroupId
())
?
RegionRoleType
.
Leader
.
toString
()
:
RegionRoleType
.
Follower
.
toString
();
regionInfo
.
setRoleType
(
regionType
);
}
});
return
regionInfoListResp
;
}
else
{
RegionInfoListResp
regionResp
=
new
RegionInfoListResp
();
regionResp
.
setStatus
(
status
);
...
...
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
浏览文件 @
af5549d3
...
...
@@ -217,11 +217,29 @@ public class LoadManager {
*/
public
Map
<
TConsensusGroupId
,
Integer
>
getAllLeadership
()
{
Map
<
TConsensusGroupId
,
Integer
>
result
=
new
ConcurrentHashMap
<>();
if
(
ConfigNodeDescriptor
.
getInstance
()
.
getConf
()
.
getDataRegionConsensusProtocolClass
()
.
equals
(
ConsensusFactory
.
MultiLeaderConsensus
))
{
regionGroupCacheMap
.
forEach
(
(
consensusGroupId
,
regionGroupCache
)
->
{
if
(
consensusGroupId
.
getType
().
equals
(
TConsensusGroupType
.
SchemaRegion
))
{
result
.
put
(
consensusGroupId
,
regionGroupCache
.
getLeaderDataNodeId
());
}
});
routeBalancer
.
getRouteMap
()
.
forEach
(
(
consensusGroupId
,
regionReplicaSet
)
->
{
result
.
put
(
consensusGroupId
,
regionReplicaSet
.
getDataNodeLocations
().
get
(
0
).
getDataNodeId
());
});
}
else
{
regionGroupCacheMap
.
forEach
(
(
consensusGroupId
,
regionGroupCache
)
->
result
.
put
(
consensusGroupId
,
regionGroupCache
.
getLeaderDataNodeId
()));
}
return
result
;
}
...
...
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java
浏览文件 @
af5549d3
...
...
@@ -109,4 +109,8 @@ public class RouteBalancer {
private
LoadManager
getLoadManager
()
{
return
configManager
.
getLoadManager
();
}
public
Map
<
TConsensusGroupId
,
TRegionReplicaSet
>
getRouteMap
()
{
return
lazyGreedyRouter
.
getRouteMap
();
}
}
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/LazyGreedyRouter.java
浏览文件 @
af5549d3
...
...
@@ -151,4 +151,8 @@ public class LazyGreedyRouter implements IRouter {
(
dataNodeId
,
counter
)
->
(
counter
==
null
?
1
:
counter
+
1
));
routeMap
.
put
(
newRouteEntry
.
getRegionId
(),
newRouteEntry
);
}
public
Map
<
TConsensusGroupId
,
TRegionReplicaSet
>
getRouteMap
()
{
return
routeMap
;
}
}
confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
浏览文件 @
af5549d3
...
...
@@ -104,7 +104,7 @@ public class PartitionInfo implements SnapshotProcessor {
public
PartitionInfo
()
{
this
.
storageGroupPartitionTables
=
new
ConcurrentHashMap
<>();
this
.
nextRegionGroupId
=
new
AtomicInteger
(
0
);
this
.
nextRegionGroupId
=
new
AtomicInteger
(
-
1
);
// Ensure that the PartitionTables of the StorageGroups who've been logically deleted
// are unreadable and un-writable
...
...
@@ -149,7 +149,7 @@ public class PartitionInfo implements SnapshotProcessor {
}
public
int
generateNextRegionGroupId
()
{
return
nextRegionGroupId
.
getAndIncremen
t
();
return
nextRegionGroupId
.
incrementAndGe
t
();
}
// ======================================================
...
...
@@ -427,6 +427,7 @@ public class PartitionInfo implements SnapshotProcessor {
List
<
TRegionInfo
>
regionInfoList
=
new
ArrayList
<>();
if
(
storageGroupPartitionTables
.
isEmpty
())
{
regionResp
.
setStatus
(
RpcUtils
.
getStatus
(
TSStatusCode
.
SUCCESS_STATUS
));
regionResp
.
setRegionInfoList
(
new
ArrayList
<>());
return
regionResp
;
}
TShowRegionReq
showRegionReq
=
regionsInfoPlan
.
getShowRegionReq
();
...
...
@@ -753,7 +754,7 @@ public class PartitionInfo implements SnapshotProcessor {
}
public
void
clear
()
{
nextRegionGroupId
.
set
(
0
);
nextRegionGroupId
.
set
(
-
1
);
storageGroupPartitionTables
.
clear
();
deletedRegionSet
.
clear
();
}
...
...
confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
浏览文件 @
af5549d3
...
...
@@ -354,22 +354,22 @@ public class StorageGroupPartitionTable {
.
getDataNodeLocations
()
.
forEach
(
(
dataNodeLocation
)
->
{
TRegionInfo
tRegionInfoList
=
new
TRegionInfo
();
tRegionInfoList
.
setConsensusGroupId
(
replicaSet
.
getRegionId
());
tRegionInfoList
.
setStorageGroup
(
storageGroupName
);
TRegionInfo
regionInfo
=
new
TRegionInfo
();
regionInfo
.
setConsensusGroupId
(
replicaSet
.
getRegionId
());
regionInfo
.
setStorageGroup
(
storageGroupName
);
if
(
replicaSet
.
getRegionId
().
getType
()
==
TConsensusGroupType
.
DataRegion
)
{
tRegionInfoList
.
setSeriesSlots
(
dataPartitionTable
.
getDataPartitionMap
().
size
());
tRegionInfoList
.
setTimeSlots
(
regionGroup
.
getCounter
());
regionInfo
.
setSeriesSlots
(
dataPartitionTable
.
getDataPartitionMap
().
size
());
regionInfo
.
setTimeSlots
(
regionGroup
.
getCounter
());
}
else
if
(
replicaSet
.
getRegionId
().
getType
()
==
TConsensusGroupType
.
SchemaRegion
)
{
tRegionInfoList
.
setSeriesSlots
(
regionGroup
.
getCounter
());
tRegionInfoList
.
setTimeSlots
(
0
);
regionInfo
.
setSeriesSlots
(
regionGroup
.
getCounter
());
regionInfo
.
setTimeSlots
(
0
);
}
tRegionInfoList
.
setDataNodeId
(
dataNodeLocation
.
getDataNodeId
());
tRegionInfoList
.
setClientRpcIp
(
dataNodeLocation
.
getClientRpcEndPoint
().
getIp
());
tRegionInfoList
.
setClientRpcPort
(
dataNodeLocation
.
getClientRpcEndPoint
().
getPort
());
regionInfo
.
setDataNodeId
(
dataNodeLocation
.
getDataNodeId
());
regionInfo
.
setClientRpcIp
(
dataNodeLocation
.
getClientRpcEndPoint
().
getIp
());
regionInfo
.
setClientRpcPort
(
dataNodeLocation
.
getClientRpcEndPoint
().
getPort
());
// TODO: Wait for data migration. And then add the state
tRegionInfoList
.
setStatus
(
RegionStatus
.
Up
.
getStatus
());
regionInfoList
.
add
(
tRegionInfoList
);
regionInfo
.
setStatus
(
RegionStatus
.
Up
.
getStatus
());
regionInfoList
.
add
(
regionInfo
);
});
}
...
...
confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
浏览文件 @
af5549d3
...
...
@@ -534,8 +534,7 @@ public class ConfigNodeRPCServiceProcessor implements IConfigNodeRPCService.Ifac
@Override
public
TShowRegionResp
showRegion
(
TShowRegionReq
showRegionReq
)
throws
TException
{
GetRegionInfoListPlan
getRegionInfoListPlan
=
new
GetRegionInfoListPlan
(
showRegionReq
);
RegionInfoListResp
dataSet
=
(
RegionInfoListResp
)
configManager
.
showRegion
(
getRegionInfoListPlan
);
RegionInfoListResp
dataSet
=
configManager
.
showRegion
(
getRegionInfoListPlan
);
TShowRegionResp
showRegionResp
=
new
TShowRegionResp
();
showRegionResp
.
setStatus
(
dataSet
.
getStatus
());
showRegionResp
.
setRegionInfoList
(
dataSet
.
getRegionInfoList
());
...
...
docs/UserGuide/Maintenance-Tools/Maintenance-Command.md
浏览文件 @
af5549d3
...
...
@@ -142,112 +142,112 @@ Currently, IoTDB supports Region query using the following SQL:
-
`SHOW DATA REGIONS`
: Show all DataRegion distribution
-
`SHOW (DATA|SCHEMA)? REGIONS OF STORAGE GROUP <sg1,sg2,...>`
: Show region distribution of specified storage groups
```
sql
First, let's take a look at the distribution of Regions under three copies:
```
IoTDB> create timeseries root.sg.d1.s1 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
IoTDB> create timeseries root.sg.d2.s1 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
IoTDB> create timeseries root.ln.d1.s1 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
| 0|SchemaRegion| Up| root.sg| 2| 0| 5|127.0.0.1|6671|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 4|127.0.0.1|6669|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 3|127.0.0.1|6667| Leader|
| 1|SchemaRegion| Up| root.ln| 1| 0| 5|127.0.0.1|6671|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 4|127.0.0.1|6669|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 3|127.0.0.1|6667| Leader|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 6
It costs 0.032s
```
Then take a look at the distribution of Regions under a single copy:
```
sql
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
3
|
127
.
0
.
0
.
1
|
6671
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
Role
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
5
|
127
.
0
.
0
.
1
|
6671
|
Leader
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
Leader
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
Total
line
number
=
2
It
costs
0
.
035
s
It
costs
0
.
128
s
```
Show the distribution information of Schema Region and Data Region:
```
IoTDB> insert into root.sg.d1(timestamp,s1) values(1,true)
Msg: The statement is executed successfully.
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
3
|
127
.
0
.
0
.
1
|
6671
|
|
1
|
DataRegion
|
Up
|
root
.
sg
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6669
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
Total
line
number
=
3
It
costs
0
.
010
s
IoTDB> insert into root.ln.d1(timestamp,s1) values(1,true)
Msg: The statement is executed successfully.
IoTDB> show data regions
+
--------+----------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+----------+------+-------------+------------+----------+----------+---------+----+
|
1
|
DataRegion
|
Up
|
root
.
sg
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6669
|
|
2
|
DataRegion
|
Up
|
root
.
ln
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6669
|
+
--------+----------+------+-------------+------------+----------+----------+---------+----+
+--------+----------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+----------+------+-------------+------------+----------+----------+---------+----+--------+
| 2|DataRegion| Up| root.sg| 1| 1| 5|127.0.0.1|6671|Follower|
| 2|DataRegion| Up| root.sg| 1| 1| 4|127.0.0.1|6669| Leader|
| 2|DataRegion| Up| root.sg| 1| 1| 3|127.0.0.1|6667|Follower|
| 3|DataRegion| Up| root.ln| 1| 1| 5|127.0.0.1|6671| Leader|
| 3|DataRegion| Up| root.ln| 1| 1| 4|127.0.0.1|6669|Follower|
| 3|DataRegion| Up| root.ln| 1| 1| 3|127.0.0.1|6667|Follower|
+--------+----------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 2
It costs 0.011s
IoTDB> show schema regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
3
|
127
.
0
.
0
.
1
|
6671
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
| 0|SchemaRegion| Up| root.sg| 2| 0| 5|127.0.0.1|6671|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 4|127.0.0.1|6669| Leader|
| 0|SchemaRegion| Up| root.sg| 2| 0| 3|127.0.0.1|6667|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 5|127.0.0.1|6671|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 4|127.0.0.1|6669|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 3|127.0.0.1|6667| Leader|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 2
It costs 0.012s
```
IoTDB
>
show
regions
of
storage
group
root
.
sg1
show
regions
of
storage
group
root
.
sg1
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
10
|
SchemaRegion
|
Up
|
root
.
sg1
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
|
11
|
DataRegion
|
Up
|
root
.
sg1
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
Total
line
number
=
2
It
costs
0
.
005
s
Show region distribution of specified storage groups
IoTDB
>
show
regions
of
storage
group
root
.
sg1
,
root
.
sg2
show
regions
of
storage
group
root
.
sg1
,
root
.
sg2
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
10
|
SchemaRegion
|
Up
|
root
.
sg1
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
|
11
|
DataRegion
|
Up
|
root
.
sg1
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
|
12
|
SchemaRegion
|
Up
|
root
.
sg2
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
|
13
|
DataRegion
|
Up
|
root
.
sg2
|
1
|
1
|
4
|
127
.
0
.
0
.
1
|
6669
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
Total
line
number
=
4
```
IoTDB> show regions of storage group root.sg
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
| 0|SchemaRegion| Up| root.sg| 2| 0| 5|127.0.0.1|6671|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 4|127.0.0.1|6669| Leader|
| 0|SchemaRegion| Up| root.sg| 2| 0| 3|127.0.0.1|6667|Follower|
| 2| DataRegion| Up| root.sg| 1| 1| 5|127.0.0.1|6671|Follower|
| 2| DataRegion| Up| root.sg| 1| 1| 4|127.0.0.1|6669| Leader|
| 2| DataRegion| Up| root.sg| 1| 1| 3|127.0.0.1|6667|Follower|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 2
It costs 0.005s
IoTDB
>
show
regions
of
storage
group
root
.
*
.
sg_2
show
regions
of
storage
group
root
.
*
.
sg_2
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
14
|
SchemaRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
0
|
3
|
127
.
0
.
0
.
1
|
6667
|
|
15
|
DataRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
Total
line
number
=
2
It
costs
0
.
004
s
IoTDB
>
show
data
regions
of
storage
group
root
.
*
.
sg_2
show
data
regions
of
storage
group
root
.
*
.
sg_2
+
--------+----------+------+--------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+----------+------+--------------+------------+----------+----------+---------+----+
|
15
|
DataRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+----------+------+--------------+------------+----------+----------+---------+----+
Total
line
number
=
1
It
costs
0
.
004
s
IoTDB
>
show
schema
regions
of
storage
group
root
.
*
.
sg_2
show
schema
regions
of
storage
group
root
.
*
.
sg_2
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
14
|
SchemaRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
0
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
Total
line
number
=
1
It
costs
0
.
102
s
IoTDB> create timeseries root.sgcc.wf01.d1.wt01 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
IoTDB> show regions of storage group root.*.wf01
+--------+------------+------+--------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status| storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+--------------+------------+----------+----------+---------+----+--------+
| 4|SchemaRegion| Up|root.sgcc.wf01| 1| 0| 5|127.0.0.1|6671| Leader|
| 4|SchemaRegion| Up|root.sgcc.wf01| 1| 0| 4|127.0.0.1|6669|Follower|
| 4|SchemaRegion| Up|root.sgcc.wf01| 1| 0| 3|127.0.0.1|6667|Follower|
+--------+------------+------+--------------+------------+----------+----------+---------+----+--------+
Total line number = 3
It costs 0.012s
```
## Monitoring tool for cluster Node distribution
### Show all DataNode information
...
...
@@ -268,12 +268,12 @@ Msg: The statement is executed successfully.
IoTDB
>
create
timeseries
root
.
ln
.
d1
.
s1
with
datatype
=
BOOLEAN
,
encoding
=
PLAIN
Msg
:
The
statement
is
executed
successfully
.
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
Role
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
Leader
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
Leader
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
Total
line
number
=
2
It
costs
0
.
013
s
...
...
@@ -290,13 +290,13 @@ It costs 0.007s
IoTDB
>
insert
into
root
.
ln
.
d1
(
timestamp
,
s1
)
values
(
1
,
true
)
Msg
:
The
statement
is
executed
successfully
.
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
|
2
|
DataRegion
|
Up
|
root
.
ln
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
Role
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
Leader
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
Leader
|
|
2
|
DataRegion
|
Up
|
root
.
ln
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6667
|
Leader
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
Total
line
number
=
3
It
costs
0
.
008
s
IoTDB
>
show
datanodes
...
...
docs/zh/UserGuide/Maintenance-Tools/Maintenance-Command.md
浏览文件 @
af5549d3
...
...
@@ -135,116 +135,113 @@ KILL QUERY <queryId>
-
`SHOW REGIONS`
: 展示所有 Region
-
`SHOW SCHEMA REGIONS`
: 展示所有 SchemaRegion 分布
-
`SHOW DATA REGIONS`
: 展示所有 DataRegion 分布
-
`SHOW (DATA|SCHEMA)? REGIONS OF STORAGE GROUP <sg1,sg2,...>`
: 展示指定的存储组
<sg1
,
sg2
,...
>
对应的Region分布
-
`SHOW (DATA|SCHEMA)? REGIONS OF STORAGE GROUP <sg1,sg2,...>`
: 展示指定的存储组
<sg1
,
sg2
,...
>
对应的Region分布
。
首先来看一下三副本下Region的分布情况:
```
sql
```
IoTDB> create timeseries root.sg.d1.s1 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
IoTDB> create timeseries root.sg.d2.s1 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
IoTDB> create timeseries root.ln.d1.s1 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
| 0|SchemaRegion| Up| root.sg| 2| 0| 5|127.0.0.1|6671|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 4|127.0.0.1|6669|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 3|127.0.0.1|6667| Leader|
| 1|SchemaRegion| Up| root.ln| 1| 0| 5|127.0.0.1|6671|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 4|127.0.0.1|6669|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 3|127.0.0.1|6667| Leader|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 6
It costs 0.032s
```
然后再来看一下单副本下Region的分布情况:
```
sql
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
3
|
127
.
0
.
0
.
1
|
6671
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
Role
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
5
|
127
.
0
.
0
.
1
|
6671
|
Leader
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
Leader
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
Total
line
number
=
2
It
costs
0
.
035
s
It
costs
0
.
128
s
```
查看Schema Region和Data Region的分布信息:
```
IoTDB> insert into root.sg.d1(timestamp,s1) values(1,true)
Msg: The statement is executed successfully.
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
3
|
127
.
0
.
0
.
1
|
6671
|
|
1
|
DataRegion
|
Up
|
root
.
sg
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6669
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
Total
line
number
=
3
It
costs
0
.
010
s
IoTDB> insert into root.ln.d1(timestamp,s1) values(1,true)
Msg: The statement is executed successfully.
IoTDB> show data regions
+
--------+----------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+----------+------+-------------+------------+----------+----------+---------+----+
|
1
|
DataRegion
|
Up
|
root
.
sg
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6669
|
|
2
|
DataRegion
|
Up
|
root
.
ln
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6669
|
+
--------+----------+------+-------------+------------+----------+----------+---------+----+
+--------+----------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+----------+------+-------------+------------+----------+----------+---------+----+--------+
| 2|DataRegion| Up| root.sg| 1| 1| 5|127.0.0.1|6671|Follower|
| 2|DataRegion| Up| root.sg| 1| 1| 4|127.0.0.1|6669| Leader|
| 2|DataRegion| Up| root.sg| 1| 1| 3|127.0.0.1|6667|Follower|
| 3|DataRegion| Up| root.ln| 1| 1| 5|127.0.0.1|6671| Leader|
| 3|DataRegion| Up| root.ln| 1| 1| 4|127.0.0.1|6669|Follower|
| 3|DataRegion| Up| root.ln| 1| 1| 3|127.0.0.1|6667|Follower|
+--------+----------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 2
It costs 0.011s
IoTDB> show schema regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
3
|
127
.
0
.
0
.
1
|
6671
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
| 0|SchemaRegion| Up| root.sg| 2| 0| 5|127.0.0.1|6671|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 4|127.0.0.1|6669| Leader|
| 0|SchemaRegion| Up| root.sg| 2| 0| 3|127.0.0.1|6667|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 5|127.0.0.1|6671|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 4|127.0.0.1|6669|Follower|
| 1|SchemaRegion| Up| root.ln| 1| 0| 3|127.0.0.1|6667| Leader|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 2
It costs 0.012s
```
IoTDB
>
show
regions
of
storage
group
root
.
sg1
show
regions
of
storage
group
root
.
sg1
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
10
|
SchemaRegion
|
Up
|
root
.
sg1
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
|
11
|
DataRegion
|
Up
|
root
.
sg1
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
Total
line
number
=
2
It
costs
0
.
005
s
展示指定的存储组
<sg1
,
sg2
,...
>
对应的Region分布:
IoTDB
>
show
regions
of
storage
group
root
.
sg1
,
root
.
sg2
show
regions
of
storage
group
root
.
sg1
,
root
.
sg2
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
10
|
SchemaRegion
|
Up
|
root
.
sg1
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
|
11
|
DataRegion
|
Up
|
root
.
sg1
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
|
12
|
SchemaRegion
|
Up
|
root
.
sg2
|
1
|
0
|
4
|
127
.
0
.
0
.
1
|
6669
|
|
13
|
DataRegion
|
Up
|
root
.
sg2
|
1
|
1
|
4
|
127
.
0
.
0
.
1
|
6669
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
Total
line
number
=
4
```
IoTDB> show regions of storage group root.sg
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status|storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
| 0|SchemaRegion| Up| root.sg| 2| 0| 5|127.0.0.1|6671|Follower|
| 0|SchemaRegion| Up| root.sg| 2| 0| 4|127.0.0.1|6669| Leader|
| 0|SchemaRegion| Up| root.sg| 2| 0| 3|127.0.0.1|6667|Follower|
| 2| DataRegion| Up| root.sg| 1| 1| 5|127.0.0.1|6671|Follower|
| 2| DataRegion| Up| root.sg| 1| 1| 4|127.0.0.1|6669| Leader|
| 2| DataRegion| Up| root.sg| 1| 1| 3|127.0.0.1|6667|Follower|
+--------+------------+------+-------------+------------+----------+----------+---------+----+--------+
Total line number = 2
It costs 0.005s
IoTDB
>
show
regions
of
storage
group
root
.
*
.
sg_2
show
regions
of
storage
group
root
.
*
.
sg_2
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
14
|
SchemaRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
0
|
3
|
127
.
0
.
0
.
1
|
6667
|
|
15
|
DataRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
Total
line
number
=
2
It
costs
0
.
004
s
IoTDB
>
show
data
regions
of
storage
group
root
.
*
.
sg_2
show
data
regions
of
storage
group
root
.
*
.
sg_2
+
--------+----------+------+--------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+----------+------+--------------+------------+----------+----------+---------+----+
|
15
|
DataRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
1
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+----------+------+--------------+------------+----------+----------+---------+----+
Total
line
number
=
1
It
costs
0
.
004
s
IoTDB
>
show
schema
regions
of
storage
group
root
.
*
.
sg_2
show
schema
regions
of
storage
group
root
.
*
.
sg_2
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
|
14
|
SchemaRegion
|
Up
|
root
.
sg_1
.
sg_2
|
1
|
0
|
5
|
127
.
0
.
0
.
1
|
6671
|
+
--------+------------+------+--------------+------------+----------+----------+---------+----+
Total
line
number
=
1
It
costs
0
.
102
s
IoTDB> create timeseries root.sgcc.wf01.d1.wt01 with datatype=BOOLEAN,encoding=PLAIN
Msg: The statement is executed successfully.
IoTDB> show regions of storage group root.*.wf01
+--------+------------+------+--------------+------------+----------+----------+---------+----+--------+
|RegionId| Type|Status| storage group|Series Slots|Time Slots|DataNodeId| Host|Port| Role|
+--------+------------+------+--------------+------------+----------+----------+---------+----+--------+
| 4|SchemaRegion| Up|root.sgcc.wf01| 1| 0| 5|127.0.0.1|6671| Leader|
| 4|SchemaRegion| Up|root.sgcc.wf01| 1| 0| 4|127.0.0.1|6669|Follower|
| 4|SchemaRegion| Up|root.sgcc.wf01| 1| 0| 3|127.0.0.1|6667|Follower|
+--------+------------+------+--------------+------------+----------+----------+---------+----+--------+
Total line number = 3
It costs 0.012s
```
## 集群节点分布式监控工具
### 查看DataNode节点信息
...
...
@@ -265,12 +262,12 @@ Msg: The statement is executed successfully.
IoTDB
>
create
timeseries
root
.
ln
.
d1
.
s1
with
datatype
=
BOOLEAN
,
encoding
=
PLAIN
Msg
:
The
statement
is
executed
successfully
.
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
Role
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
Leader
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
Leader
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
Total
line
number
=
2
It
costs
0
.
013
s
...
...
@@ -287,13 +284,13 @@ It costs 0.007s
IoTDB
>
insert
into
root
.
ln
.
d1
(
timestamp
,
s1
)
values
(
1
,
true
)
Msg
:
The
statement
is
executed
successfully
.
IoTDB
>
show
regions
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
|
2
|
DataRegion
|
Up
|
root
.
ln
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6667
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
RegionId
|
Type
|
Status
|
storage
group
|
Series
Slots
|
Time
Slots
|
DataNodeId
|
Host
|
Port
|
Role
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
|
0
|
SchemaRegion
|
Up
|
root
.
sg
|
2
|
0
|
1
|
127
.
0
.
0
.
1
|
6667
|
Leader
|
|
1
|
SchemaRegion
|
Up
|
root
.
ln
|
1
|
0
|
2
|
127
.
0
.
0
.
1
|
6668
|
Leader
|
|
2
|
DataRegion
|
Up
|
root
.
ln
|
1
|
1
|
1
|
127
.
0
.
0
.
1
|
6667
|
Leader
|
+
--------+------------+------+-------------+------------+----------+----------+---------+----+
------+
Total
line
number
=
3
It
costs
0
.
008
s
IoTDB
>
show
datanodes
...
...
node-commons/src/main/java/org/apache/iotdb/commons/cluster/RegionRoleType.java
0 → 100644
浏览文件 @
af5549d3
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package
org.apache.iotdb.commons.cluster
;
/** Region Role for showing regions */
public
enum
RegionRoleType
{
// Region role type : Leader
Leader
(
"Leader"
),
// Region role type : Follower
Follower
(
"Follower"
);
private
final
String
status
;
RegionRoleType
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getStatus
()
{
return
status
;
}
}
server/src/main/java/org/apache/iotdb/db/mpp/common/header/HeaderConstant.java
浏览文件 @
af5549d3
...
...
@@ -78,6 +78,7 @@ public class HeaderConstant {
public
static
final
String
COLUMN_DATANODE_ID
=
"DataNodeId"
;
public
static
final
String
COLUMN_SERIES_SLOTS
=
"Series Slots"
;
public
static
final
String
COLUMN_TIME_SLOTS
=
"Time Slots"
;
public
static
final
String
COLUMN_ROLE
=
"Role"
;
// column names for show datanodes
public
static
final
String
COLUMN_DATA_REGION_NUM
=
"DataRegionNum"
;
...
...
@@ -258,7 +259,8 @@ public class HeaderConstant {
new
ColumnHeader
(
COLUMN_TIME_SLOTS
,
TSDataType
.
INT64
),
new
ColumnHeader
(
COLUMN_DATANODE_ID
,
TSDataType
.
INT32
),
new
ColumnHeader
(
COLUMN_HOST
,
TSDataType
.
TEXT
),
new
ColumnHeader
(
COLUMN_PORT
,
TSDataType
.
INT32
)),
new
ColumnHeader
(
COLUMN_PORT
,
TSDataType
.
INT32
),
new
ColumnHeader
(
COLUMN_ROLE
,
TSDataType
.
TEXT
)),
true
);
}
...
...
server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/metadata/ShowRegionTask.java
浏览文件 @
af5549d3
...
...
@@ -79,6 +79,7 @@ public class ShowRegionTask implements IConfigTask {
builder
.
getColumnBuilder
(
6
).
writeInt
(
regionInfo
.
getDataNodeId
());
builder
.
getColumnBuilder
(
7
).
writeBinary
(
Binary
.
valueOf
(
regionInfo
.
getClientRpcIp
()));
builder
.
getColumnBuilder
(
8
).
writeInt
(
regionInfo
.
getClientRpcPort
());
builder
.
getColumnBuilder
(
9
).
writeBinary
(
Binary
.
valueOf
(
regionInfo
.
getRoleType
()));
builder
.
declarePosition
();
}
}
...
...
thrift-confignode/src/main/thrift/confignode.thrift
浏览文件 @
af5549d3
...
...
@@ -295,6 +295,7 @@ struct TRegionInfo {
6: required i64 seriesSlots
7: required i64 timeSlots
8: optional string status
9: optional string roleType
}
struct TShowRegionResp {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录