This is an automated email from the ASF dual-hosted git repository.
neuyilan pushed a commit to branch change_rpc_port
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/change_rpc_port by this push:
new 1a986e6 modify the content of the code comment of the seed_nodes
1a986e6 is described below
commit 1a986e6f181b9ab7d3e6b4e8451bc7cb5ee74926
Author: HouliangQi <[email protected]>
AuthorDate: Thu Feb 25 21:01:59 2021 +0800
modify the content of the code comment of the seed_nodes
---
cluster/src/assembly/resources/conf/iotdb-cluster.properties | 11 +++++++----
.../org/apache/iotdb/cluster/config/ClusterDescriptor.java | 8 +++++---
.../apache/iotdb/cluster/server/member/MetaGroupMember.java | 6 ++++++
cluster/src/test/resources/node1conf/iotdb-cluster.properties | 2 +-
cluster/src/test/resources/node2conf/iotdb-cluster.properties | 2 +-
cluster/src/test/resources/node3conf/iotdb-cluster.properties | 2 +-
6 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/cluster/src/assembly/resources/conf/iotdb-cluster.properties
b/cluster/src/assembly/resources/conf/iotdb-cluster.properties
index e754657..68fd1bc 100644
--- a/cluster/src/assembly/resources/conf/iotdb-cluster.properties
+++ b/cluster/src/assembly/resources/conf/iotdb-cluster.properties
@@ -18,11 +18,14 @@
#
#-------------------------------------------IMPORTANT---------------------------------------------#
-# Note that the system will automatically create a heartbeat port for each
metadata service #
+# 1. Note that the system will automatically create a heartbeat port for each
metadata service #
# and data service. The default metadata heartbeat port is internal_meta_port
+ 1, #
# The default data heartbeat port is internal_data_port + 1.
#
# So when you configure these two items and seed_nodes, pay attention to
reserve a port for #
# heartbeat service.
#
+# 2. If open_server_rpc_port is set to true, the server module's RPC port will
be turned on, #
+# and the server module's RPC port will be set to rpc_port (in
iotdb-engines.properties) + 1, #
+# so this port should also be reserved.
#
#-------------------------------------------IMPORTANT---------------------------------------------#
internal_ip=127.0.0.1
@@ -37,9 +40,9 @@ internal_data_port=40010
# if true, the single's server rpc_port will be changed to rpc_port (in
iotdb-engines.properties) + 1
open_server_rpc_port=false
-# comma-separated {IP/DOMAIN}:meta_port:data_port:client_port pairs
-# when used by start-node.sh(.bat), this configuration means the nodes that
will form the initial
-# cluster, some every node that use start-node.sh(.bat) should have the SAME
SEED_NODES, or the
+# comma-separated {IP/DOMAIN}:meta_port pairs, when used by
start-node.sh(.bat),
+# this configuration means the nodes that will form the initial cluster,
+# some every node that use start-node.sh(.bat) should have the SAME
SEED_NODES, or the
# building of the initial cluster will fail. WARNING: if the initial cluster
is built, this
# should not be changed before the environment is cleaned.
# when used by add-node.sh(.bat), this means the nodes to which that the
application of joining
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
index 98ae042..16a181f 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
@@ -48,6 +48,11 @@ public class ClusterDescriptor {
private ClusterDescriptor() {
// copy needed configurations from the server's config to the cluster.
config.setClusterRpcPort(IoTDBDescriptor.getInstance().getConfig().getRpcPort());
+
+ // then load settings from cluster's file.
+ // so, iotdb-cluster.properties can overwrite iotdb-properties.
+ loadProps();
+
// if open the server rpc port, we will enable the rpc service and change
the server's rpc port
// to rpc_port + 1
if (config.isOpenServerRpcPort()) {
@@ -58,9 +63,6 @@ public class ClusterDescriptor {
} else {
IoTDBDescriptor.getInstance().getConfig().setEnableRPCService(false);
}
- // then load settings from cluster's file.
- // so, iotdb-cluster.properties can overwrite iotdb-properties.
- loadProps();
}
public ClusterConfig getConfig() {
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
index 4f945e0..82235ec 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
@@ -692,9 +692,15 @@ public class MetaGroupMember extends RaftMember {
public void processValidHeartbeatResp(HeartBeatResponse response, Node
receiver) {
// register the id of the node
if (response.isSetFollowerIdentifier()) {
+ // register the follower, the response.getFollower() contains the node
information of the
+ // receiver.
registerNodeIdentifier(response.getFollower(),
response.getFollowerIdentifier());
// if all nodes' ids are known, we can build the partition table
if (allNodesIdKnown()) {
+ // When the meta raft group is established, the follower reports its
node information to the
+ // leader through the first heartbeat. After the leader knows the node
information of all
+ // nodes, it can replace the incomplete node information previously
saved locally, and build
+ // partitionTable to send it to other followers.
allNodes = new ArrayList<>(idNodeMap.values());
if (partitionTable == null) {
partitionTable = new SlotPartitionTable(allNodes, thisNode);
diff --git a/cluster/src/test/resources/node1conf/iotdb-cluster.properties
b/cluster/src/test/resources/node1conf/iotdb-cluster.properties
index 55ef6ab..5cb9309 100644
--- a/cluster/src/test/resources/node1conf/iotdb-cluster.properties
+++ b/cluster/src/test/resources/node1conf/iotdb-cluster.properties
@@ -19,7 +19,7 @@
internal_ip=127.0.0.1
internal_meta_port=9003
internal_data_port=40010
-seed_nodes=127.0.0.1:9003:40010:6667,127.0.0.1:9005:40012:6668,127.0.0.1:9007:40014:6669
+seed_nodes=127.0.0.1:9003,127.0.0.1:9005,127.0.0.1:9007
default_replica_num=3
consistency_level=mid
connection_timeout_ms=20000
diff --git a/cluster/src/test/resources/node2conf/iotdb-cluster.properties
b/cluster/src/test/resources/node2conf/iotdb-cluster.properties
index 1ca3be1..334d0f1 100644
--- a/cluster/src/test/resources/node2conf/iotdb-cluster.properties
+++ b/cluster/src/test/resources/node2conf/iotdb-cluster.properties
@@ -19,7 +19,7 @@
internal_ip=127.0.0.1
internal_meta_port=9005
internal_data_port=40012
-seed_nodes=127.0.0.1:9003:40010:6667,127.0.0.1:9005:40012:6668,127.0.0.1:9007:40014:6669
+seed_nodes=127.0.0.1:9003,127.0.0.1:9005,127.0.0.1:9007
default_replica_num=3
consistency_level=mid
connection_timeout_ms=20000
diff --git a/cluster/src/test/resources/node3conf/iotdb-cluster.properties
b/cluster/src/test/resources/node3conf/iotdb-cluster.properties
index ff4abca..bb290f4 100644
--- a/cluster/src/test/resources/node3conf/iotdb-cluster.properties
+++ b/cluster/src/test/resources/node3conf/iotdb-cluster.properties
@@ -19,7 +19,7 @@
internal_ip=127.0.0.1
internal_meta_port=9007
internal_data_port=40014
-seed_nodes=127.0.0.1:9003:40010:6667,127.0.0.1:9005:40012:6668,127.0.0.1:9007:40014:6669
+seed_nodes=127.0.0.1:9003,127.0.0.1:9005,127.0.0.1:9007
default_replica_num=3
consistency_level=mid
connection_timeout_ms=20000