This is an automated email from the ASF dual-hosted git repository. tanxinyu pushed a commit to branch cluster_setup_doc in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit b25d0165ab5bdc3b0b04cb2919604c9e639b4362 Author: Potato <[email protected]> AuthorDate: Fri Apr 9 10:26:29 2021 +0800 [Distributed] add cluster setup example doc (#2984) --- docs/UserGuide/Cluster/Cluster-Setup-Example.md | 47 ++++++++++++++++++++++ docs/UserGuide/Cluster/Cluster-Setup.md | 11 +---- docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md | 46 +++++++++++++++++++++ docs/zh/UserGuide/Cluster/Cluster-Setup.md | 11 +---- 4 files changed, 95 insertions(+), 20 deletions(-) diff --git a/docs/UserGuide/Cluster/Cluster-Setup-Example.md b/docs/UserGuide/Cluster/Cluster-Setup-Example.md new file mode 100644 index 0000000..43aa65a --- /dev/null +++ b/docs/UserGuide/Cluster/Cluster-Setup-Example.md @@ -0,0 +1,47 @@ +<!-- + + 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. + +--> + +__NOTICE: CURRENT IoTDB CLUSTER IS FOR TESTING NOW! +PLEASE BE DELIBERATE IF YOU RUN IT IN PRODUCT ENVIRONMENT.__ + +## Example of pseudo-distributed scaffolding for 3 nodes and 3 replicas +``` +mvn clean package -DskipTests +chmod -R 777 ./cluster/target/ +nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node1conf/ >/dev/null 2>&1 & +nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node2conf/ >/dev/null 2>&1 & +nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node3conf/ >/dev/null 2>&1 & +``` + +## Example of distributed scaffolding for 3 nodes and 3 replicas + +Suppose we need to deploy the distributed IoTDB on three physical nodes, A, B, and C, whose public network IP is a_public_IP, b_public_IP, and c_public_IP, and private network IP is a_private_IP, b_private_IP, and c_private_IP. +Note: If there is no public network IP or private network IP, both can be set to the same, just need to ensure that the client can access the server. + +The operation steps are as follows: + +1. Make sure ports 6667, 9003, 9004, 40010, 40011 and 31999 are open on all three nodes. +2. Use 'mvn clean package -pl cluster -am -DskipTests' to compile the distributed module. +3. Send the generated package (iotdb-cluster-0.12.0-SNAPSHOT) to all servers. +4. Configure all nodes' seed_nodes in conf/iotdb-cluster.properties as "A_private_ip:9003,B_private_ip:9003,C_private_ip:9003" +5. Configure the internal_ip in conf/iotdb-cluster.properties to be the private_ip of each node. +6. Configure rpc_address in conf/iotdb-engine.properties to be the public_ip of each node. +7. Run sh sbin/start-node.sh on each of the three nodes (or run in the background). \ No newline at end of file diff --git a/docs/UserGuide/Cluster/Cluster-Setup.md b/docs/UserGuide/Cluster/Cluster-Setup.md index be40fc3..a0751fc 100644 --- a/docs/UserGuide/Cluster/Cluster-Setup.md +++ b/docs/UserGuide/Cluster/Cluster-Setup.md @@ -43,15 +43,6 @@ To start the service of one of the nodes, you need to execute the following comm `printgc` means whether enable the gc and print gc logs when start the node, `<conf_path>` use the configuration file in the `conf_path` folder to override the default configuration file. -## Example of pseudo-distributed scaffolding for 3 nodes and 3 replicas -``` -mvn clean package -DskipTests -chmod -R 777 ./cluster/target/ -nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node1conf/ >/dev/null 2>&1 & -nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node2conf/ >/dev/null 2>&1 & -nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node3conf/ >/dev/null 2>&1 & -``` - ## OverWrite the configurations of Stand-alone node Some configurations in the iotdb-engines.properties will be ignored @@ -80,7 +71,7 @@ What's more, Users can configure settings of TsFile (the data files), such as th * `iotdb-cluster.properties`. Some configurations required by IoTDB cluster. Such as replication number(`default_replica_num`), etc. For detailed description of the two configuration files `iotdb-engine.properties`, `iotdb-env.sh`/`iotdb-env.bat`, please refer to [Configuration Manual](../Appendix/Config-Manual.md). -The configuration items described below are in the `iotdb-cluster.properties` file. +The configuration items described below are in the `iotdb-cluster.properties` file, you can also review the comments in the [configuration file](https://github.com/apache/iotdb/blob/master/cluster/src/assembly/resources/conf/iotdb-cluster.properties) directly. * internal\_ip diff --git a/docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md b/docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md new file mode 100644 index 0000000..3fd72f1 --- /dev/null +++ b/docs/zh/UserGuide/Cluster/Cluster-Setup-Example.md @@ -0,0 +1,46 @@ +<!-- + + 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. + +--> + +__集群模式目前是测试版!请谨慎在生产环境中使用。__ + +## 3节点3副本伪分布式搭建示例 +``` +mvn clean package -DskipTests +chmod -R 777 ./cluster/target/ +nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node1conf/ >/dev/null 2>&1 & +nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node2conf/ >/dev/null 2>&1 & +nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node3conf/ >/dev/null 2>&1 & +``` + +## 3节点3副本分布式搭建示例 + +假设我们需要在三个物理节点上部署分布式 IoTDB,这三个节点分别为 A, B 和 C,其公网 ip 分别为 A_public_ip,B_public_ip 和 C_public_ip,私网 ip 分别为 A_private_ip,B_private_ip 和 C_private_ip。 +注:如果没有公网 ip 或者私网 ip 则两者设置成一致即可, 只需要保证客户端能够访问到服务端即可。 + +以下为操作步骤: + +1. 保证三个节点的 6667, 9003, 9004, 40010, 40011 和 31999 端口是开放的。 +2. 使用 `mvn clean package -pl cluster -am -DskipTests` 编译分布式模块。 +3. 将打出来的包(iotdb-cluster-0.12.0-SNAPSHOT)传到所有的服务器上。 +4. 配置所有节点 conf/iotdb-cluster.properties 配置文件中的 seed_nodes 为 "A_private_ip:9003,B_private_ip:9003,C_private_ip:9003" +5. 配置所有节点 conf/iotdb-cluster.properties 配置文件中的 internal_ip 为各自节点的 private_ip。 +6. 配置所有节点 conf/iotdb-engine.properties 配置文件中的 rpc_address 为各自节点的 public_ip。 +7. 在 3 个节点上分别运行 sh sbin/start-node.sh 即可(后台运行也可)。 \ No newline at end of file diff --git a/docs/zh/UserGuide/Cluster/Cluster-Setup.md b/docs/zh/UserGuide/Cluster/Cluster-Setup.md index 1218b35..bcceb89 100644 --- a/docs/zh/UserGuide/Cluster/Cluster-Setup.md +++ b/docs/zh/UserGuide/Cluster/Cluster-Setup.md @@ -39,15 +39,6 @@ __集群模式目前是测试版!请谨慎在生产环境中使用。__ `printgc`表示在启动的时候,会开启GC日志。 `<conf_path>`使用`conf_path`文件夹里面的配置文件覆盖默认配置文件。 -## 3节点3副本伪分布式搭建示例 -``` -mvn clean package -DskipTests -chmod -R 777 ./cluster/target/ -nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node1conf/ >/dev/null 2>&1 & -nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node2conf/ >/dev/null 2>&1 & -nohup ./cluster/target/iotdb-cluster-0.12.0-SNAPSHOT/sbin/start-node.sh ./cluster/target/test-classes/node3conf/ >/dev/null 2>&1 & -``` - ## 被覆盖的单机版选项 iotdb-engines.properties配置文件中的部分内容会不再生效: @@ -75,7 +66,7 @@ iotdb-engines.properties配置文件中的部分内容会不再生效: * `iotdb-cluster.properties`: IoTDB集群所需要的一些配置。 -`iotdb-engine.properties`、`iotdb-env.sh`/`iotdb-env.bat` 两个配置文件详细说明请参考[附录/配置手册](../Appendix/Config-Manual.md),下面描述的配置项是在`iotdb-cluster.properties`文件中的。 +`iotdb-engine.properties`、`iotdb-env.sh`/`iotdb-env.bat` 两个配置文件详细说明请参考[附录/配置手册](../Appendix/Config-Manual.md),下面描述的配置项是在`iotdb-cluster.properties`文件中的,也可以直接查看[配置文件](https://github.com/apache/iotdb/blob/master/cluster/src/assembly/resources/conf/iotdb-cluster.properties) 中的注释。 * internal\_ip
