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

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


The following commit(s) were added to refs/heads/cluster_new by this push:
     new 2c5d21d  add setup example docs
     new 8ed3620  Merge pull request #2172 from 
LebronAl/cluster_new_add_setup_example_docs
2c5d21d is described below

commit 2c5d21d33f3bc8da9c597d993501dc922cea199e
Author: LebronAl <[email protected]>
AuthorDate: Thu Dec 3 09:57:29 2020 +0800

    add setup example docs
---
 cluster/src/assembly/resources/conf/logback.xml |  9 -------
 docs/UserGuide/Server/Cluster Setup.md          | 34 +++++++++++++++++++++++--
 docs/zh/UserGuide/Server/Cluster Setup.md       | 34 +++++++++++++++++++++++--
 3 files changed, 64 insertions(+), 13 deletions(-)

diff --git a/cluster/src/assembly/resources/conf/logback.xml 
b/cluster/src/assembly/resources/conf/logback.xml
index 4b641f5..e81e6e5 100644
--- a/cluster/src/assembly/resources/conf/logback.xml
+++ b/cluster/src/assembly/resources/conf/logback.xml
@@ -27,7 +27,6 @@
             <onMismatch>DENY</onMismatch>
         </filter>
     </appender>
-
     <appender class="ch.qos.logback.core.rolling.RollingFileAppender" 
name="FILE_WARN">
         <file>${IOTDB_HOME}/logs/log_warn.log</file>
         <rollingPolicy 
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
@@ -49,7 +48,6 @@
             <onMismatch>DENY</onMismatch>
         </filter>
     </appender>
-
     <appender class="ch.qos.logback.core.rolling.RollingFileAppender" 
name="FILE_INFO">
         <file>${IOTDB_HOME}/logs/log_info.log</file>
         <rollingPolicy 
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
@@ -71,7 +69,6 @@
             <onMismatch>DENY</onMismatch>
         </filter>
     </appender>
-
     <appender class="ch.qos.logback.core.rolling.RollingFileAppender" 
name="FILE_DEBUG">
         <file>${IOTDB_HOME}/logs/log_debug.log</file>
         <rollingPolicy 
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
@@ -93,7 +90,6 @@
             <onMismatch>DENY</onMismatch>
         </filter>
     </appender>
-
     <appender class="ch.qos.logback.core.rolling.RollingFileAppender" 
name="FILE_TRACE">
         <file>${IOTDB_HOME}/logs/log_trace.log</file>
         <rollingPolicy 
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
@@ -115,7 +111,6 @@
             <onMismatch>DENY</onMismatch>
         </filter>
     </appender>
-
     <appender class="ch.qos.logback.core.ConsoleAppender" name="FILE_STDOUT">
         <Target>System.out</Target>
         <encoder>
@@ -126,7 +121,6 @@
             <level>INFO</level>
         </filter>
     </appender>
-
     <logger level="info" name="org.apache.iotdb.db.service"/>
     <logger level="info" name="org.apache.iotdb.db.conf"/>
     <!-- a log appender that collect all log records whose level is greather 
than debug-->
@@ -149,7 +143,6 @@
             <level>DEBUG</level>
         </filter>
     </appender>
-
     <appender class="ch.qos.logback.core.rolling.RollingFileAppender" 
name="FILE_COST_MEASURE">
         <file>${IOTDB_HOME}/logs/log_measure.log</file>
         <rollingPolicy 
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
@@ -169,7 +162,6 @@
             <level>INFO</level>
         </filter>
     </appender>
-
     <appender class="ch.qos.logback.core.rolling.RollingFileAppender" 
name="FILE_DYNAMIC_PARAMETER">
         <file>${IOTDB_HOME}/logs/log_dynamic_adapter.log</file>
         <rollingPolicy 
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
@@ -189,7 +181,6 @@
             <level>DEBUG</level>
         </filter>
     </appender>
-
     <appender name="ASYNC_FILE_ERROR" 
class="ch.qos.logback.classic.AsyncAppender">
         <queueSize>1024</queueSize>
         <neverBlock>true</neverBlock>
diff --git a/docs/UserGuide/Server/Cluster Setup.md 
b/docs/UserGuide/Server/Cluster Setup.md
index 38640b9..335716d 100644
--- a/docs/UserGuide/Server/Cluster Setup.md    
+++ b/docs/UserGuide/Server/Cluster Setup.md    
@@ -21,6 +21,8 @@
 
 # Cluster Setup
 For installation prerequisites, please refer to [Installation 
Prerequisites](../Get%20Started/QuickStart.md)
+## Prerequisite
+Note: Please install MinGW or WSL or git bash if you are using Windows.
 ## Start Service
 Users can build clusters in pseudo-distributed mode or distributed mode. 
 The main difference between pseudo-distributed mode and distributed mode is 
the difference in `seed_nodes` in the configuration file. 
@@ -35,9 +37,9 @@ or
 > nohup sbin/start-node.sh -c <conf_path> -internal_meta_port 9003 >/dev/null 
 > 2>&1 &
 
 # Windows
-> nohup sbin/start-node.bat
+> sbin\start-node.bat
 or
-> nohup sbin/start-node.bat -c <conf_path> -internal_meta_port 9003
+> sbin\start-node.bat -c <conf_path> -internal_meta_port 9003
 ```
 
 `-c <conf_path>` use the configuration file in the `conf_path` folder to 
override the default configuration file; 
@@ -46,6 +48,34 @@ The currently supported items to overwrite the original 
configurations when star
 `internal_meta_port, internal_data_port, cluster_rpc_port, seed_nodes`. 
 When both exist, the specified configuration item will overwrite the 
configurations in the configuration file.
 
+## Example of pseudo-distributed scaffolding for 3 nodes and 2 replicas
+```bash
+# First step (Note that this path is not suitable for Windows MinGW)
+> mvn clean package -pl cluster -am -Dmaven.test.skip=true
+> cp -rf ./cluster/target/cluster-0.11.0-SNAPSHOT 
./cluster/target/cluster-0.11.0-SNAPSHOT1
+> cp -rf ./cluster/target/cluster-0.11.0-SNAPSHOT 
./cluster/target/cluster-0.11.0-SNAPSHOT2
+> sed -i -e 's/6667/6668/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT1/conf/iotdb-engine.properties
+> sed -i -e 's/6667/6669/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT2/conf/iotdb-engine.properties
+
+# Second step: Unix/OS X/Windows (git bash or WSL)
+> sed -i -e 's/31999/32000/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT1/conf/cluster-env.sh
+> sed -i -e 's/31999/32001/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT2/conf/cluster-env.sh
+> chmod -R 777 ./cluster/target/
+> nohup ./cluster/target/cluster-0.11.0-SNAPSHOT/sbin/start-node.sh >/dev/null 
2>&1 &
+> nohup ./cluster/target/cluster-0.11.0-SNAPSHOT1/sbin/start-node.sh 
-internal_meta_port 9005 -internal_data_port 40012 -cluster_rpc_port 55561 
>/dev/null 2>&1 &
+> nohup ./cluster/target/cluster-0.11.0-SNAPSHOT2/sbin/start-node.sh 
-internal_meta_port 9007 -internal_data_port 40014 -cluster_rpc_port 55562 
>/dev/null 2>&1 &
+
+# Second step: Windows (MinGW)
+> sed -i -e 's/31999/32000/g'  
cluster\target\cluster-0.11.0-SNAPSHOT\conf\cluster-env.bat
+> sed -i -e 's/31999/32001/g'  
cluster\target\cluster-0.11.0-SNAPSHOT\conf\cluster-env.bat
+> nohup cluster\target\cluster-0.11.0-SNAPSHOT\sbin\start-node.bat 
+> nohup cluster\target\cluster-0.11.0-SNAPSHOT1\sbin\start-node.bat  
-internal_meta_port 9005 -internal_data_port 40012 -cluster_rpc_port 55561
+> nohup cluster\target\cluster-0.11.0-SNAPSHOT2\sbin\start-node.bat  
-internal_meta_port 9007 -internal_data_port 40014 -cluster_rpc_port 55562
+```
+
+Note: The distributed version uses the 707 identifier to instruct the client 
to do the appropriate metadata cache so that the data can then be sent directly 
to the leader of the corresponding data group later.
+Therefore, it is recommended to re-install `mvn install -pl jdbc -am 
-Dmaven.test.skip=true` and `mvn install -pl jdbc -am -Dmaven.test.skip=true` 
on current branch to update the latest client.
+
 ## OverWrite the configurations of Stand-alone node
 
 Some configurations in the iotdb-engines.properties will be ignored
diff --git a/docs/zh/UserGuide/Server/Cluster Setup.md 
b/docs/zh/UserGuide/Server/Cluster Setup.md
index a5c11dc..0330e40 100644
--- a/docs/zh/UserGuide/Server/Cluster Setup.md 
+++ b/docs/zh/UserGuide/Server/Cluster Setup.md 
@@ -21,6 +21,8 @@
 
 # 集群设置
 安装环境请参考[安装环境](../Get%20Started/QuickStart.md)
+## 前提条件
+如果您在使用Windows系统,请安装MinGW,WSL或者git bash。
 ## 集群环境搭建
 
您可以搭建伪分布式模式或是分布式模式的集群,伪分布式模式和分布式模式的主要区别是配置文件中`seed_nodes`的不同,配置项含义请参考[配置项](#配置项)。
 启动其中一个节点的服务,需要执行如下命令:
@@ -32,15 +34,43 @@ or
 > nohup sbin/start-node.sh -c <conf_path> -internal_meta_port 9003 >/dev/null 
 > 2>&1 &
 
 # Windows
-> nohup sbin/start-node.bat
+> sbin\start-node.bat
 or
-> nohup sbin/start-node.bat -c <conf_path> -internal_meta_port 9003
+> sbin\start-node.bat -c <conf_path> -internal_meta_port 9003
 ```
 
 `-c <conf_path>`使用`conf_path`文件夹里面的配置文件覆盖默认配置文件; `-internal_meta_port 
9003`覆盖特定配置项`internal_meta_port`的配置,
 目前支持的启动覆盖原有配置的配置项有:
 
`internal_meta_port、internal_data_port、cluster_rpc_port、seed_nodes`。当配置文件和配置项都被指定的时候,指定配置项的配置会覆盖配置文件中的配置。
 
+## 3节点2副本伪分布式搭建示例
+```bash
+# 第一步 (注意以下路径在 Windows MinGW 中并不适用)
+> mvn clean package -pl cluster -am -Dmaven.test.skip=true
+> cp -rf ./cluster/target/cluster-0.11.0-SNAPSHOT 
./cluster/target/cluster-0.11.0-SNAPSHOT1
+> cp -rf ./cluster/target/cluster-0.11.0-SNAPSHOT 
./cluster/target/cluster-0.11.0-SNAPSHOT2
+> sed -i -e 's/6667/6668/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT1/conf/iotdb-engine.properties
+> sed -i -e 's/6667/6669/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT2/conf/iotdb-engine.properties
+
+# 第二步: Unix/OS X/Windows (git bash or WSL)
+> sed -i -e 's/31999/32000/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT1/conf/cluster-env.sh
+> sed -i -e 's/31999/32001/g' 
./cluster/target/cluster-0.11.0-SNAPSHOT2/conf/cluster-env.sh
+> chmod -R 777 ./cluster/target/
+> nohup ./cluster/target/cluster-0.11.0-SNAPSHOT/sbin/start-node.sh >/dev/null 
2>&1 &
+> nohup ./cluster/target/cluster-0.11.0-SNAPSHOT1/sbin/start-node.sh 
-internal_meta_port 9005 -internal_data_port 40012 -cluster_rpc_port 55561 
>/dev/null 2>&1 &
+> nohup ./cluster/target/cluster-0.11.0-SNAPSHOT2/sbin/start-node.sh 
-internal_meta_port 9007 -internal_data_port 40014 -cluster_rpc_port 55562 
>/dev/null 2>&1 &
+
+# 第二步: Windows (MinGW)
+> sed -i -e 's/31999/32000/g'  
cluster\target\cluster-0.11.0-SNAPSHOT\conf\cluster-env.bat
+> sed -i -e 's/31999/32001/g'  
cluster\target\cluster-0.11.0-SNAPSHOT\conf\cluster-env.bat
+> nohup cluster\target\cluster-0.11.0-SNAPSHOT\sbin\start-node.bat 
+> nohup cluster\target\cluster-0.11.0-SNAPSHOT1\sbin\start-node.bat  
-internal_meta_port 9005 -internal_data_port 40012 -cluster_rpc_port 55561
+> nohup cluster\target\cluster-0.11.0-SNAPSHOT2\sbin\start-node.bat  
-internal_meta_port 9007 -internal_data_port 40014 -cluster_rpc_port 55562
+```
+
+注:分布式版使用了707标识符来指示客户端做相应的元数据缓存以便之后能够直接将数据发送给对应数据组的 leader。因此建议在当前分支重新 `mvn 
install -pl jdbc -am -Dmaven.test.skip=true` 和
+`mvn install -pl session -am -Dmaven.test.skip=true`以更新最新的客户端。
+
 ## 被覆盖的单机版选项
 
 iotdb-engines.properties配置文件中的部分内容会不再生效:

Reply via email to