You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2021/02/22 15:52:35 UTC

[iotdb] branch change_rpc_port updated: remove ClusterConstant.CLUSTER_CONF

This is an automated email from the ASF dual-hosted git repository.

hxd 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 da6eb22  remove ClusterConstant.CLUSTER_CONF
da6eb22 is described below

commit da6eb229a219c802c5fbc38c0e0640e9ffe470e6
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Mon Feb 22 23:52:05 2021 +0800

    remove ClusterConstant.CLUSTER_CONF
---
 .../java/org/apache/iotdb/cluster/ClusterMain.java |  6 +---
 .../iotdb/cluster/config/ClusterConstant.java      |  2 --
 .../iotdb/cluster/config/ClusterDescriptor.java    |  5 ++-
 .../src/test/resources/iotdb-cluster-1.properties  | 42 ----------------------
 .../src/test/resources/iotdb-cluster-2.properties  | 42 ----------------------
 .../src/test/resources/iotdb-cluster-3.properties  | 42 ----------------------
 .../src/test/resources/iotdb-engine-1.properties   | 29 ---------------
 .../src/test/resources/iotdb-engine-2.properties   | 29 ---------------
 .../src/test/resources/iotdb-engine-3.properties   | 29 ---------------
 .../resources/node1conf/iotdb-cluster.properties   | 21 +++++++----
 .../resources/node1conf/iotdb-engine.properties    | 10 ++++--
 .../resources/node2conf/iotdb-cluster.properties   | 26 +++++++++++---
 .../resources/node2conf/iotdb-engine.properties    | 10 ++++--
 .../resources/node3conf/iotdb-cluster.properties   | 34 +++++++++++-------
 .../resources/node3conf/iotdb-engine.properties    | 10 ++++--
 15 files changed, 83 insertions(+), 254 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterMain.java b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterMain.java
index d0fa7cc..63f2764 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterMain.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterMain.java
@@ -21,7 +21,6 @@ package org.apache.iotdb.cluster;
 import org.apache.iotdb.cluster.client.async.AsyncMetaClient;
 import org.apache.iotdb.cluster.client.sync.SyncClientAdaptor;
 import org.apache.iotdb.cluster.config.ClusterConfig;
-import org.apache.iotdb.cluster.config.ClusterConstant;
 import org.apache.iotdb.cluster.config.ClusterDescriptor;
 import org.apache.iotdb.cluster.exception.ConfigInconsistentException;
 import org.apache.iotdb.cluster.exception.StartUpCheckFailureException;
@@ -35,7 +34,6 @@ import org.apache.iotdb.db.conf.IoTDBConstant;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.exception.StartupException;
 import org.apache.iotdb.db.exception.query.QueryProcessException;
-
 import org.apache.thrift.TException;
 import org.apache.thrift.async.TAsyncClientManager;
 import org.apache.thrift.protocol.TBinaryProtocol.Factory;
@@ -67,12 +65,10 @@ public class ClusterMain {
     if (args.length < 1) {
       logger.error(
           "Usage: <-s|-a|-r> "
-              + "[-D{} <cluster module configure file>] "
-              + "[-D{} <server module configure file>] "
+              + "[-D{} <configure folder>] "
               + "-s: start the node as a seed\n"
               + "-a: start the node as a new node\n"
               + "-r: remove the node out of the cluster\n",
-          ClusterConstant.CLUSTER_CONF,
           IoTDBConstant.IOTDB_CONF);
 
       return;
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java
index 71c9152..a61a41a 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java
@@ -42,8 +42,6 @@ public class ClusterConstant {
     // constant class
   }
 
-  public static final String CLUSTER_CONF = "CLUSTER_CONF";
-
   /**
    * a failed election will restart in 2s~5s, this should be at least as long as a heartbeat
    * interval, or a stale node may frequently issue elections and thus makes the leader step down
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 35f0f42..c501122 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
@@ -19,12 +19,11 @@
 
 package org.apache.iotdb.cluster.config;
 
+import com.google.common.net.InetAddresses;
 import org.apache.iotdb.cluster.exception.BadSeedUrlFormatException;
 import org.apache.iotdb.db.conf.IoTDBConstant;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.exception.query.QueryProcessException;
-
-import com.google.common.net.InetAddresses;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,7 +62,7 @@ public class ClusterDescriptor {
   }
 
   public String getPropsUrl() {
-    String url = System.getProperty(ClusterConstant.CLUSTER_CONF, null);
+    String url = System.getProperty(IoTDBConstant.IOTDB_CONF, null);
     if (url == null) {
       url = System.getProperty(IoTDBConstant.IOTDB_HOME, null);
       if (url != null) {
diff --git a/cluster/src/test/resources/iotdb-cluster-1.properties b/cluster/src/test/resources/iotdb-cluster-1.properties
deleted file mode 100644
index c22643a..0000000
--- a/cluster/src/test/resources/iotdb-cluster-1.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# 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.
-#
-
-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
-
-default_replica_num=2
-consistency_level=mid
-
-connection_timeout_ms=20000
-write_operation_timeout_ms=30000
-read_operation_timeout_ms=30000
-catch_up_timeout_ms=300000
-use_batch_in_catch_up=true
-min_num_of_logs_in_mem=1000
-max_num_of_logs_in_mem=2000
-log_deletion_check_interval_second=-1
-
-
-is_use_async_server=false
-is_use_async_applier=true
-is_enable_raft_log_persistence=true
diff --git a/cluster/src/test/resources/iotdb-cluster-2.properties b/cluster/src/test/resources/iotdb-cluster-2.properties
deleted file mode 100644
index 9103d1c..0000000
--- a/cluster/src/test/resources/iotdb-cluster-2.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# 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.
-#
-
-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
-
-default_replica_num=2
-consistency_level=mid
-
-connection_timeout_ms=20000
-write_operation_timeout_ms=30000
-read_operation_timeout_ms=30000
-catch_up_timeout_ms=300000
-use_batch_in_catch_up=true
-min_num_of_logs_in_mem=1000
-max_num_of_logs_in_mem=2000
-log_deletion_check_interval_second=-1
-
-
-is_use_async_server=false
-is_use_async_applier=true
-is_enable_raft_log_persistence=true
diff --git a/cluster/src/test/resources/iotdb-cluster-3.properties b/cluster/src/test/resources/iotdb-cluster-3.properties
deleted file mode 100644
index a5b88fb..0000000
--- a/cluster/src/test/resources/iotdb-cluster-3.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# 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.
-#
-
-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
-
-default_replica_num=2
-consistency_level=mid
-
-connection_timeout_ms=20000
-write_operation_timeout_ms=30000
-read_operation_timeout_ms=30000
-catch_up_timeout_ms=300000
-use_batch_in_catch_up=true
-min_num_of_logs_in_mem=1000
-max_num_of_logs_in_mem=2000
-log_deletion_check_interval_second=-1
-
-
-is_use_async_server=false
-is_use_async_applier=true
-is_enable_raft_log_persistence=true
diff --git a/cluster/src/test/resources/iotdb-engine-1.properties b/cluster/src/test/resources/iotdb-engine-1.properties
deleted file mode 100644
index f21cda6..0000000
--- a/cluster/src/test/resources/iotdb-engine-1.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-#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.
-
-
-base_dir=target/tmp1
-data_dirs=target/data1
-wal_dir=target/wal1
-index_root_dir=target/index1
-udf_root_dir=target/ext1
-tracing_dir=target/data/tracing1
-
-rpc_port=6667
-metrics_port=8181
-sync_server_port=5555
-mqtt_port=1883
\ No newline at end of file
diff --git a/cluster/src/test/resources/iotdb-engine-2.properties b/cluster/src/test/resources/iotdb-engine-2.properties
deleted file mode 100644
index 9ad8a44..0000000
--- a/cluster/src/test/resources/iotdb-engine-2.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-#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.
-
-
-base_dir=target/tmp2
-data_dirs=target/data2
-wal_dir=target/wal2
-index_root_dir=target/index2
-udf_root_dir=target/ext2
-tracing_dir=target/data/tracing2
-
-rpc_port=6669
-metrics_port=8182
-sync_server_port=5556
-mqtt_port=1884
\ No newline at end of file
diff --git a/cluster/src/test/resources/iotdb-engine-3.properties b/cluster/src/test/resources/iotdb-engine-3.properties
deleted file mode 100644
index c2723d2..0000000
--- a/cluster/src/test/resources/iotdb-engine-3.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-#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.
-
-
-base_dir=target/tmp3
-data_dirs=target/data3
-wal_dir=target/wal3
-index_root_dir=target/index3
-udf_root_dir=target/ext3
-tracing_dir=target/data/tracing3
-
-rpc_port=6671
-metrics_port=8183
-sync_server_port=5557
-mqtt_port=1885
\ No newline at end of file
diff --git a/cluster/src/test/resources/node1conf/iotdb-cluster.properties b/cluster/src/test/resources/node1conf/iotdb-cluster.properties
index 08ec2fc..128c6a0 100644
--- a/cluster/src/test/resources/node1conf/iotdb-cluster.properties
+++ b/cluster/src/test/resources/node1conf/iotdb-cluster.properties
@@ -16,13 +16,20 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-
-
 internal_ip=127.0.0.1
-internal_meta_port=10010
-internal_data_port=20010
-seed_nodes=127.0.0.1:10010:20010:6667,127.0.0.1:10020:20020:6668,127.0.0.1:10030:20030:6669
+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
 default_replica_num=2
-cluster_name=default
 consistency_level=mid
-
+connection_timeout_ms=20000
+write_operation_timeout_ms=30000
+read_operation_timeout_ms=30000
+catch_up_timeout_ms=300000
+use_batch_in_catch_up=true
+min_num_of_logs_in_mem=1000
+max_num_of_logs_in_mem=2000
+log_deletion_check_interval_second=-1
+is_use_async_server=false
+is_use_async_applier=true
+is_enable_raft_log_persistence=true
diff --git a/cluster/src/test/resources/node1conf/iotdb-engine.properties b/cluster/src/test/resources/node1conf/iotdb-engine.properties
index 6ca81a1..f21cda6 100644
--- a/cluster/src/test/resources/node1conf/iotdb-engine.properties
+++ b/cluster/src/test/resources/node1conf/iotdb-engine.properties
@@ -15,9 +15,15 @@
 #specific language governing permissions and limitations
 #under the License.
 
-rpc_address=127.0.0.1
-rpc_port=6667
+
 base_dir=target/tmp1
 data_dirs=target/data1
 wal_dir=target/wal1
 index_root_dir=target/index1
+udf_root_dir=target/ext1
+tracing_dir=target/data/tracing1
+
+rpc_port=6667
+metrics_port=8181
+sync_server_port=5555
+mqtt_port=1883
\ No newline at end of file
diff --git a/cluster/src/test/resources/node2conf/iotdb-cluster.properties b/cluster/src/test/resources/node2conf/iotdb-cluster.properties
index df38a84..9103d1c 100644
--- a/cluster/src/test/resources/node2conf/iotdb-cluster.properties
+++ b/cluster/src/test/resources/node2conf/iotdb-cluster.properties
@@ -18,9 +18,25 @@
 #
 
 internal_ip=127.0.0.1
-internal_meta_port=10020
-internal_data_port=20020
-seed_nodes=127.0.0.1:10010:20010:6667,127.0.0.1:10020:20020:6668,127.0.0.1:10030:20030:6669
+
+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
+
 default_replica_num=2
-cluster_name=default
-consistency_level=mid
\ No newline at end of file
+consistency_level=mid
+
+connection_timeout_ms=20000
+write_operation_timeout_ms=30000
+read_operation_timeout_ms=30000
+catch_up_timeout_ms=300000
+use_batch_in_catch_up=true
+min_num_of_logs_in_mem=1000
+max_num_of_logs_in_mem=2000
+log_deletion_check_interval_second=-1
+
+
+is_use_async_server=false
+is_use_async_applier=true
+is_enable_raft_log_persistence=true
diff --git a/cluster/src/test/resources/node2conf/iotdb-engine.properties b/cluster/src/test/resources/node2conf/iotdb-engine.properties
index a4adbbb..9ad8a44 100644
--- a/cluster/src/test/resources/node2conf/iotdb-engine.properties
+++ b/cluster/src/test/resources/node2conf/iotdb-engine.properties
@@ -15,9 +15,15 @@
 #specific language governing permissions and limitations
 #under the License.
 
-rpc_address=127.0.0.1
-rpc_port=6668
+
 base_dir=target/tmp2
 data_dirs=target/data2
 wal_dir=target/wal2
 index_root_dir=target/index2
+udf_root_dir=target/ext2
+tracing_dir=target/data/tracing2
+
+rpc_port=6669
+metrics_port=8182
+sync_server_port=5556
+mqtt_port=1884
\ No newline at end of file
diff --git a/cluster/src/test/resources/node3conf/iotdb-cluster.properties b/cluster/src/test/resources/node3conf/iotdb-cluster.properties
index c91e063..a5b88fb 100644
--- a/cluster/src/test/resources/node3conf/iotdb-cluster.properties
+++ b/cluster/src/test/resources/node3conf/iotdb-cluster.properties
@@ -17,18 +17,26 @@
 # under the License.
 #
 
-#-------------------------------------------IMPORTANT---------------------------------------------#
-# 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.                                                                              #
-#-------------------------------------------IMPORTANT---------------------------------------------#
-
 internal_ip=127.0.0.1
-internal_meta_port=10030
-internal_data_port=20030
-seed_nodes=127.0.0.1:10010:20010:6667,127.0.0.1:10020:20020:6668,127.0.0.1:10030:20030:6669
+
+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
+
 default_replica_num=2
-cluster_name=default
-consistency_level=mid
\ No newline at end of file
+consistency_level=mid
+
+connection_timeout_ms=20000
+write_operation_timeout_ms=30000
+read_operation_timeout_ms=30000
+catch_up_timeout_ms=300000
+use_batch_in_catch_up=true
+min_num_of_logs_in_mem=1000
+max_num_of_logs_in_mem=2000
+log_deletion_check_interval_second=-1
+
+
+is_use_async_server=false
+is_use_async_applier=true
+is_enable_raft_log_persistence=true
diff --git a/cluster/src/test/resources/node3conf/iotdb-engine.properties b/cluster/src/test/resources/node3conf/iotdb-engine.properties
index dce2490..c2723d2 100644
--- a/cluster/src/test/resources/node3conf/iotdb-engine.properties
+++ b/cluster/src/test/resources/node3conf/iotdb-engine.properties
@@ -15,9 +15,15 @@
 #specific language governing permissions and limitations
 #under the License.
 
-rpc_address=127.0.0.1
-rpc_port=6669
+
 base_dir=target/tmp3
 data_dirs=target/data3
 wal_dir=target/wal3
 index_root_dir=target/index3
+udf_root_dir=target/ext3
+tracing_dir=target/data/tracing3
+
+rpc_port=6671
+metrics_port=8183
+sync_server_port=5557
+mqtt_port=1885
\ No newline at end of file