You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/02/20 12:49:37 UTC

[GitHub] [iotdb] neuyilan commented on a change in pull request #2632: one-click build script of N-node n-1 copy pseudo-distributed.

neuyilan commented on a change in pull request #2632:
URL: https://github.com/apache/iotdb/pull/2632#discussion_r579652161



##########
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副本伪分布式一键搭建脚本

Review comment:
       Where to set the n-1 copy? At present, the default copy is 2 copies. I do not see the logic to modify the number of copies in the script?

##########
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:
       If there are other files under the current folder, the permissions of these files have been modified, which is a little too big? Just modify some script execution permissions of iotdb is ok.




----------------------------------------------------------------
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:
users@infra.apache.org