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

neuyilan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new ae1938e  Fix connection refused using session when users forget to set 
client ip (#4567)
ae1938e is described below

commit ae1938eb265f220ea1d7f323b3f8f73a8e56b96e
Author: Mrquan <[email protected]>
AuthorDate: Tue Dec 14 14:17:42 2021 +0800

    Fix connection refused using session when users forget to set client ip 
(#4567)
---
 cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java | 6 ++++++
 docs/UserGuide/Cluster/Cluster-Setup-Example.md                  | 2 +-
 docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md               | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
index c5a6713..0c53ebd 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
@@ -278,6 +278,12 @@ public class ClusterIoTDB implements ClusterIoTDBMBean {
       logger.error(checkResult);
       return false;
     }
+    // if client ip is the default address, set it same with internal ip
+    if 
(IoTDBDescriptor.getInstance().getConfig().getRpcAddress().equals("0.0.0.0")) {
+      IoTDBDescriptor.getInstance()
+          .getConfig()
+          
.setRpcAddress(ClusterDescriptor.getInstance().getConfig().getInternalIp());
+    }
     return true;
   }
 
diff --git a/docs/UserGuide/Cluster/Cluster-Setup-Example.md 
b/docs/UserGuide/Cluster/Cluster-Setup-Example.md
index 3f8d06f..48e62d6 100644
--- a/docs/UserGuide/Cluster/Cluster-Setup-Example.md
+++ b/docs/UserGuide/Cluster/Cluster-Setup-Example.md
@@ -183,7 +183,7 @@ internal\_ip = *A\_private\_Ip* (or *B\_private\_Ip*, 
*C\_private\_Ip*)
 
 ***iotdb-engine.properties***
 
-rpc\_address = *A\_public\_Ip* (or *B\_private\_Ip*, *C\_public\_Ip*)
+rpc\_address = *A\_public\_Ip* (or *B\_public\_Ip*, *C\_public\_Ip*)
 
 ### Start IoTDB cluster
 
diff --git a/docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md 
b/docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md
index 7e7b28b..72cad8d 100644
--- a/docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md
+++ b/docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md
@@ -186,7 +186,7 @@ internal\_ip = *A\_private\_Ip* (or *B\_private\_Ip*, 
*C\_private\_Ip*)
 
 ***iotdb-engine.properties***
 
-rpc\_address = *A\_public\_Ip* (or *B\_private\_Ip*, *C\_public\_Ip*)
+rpc\_address = *A\_public\_Ip* (or *B\_public\_Ip*, *C\_public\_Ip*)
 
 ### 启动IoTDB集群
 

Reply via email to