weizihan0110 commented on a change in pull request #2632:
URL: https://github.com/apache/iotdb/pull/2632#discussion_r579663717
##########
File path: docs/zh/UserGuide/Server/Cluster Setup.md
##########
@@ -69,6 +69,55 @@ or
> 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
```
+## n节点n-1副本伪分布式一键搭建脚本
+```
+#!/bin/bash
+
+#配置节点个数
+NODE_NUM=3
+
+export CLUSTER_JAR_PATH=./
+#表示如 cluster-0.11.0-SNAPSHOT 的字符串变量
+CLUSTER_SNAPSHOT_NAME=$(find $CLUSTER_JAR_PATH -name "cluster-*-SNAPSHOT" |
sed 's#.*/##')
+
+#端口配置
+RPC_PORT=6667
+JMX_PORT=31999
+internal_meta_port=9005
+internal_data_port=40012
+cluster_rpc_port=55561
+
+for((i=1,rpc_port=$RPC_PORT,jmx_port=$JMX_PORT;i<=$NODE_NUM;i++,rpc_port++,jmx_port++));
+do
+temp_name="$CLUSTER_SNAPSHOT_NAME"$i
+#第一步(复制IoTDB集群包)
+cp -rf $CLUSTER_JAR_PATH/$CLUSTER_SNAPSHOT_NAME $CLUSTER_JAR_PATH/$temp_name
+
+#第二步(分别修改rpc与jmx端口)
+sed -i -e "s/${RPC_PORT}/${rpc_port}/g"
$CLUSTER_JAR_PATH/$temp_name/conf/iotdb-engine.properties
+sed -i -e "s/${JMX_PORT}/${jmx_port}/g"
$CLUSTER_JAR_PATH/$temp_name/conf/iotdb-env.sh
+done
+
+#第三步(更改权限)
+chmod -R 777 $CLUSTER_JAR_PATH/
Review comment:
current folder are ./cluster/target/.
I'll make it clearer
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]