rewrite the cluster quickStart part: replace 127.0.0.1 with real IP a… (#52)
* rewrite the cluster quickStart part: replace 127.0.0.1 with real IP address as an example
diff --git a/src/UserGuide/Master/QuickStart/ClusterQuickStart.md b/src/UserGuide/Master/QuickStart/ClusterQuickStart.md
index d4ab2a3..3403bd8 100644
--- a/src/UserGuide/Master/QuickStart/ClusterQuickStart.md
+++ b/src/UserGuide/Master/QuickStart/ClusterQuickStart.md
@@ -21,163 +21,240 @@
# Cluster Quick Start
-This article uses a local environment as an example to
-illustrate how to start, expand, and shrink an IoTDB Cluster.
+The purpose of this article is to show how to start, expand, and shrink an IoTDB cluster in an easy way.
-**Notice: This document is a tutorial for deploying in a pseudo-cluster environment using different local ports, and is for exercise only. In real deployment scenarios, you only need to configure the IPV4 address or domain name of the server, and do not need to change the Node ports.**
+See also:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-## 1. Prepare the Start Environment
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster0 folder.
+## 1. Installation and deployment
-## 2. Start a Minimum Cluster
+As an example, we'd like to start an IoTDB cluster with 3 ConfigNodes and 3 DataNodes(3C3D) with minimum modifications. Thus,
+- the cluster name is defaultCluster
+- data/schema replica is 1
+- the max heap size of ConfigNode take the 1/4 of the computer
+- the max heap size of DataNode take the 1/4 of the computer
-Start the Cluster version with one ConfigNode and one DataNode(1C1D), and
-the default number of replicas is one.
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+Suppose there are 3 computers(3 nodes we called here) with Linux OS and JDK installed(detail see [Prerequisites](../QuickStart/QuickStart.md)) and IoTDB working directory is `/data/iotdb`.
+IP address and configurations is like below:
+
+| Node IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| service | ConfigNode | ConfigNode | ConfigNode |
+| service | DataNode | DataNode | DataNode |
+
+Port:
+
+| Service | ConfigNode | DataNode |
+|---|---|---|
+|port| 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
+
+**illustration:**
+- We could use IP address or hostname/domain to set up an IoTDB cluster, then we would take IP address. If using hostname/domain, `/etc/hosts` must be set well.
+- JVM memory configuration: `MAX_HEAP_SIZE` in `confignode-env.sh` and `datanode-env.sh`, equal to or greater than 1G is recommended. It's enough for ConfigNode taking 1~2G. The memory taking of DataNode is decided by the inputing and querying data.
+
+### 1.1 download
+In every computer, [Download](https://iotdb.apache.org/Download/) the IoTDB install package and extract it to working directory of `/data/iotdb`.
+Then get the directory tree:
+```shell
+/data/iotdb/
+├── conf # configuration files
+├── lib # jar library
+├── sbin # start/stop shell etc.
+└── tools # other tools
```
-## 3. Verify the Minimum Cluster
+### 1.2. configuration
-+ If everything goes well, the minimum cluster will start successfully. Then, we can start the Cli for verification.
+Configuration files are in `/data/iotdb/conf`.
+Modify the specified configuration file according to the table below:
+
+| Configuration| Configuration Option | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**Notice:**
+It's recommended that the configurations of iotdb-common.properties and the heap size of JVM in all nodes are the same.
+
+### 1.3. start IoTDB cluster
+Before starting the IoTDB cluster, make sure the configurations are correct and there is no any data in the working directory.
+
+#### 1.3.1. start the first node
+That is `cn_target_config_node_list` in above configuration table.
+Execute these commands below in node of `192.168.132.10`.
+```shell
+cd /data/iotdb
+# start ConfigNode and DataNode services
+sbin/start-standalone.sh
+
+# check DataNode logs to see whether starting successfully or not
+tail -f logs/log_datanode_all.log
+# expecting statements like below
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-./cluster0/sbin/start-cli.sh
+If there is no such logs mentioned abolve or there are some `Exception`s in log files, it's failed. Then please check `log_confignode_all.log` and `log_datanode_all.log` in directory of `/data/iotdb/logs`.
+
+**Notice**:
+- Make sure the first node, especially the first ConfigNode that `cn_target_config_node_list` specified, starting successfully, and then start the other services.
+- If starting failed,it's necessary to do [cleanup](#【reference】cleanup) before starting again.
+- How to start service ConfigNode or DataNode alone:
+```shell
+# start ConfigNode alone in daemon
+sbin/start-confignode.sh -d
+# start DataNode alone in daemon
+sbin/start-datanode.sh -d
```
-+ Execute the [show cluster details](https://iotdb.apache.org/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#show-all-node-information)
- command on the Cli. The result is shown below:
+#### 1.3.2. start service ConfigNode and DataNode in other nodes
+Execute commands below in both 192.168.132.11 and 192.168.132.12:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+If starting failed, it's necessary to do [cleanup](#【reference】cleanup) in all nodes, and then doging all again from starting the first node.
+
+#### 1.3.3. check the cluster status
+If everything goes well, the cluster will start successfully. Then, we can start the Cli for verification.
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
+**illustration:**
+The IP address of `start-cli.sh -h` could be any IP address of DataNode service.
+
+
+### 【reference】Cleanup
+Execute commands in every node:
+1. End processes of ConfigNode and DataNode
+```shell
+# 1. Stop services ConfigNode and DataNode
+sbin/stop-standalone.sh
+
+# 2. Check whether there are IoTDB processes left or not
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. If there is any IoTDB process left, kill it
+kill -9 <pid>
+# If there is only 1 IoTDB instance, execue command below to remove all IoTDB process
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-## 4. Prepare the Expanding Environment
+2. Remove directories of data and logs
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
+**illustration:**
+It's necessary to remove directory of `data` but it's not necessary to remove directory of `logs`, only for convenience.
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster1 and cluster2 folder.
-## 5. Modify the Node Configuration file
+## 2. Expand
+`Expand` means add services of ConfigNode or DataNode into an existing IoTDB cluster.
-For folder cluster1:
+It's the same as starting the other nodes mentioned above. That is downloading IoTDB install package, extracting, configurating and then starting. The new node here is `192.168.132.13`.
+**Notice**
+- It's must be cleaned up, in other words doing [cleanup](#cleanup) in it.
+- `cluster_name` of `iotdb-common.properties` must be the same to the cluster.
+- `cn_target_config_node_list` and `dn_target_config_node_list` must be the same to the cluster.
+- The old data wouldn't be moved to the new node but the new data would be.
-+ Modify ConfigNode configurations:
+### 2.1. configuration
+Modify the specified configuration file according to the table below:
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
+| Configuration | Configuration Option| IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|-------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-For folder cluster2:
-
-+ Modify ConfigNode configurations:
-
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-## 6. Expanding the Cluster
-
-Expanding the Cluster to three ConfigNode and three DataNode(3C3D).
-The following commands can be executed in arbitrary order.
-
-```
-./cluster1/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster2/sbin/start-datanode.sh
+### 2.2. expand
+Execute commands below in new node of `192.168.132.13`:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-## 7. Verify Cluster expansion
+### 2.3. check the result
+Execute `show cluster` through Cli and the result like below:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+
+## 3. Remove service
+`Shrink` means removing a service from the IoTDB cluster.
+**Notice:**
+- `Shrink` could be done in any node within the cluster
+- Any service could be shrinked within cluster. But the DataNode service of the cluster must greater than the data replica of iotdb-common.properties.
+- Be patient to wait for the end of shrinking, and then read the guide in logs carefully.
+
+### 3.1 shrink service ConfigNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 6
```
-## 8. Shrinking the Cluster
+### 3.2 shrink service DataNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-datanode.sh 192.168.132.13:6667
-+ Remove a ConfigNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
-
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 2
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 7
```
-+ Remove a DataNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.3 check the result
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 4
+Execute `show cluster` through Cli, the result is like below:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-
-## 9. Verify Cluster shrinkage
-
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
\ No newline at end of file
diff --git a/src/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md b/src/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md
index 21d19dc..3403bd8 100644
--- a/src/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md
+++ b/src/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md
@@ -19,165 +19,242 @@
-->
-## Quick Start
+# Cluster Quick Start
-This article uses a local environment as an example to
-illustrate how to start, expand, and shrink an IoTDB Cluster.
+The purpose of this article is to show how to start, expand, and shrink an IoTDB cluster in an easy way.
-**Notice: This document is a tutorial for deploying in a pseudo-cluster environment using different local ports, and is for exercise only. In real deployment scenarios, you only need to configure the IPV4 address or domain name of the server, and do not need to change the Node ports.**
+See also:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-### 1. Prepare the Start Environment
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster0 folder.
+## 1. Installation and deployment
-### 2. Start a Minimum Cluster
+As an example, we'd like to start an IoTDB cluster with 3 ConfigNodes and 3 DataNodes(3C3D) with minimum modifications. Thus,
+- the cluster name is defaultCluster
+- data/schema replica is 1
+- the max heap size of ConfigNode take the 1/4 of the computer
+- the max heap size of DataNode take the 1/4 of the computer
-Start the Cluster version with one ConfigNode and one DataNode(1C1D), and
-the default number of replicas is one.
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+Suppose there are 3 computers(3 nodes we called here) with Linux OS and JDK installed(detail see [Prerequisites](../QuickStart/QuickStart.md)) and IoTDB working directory is `/data/iotdb`.
+IP address and configurations is like below:
+
+| Node IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| service | ConfigNode | ConfigNode | ConfigNode |
+| service | DataNode | DataNode | DataNode |
+
+Port:
+
+| Service | ConfigNode | DataNode |
+|---|---|---|
+|port| 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
+
+**illustration:**
+- We could use IP address or hostname/domain to set up an IoTDB cluster, then we would take IP address. If using hostname/domain, `/etc/hosts` must be set well.
+- JVM memory configuration: `MAX_HEAP_SIZE` in `confignode-env.sh` and `datanode-env.sh`, equal to or greater than 1G is recommended. It's enough for ConfigNode taking 1~2G. The memory taking of DataNode is decided by the inputing and querying data.
+
+### 1.1 download
+In every computer, [Download](https://iotdb.apache.org/Download/) the IoTDB install package and extract it to working directory of `/data/iotdb`.
+Then get the directory tree:
+```shell
+/data/iotdb/
+├── conf # configuration files
+├── lib # jar library
+├── sbin # start/stop shell etc.
+└── tools # other tools
```
-### 3. Verify the Minimum Cluster
+### 1.2. configuration
-+ If everything goes well, the minimum cluster will start successfully. Then, we can start the Cli for verification.
+Configuration files are in `/data/iotdb/conf`.
+Modify the specified configuration file according to the table below:
+
+| Configuration| Configuration Option | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**Notice:**
+It's recommended that the configurations of iotdb-common.properties and the heap size of JVM in all nodes are the same.
+
+### 1.3. start IoTDB cluster
+Before starting the IoTDB cluster, make sure the configurations are correct and there is no any data in the working directory.
+
+#### 1.3.1. start the first node
+That is `cn_target_config_node_list` in above configuration table.
+Execute these commands below in node of `192.168.132.10`.
+```shell
+cd /data/iotdb
+# start ConfigNode and DataNode services
+sbin/start-standalone.sh
+
+# check DataNode logs to see whether starting successfully or not
+tail -f logs/log_datanode_all.log
+# expecting statements like below
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-./cluster0/sbin/start-cli.sh
+If there is no such logs mentioned abolve or there are some `Exception`s in log files, it's failed. Then please check `log_confignode_all.log` and `log_datanode_all.log` in directory of `/data/iotdb/logs`.
+
+**Notice**:
+- Make sure the first node, especially the first ConfigNode that `cn_target_config_node_list` specified, starting successfully, and then start the other services.
+- If starting failed,it's necessary to do [cleanup](#【reference】cleanup) before starting again.
+- How to start service ConfigNode or DataNode alone:
+```shell
+# start ConfigNode alone in daemon
+sbin/start-confignode.sh -d
+# start DataNode alone in daemon
+sbin/start-datanode.sh -d
```
-+ Execute the [show cluster details](https://iotdb.apache.org/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#show-all-node-information)
- command on the Cli. The result is shown below:
+#### 1.3.2. start service ConfigNode and DataNode in other nodes
+Execute commands below in both 192.168.132.11 and 192.168.132.12:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+If starting failed, it's necessary to do [cleanup](#【reference】cleanup) in all nodes, and then doging all again from starting the first node.
+
+#### 1.3.3. check the cluster status
+If everything goes well, the cluster will start successfully. Then, we can start the Cli for verification.
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
+**illustration:**
+The IP address of `start-cli.sh -h` could be any IP address of DataNode service.
+
+
+### 【reference】Cleanup
+Execute commands in every node:
+1. End processes of ConfigNode and DataNode
+```shell
+# 1. Stop services ConfigNode and DataNode
+sbin/stop-standalone.sh
+
+# 2. Check whether there are IoTDB processes left or not
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. If there is any IoTDB process left, kill it
+kill -9 <pid>
+# If there is only 1 IoTDB instance, execue command below to remove all IoTDB process
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-### 4. Prepare the Expanding Environment
+2. Remove directories of data and logs
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
+**illustration:**
+It's necessary to remove directory of `data` but it's not necessary to remove directory of `logs`, only for convenience.
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster1 and cluster2 folder.
-### 5. Modify the Node Configuration file
+## 2. Expand
+`Expand` means add services of ConfigNode or DataNode into an existing IoTDB cluster.
-For folder cluster1:
+It's the same as starting the other nodes mentioned above. That is downloading IoTDB install package, extracting, configurating and then starting. The new node here is `192.168.132.13`.
+**Notice**
+- It's must be cleaned up, in other words doing [cleanup](#cleanup) in it.
+- `cluster_name` of `iotdb-common.properties` must be the same to the cluster.
+- `cn_target_config_node_list` and `dn_target_config_node_list` must be the same to the cluster.
+- The old data wouldn't be moved to the new node but the new data would be.
-+ Modify ConfigNode configurations:
+### 2.1. configuration
+Modify the specified configuration file according to the table below:
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
+| Configuration | Configuration Option| IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|-------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-For folder cluster2:
-
-+ Modify ConfigNode configurations:
-
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-### 6. Expanding the Cluster
-
-Expanding the Cluster to three ConfigNode and three DataNode(3C3D).
-The following commands can be executed in arbitrary order.
-
-```
-./cluster1/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster2/sbin/start-datanode.sh
+### 2.2. expand
+Execute commands below in new node of `192.168.132.13`:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-### 7. Verify Cluster expansion
+### 2.3. check the result
+Execute `show cluster` through Cli and the result like below:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+
+## 3. Remove service
+`Shrink` means removing a service from the IoTDB cluster.
+**Notice:**
+- `Shrink` could be done in any node within the cluster
+- Any service could be shrinked within cluster. But the DataNode service of the cluster must greater than the data replica of iotdb-common.properties.
+- Be patient to wait for the end of shrinking, and then read the guide in logs carefully.
+
+### 3.1 shrink service ConfigNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 6
```
-### 8. Shrinking the Cluster
+### 3.2 shrink service DataNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-datanode.sh 192.168.132.13:6667
-+ Remove a ConfigNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
-
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 2
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 7
```
-+ Remove a DataNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.3 check the result
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 4
+Execute `show cluster` through Cli, the result is like below:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-
-### 9. Verify Cluster shrinkage
-
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
\ No newline at end of file
diff --git a/src/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md b/src/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md
index 21d19dc..3403bd8 100644
--- a/src/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md
+++ b/src/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md
@@ -19,165 +19,242 @@
-->
-## Quick Start
+# Cluster Quick Start
-This article uses a local environment as an example to
-illustrate how to start, expand, and shrink an IoTDB Cluster.
+The purpose of this article is to show how to start, expand, and shrink an IoTDB cluster in an easy way.
-**Notice: This document is a tutorial for deploying in a pseudo-cluster environment using different local ports, and is for exercise only. In real deployment scenarios, you only need to configure the IPV4 address or domain name of the server, and do not need to change the Node ports.**
+See also:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-### 1. Prepare the Start Environment
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster0 folder.
+## 1. Installation and deployment
-### 2. Start a Minimum Cluster
+As an example, we'd like to start an IoTDB cluster with 3 ConfigNodes and 3 DataNodes(3C3D) with minimum modifications. Thus,
+- the cluster name is defaultCluster
+- data/schema replica is 1
+- the max heap size of ConfigNode take the 1/4 of the computer
+- the max heap size of DataNode take the 1/4 of the computer
-Start the Cluster version with one ConfigNode and one DataNode(1C1D), and
-the default number of replicas is one.
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+Suppose there are 3 computers(3 nodes we called here) with Linux OS and JDK installed(detail see [Prerequisites](../QuickStart/QuickStart.md)) and IoTDB working directory is `/data/iotdb`.
+IP address and configurations is like below:
+
+| Node IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| service | ConfigNode | ConfigNode | ConfigNode |
+| service | DataNode | DataNode | DataNode |
+
+Port:
+
+| Service | ConfigNode | DataNode |
+|---|---|---|
+|port| 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
+
+**illustration:**
+- We could use IP address or hostname/domain to set up an IoTDB cluster, then we would take IP address. If using hostname/domain, `/etc/hosts` must be set well.
+- JVM memory configuration: `MAX_HEAP_SIZE` in `confignode-env.sh` and `datanode-env.sh`, equal to or greater than 1G is recommended. It's enough for ConfigNode taking 1~2G. The memory taking of DataNode is decided by the inputing and querying data.
+
+### 1.1 download
+In every computer, [Download](https://iotdb.apache.org/Download/) the IoTDB install package and extract it to working directory of `/data/iotdb`.
+Then get the directory tree:
+```shell
+/data/iotdb/
+├── conf # configuration files
+├── lib # jar library
+├── sbin # start/stop shell etc.
+└── tools # other tools
```
-### 3. Verify the Minimum Cluster
+### 1.2. configuration
-+ If everything goes well, the minimum cluster will start successfully. Then, we can start the Cli for verification.
+Configuration files are in `/data/iotdb/conf`.
+Modify the specified configuration file according to the table below:
+
+| Configuration| Configuration Option | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**Notice:**
+It's recommended that the configurations of iotdb-common.properties and the heap size of JVM in all nodes are the same.
+
+### 1.3. start IoTDB cluster
+Before starting the IoTDB cluster, make sure the configurations are correct and there is no any data in the working directory.
+
+#### 1.3.1. start the first node
+That is `cn_target_config_node_list` in above configuration table.
+Execute these commands below in node of `192.168.132.10`.
+```shell
+cd /data/iotdb
+# start ConfigNode and DataNode services
+sbin/start-standalone.sh
+
+# check DataNode logs to see whether starting successfully or not
+tail -f logs/log_datanode_all.log
+# expecting statements like below
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-./cluster0/sbin/start-cli.sh
+If there is no such logs mentioned abolve or there are some `Exception`s in log files, it's failed. Then please check `log_confignode_all.log` and `log_datanode_all.log` in directory of `/data/iotdb/logs`.
+
+**Notice**:
+- Make sure the first node, especially the first ConfigNode that `cn_target_config_node_list` specified, starting successfully, and then start the other services.
+- If starting failed,it's necessary to do [cleanup](#【reference】cleanup) before starting again.
+- How to start service ConfigNode or DataNode alone:
+```shell
+# start ConfigNode alone in daemon
+sbin/start-confignode.sh -d
+# start DataNode alone in daemon
+sbin/start-datanode.sh -d
```
-+ Execute the [show cluster details](https://iotdb.apache.org/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#show-all-node-information)
- command on the Cli. The result is shown below:
+#### 1.3.2. start service ConfigNode and DataNode in other nodes
+Execute commands below in both 192.168.132.11 and 192.168.132.12:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+If starting failed, it's necessary to do [cleanup](#【reference】cleanup) in all nodes, and then doging all again from starting the first node.
+
+#### 1.3.3. check the cluster status
+If everything goes well, the cluster will start successfully. Then, we can start the Cli for verification.
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
+**illustration:**
+The IP address of `start-cli.sh -h` could be any IP address of DataNode service.
+
+
+### 【reference】Cleanup
+Execute commands in every node:
+1. End processes of ConfigNode and DataNode
+```shell
+# 1. Stop services ConfigNode and DataNode
+sbin/stop-standalone.sh
+
+# 2. Check whether there are IoTDB processes left or not
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. If there is any IoTDB process left, kill it
+kill -9 <pid>
+# If there is only 1 IoTDB instance, execue command below to remove all IoTDB process
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-### 4. Prepare the Expanding Environment
+2. Remove directories of data and logs
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
+**illustration:**
+It's necessary to remove directory of `data` but it's not necessary to remove directory of `logs`, only for convenience.
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster1 and cluster2 folder.
-### 5. Modify the Node Configuration file
+## 2. Expand
+`Expand` means add services of ConfigNode or DataNode into an existing IoTDB cluster.
-For folder cluster1:
+It's the same as starting the other nodes mentioned above. That is downloading IoTDB install package, extracting, configurating and then starting. The new node here is `192.168.132.13`.
+**Notice**
+- It's must be cleaned up, in other words doing [cleanup](#cleanup) in it.
+- `cluster_name` of `iotdb-common.properties` must be the same to the cluster.
+- `cn_target_config_node_list` and `dn_target_config_node_list` must be the same to the cluster.
+- The old data wouldn't be moved to the new node but the new data would be.
-+ Modify ConfigNode configurations:
+### 2.1. configuration
+Modify the specified configuration file according to the table below:
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
+| Configuration | Configuration Option| IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|-------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-For folder cluster2:
-
-+ Modify ConfigNode configurations:
-
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-### 6. Expanding the Cluster
-
-Expanding the Cluster to three ConfigNode and three DataNode(3C3D).
-The following commands can be executed in arbitrary order.
-
-```
-./cluster1/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster2/sbin/start-datanode.sh
+### 2.2. expand
+Execute commands below in new node of `192.168.132.13`:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-### 7. Verify Cluster expansion
+### 2.3. check the result
+Execute `show cluster` through Cli and the result like below:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+
+## 3. Remove service
+`Shrink` means removing a service from the IoTDB cluster.
+**Notice:**
+- `Shrink` could be done in any node within the cluster
+- Any service could be shrinked within cluster. But the DataNode service of the cluster must greater than the data replica of iotdb-common.properties.
+- Be patient to wait for the end of shrinking, and then read the guide in logs carefully.
+
+### 3.1 shrink service ConfigNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 6
```
-### 8. Shrinking the Cluster
+### 3.2 shrink service DataNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-datanode.sh 192.168.132.13:6667
-+ Remove a ConfigNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
-
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 2
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 7
```
-+ Remove a DataNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.3 check the result
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 4
+Execute `show cluster` through Cli, the result is like below:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-
-### 9. Verify Cluster shrinkage
-
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
\ No newline at end of file
diff --git a/src/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md b/src/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md
index d4ab2a3..3403bd8 100644
--- a/src/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md
+++ b/src/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md
@@ -21,163 +21,240 @@
# Cluster Quick Start
-This article uses a local environment as an example to
-illustrate how to start, expand, and shrink an IoTDB Cluster.
+The purpose of this article is to show how to start, expand, and shrink an IoTDB cluster in an easy way.
-**Notice: This document is a tutorial for deploying in a pseudo-cluster environment using different local ports, and is for exercise only. In real deployment scenarios, you only need to configure the IPV4 address or domain name of the server, and do not need to change the Node ports.**
+See also:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-## 1. Prepare the Start Environment
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster0 folder.
+## 1. Installation and deployment
-## 2. Start a Minimum Cluster
+As an example, we'd like to start an IoTDB cluster with 3 ConfigNodes and 3 DataNodes(3C3D) with minimum modifications. Thus,
+- the cluster name is defaultCluster
+- data/schema replica is 1
+- the max heap size of ConfigNode take the 1/4 of the computer
+- the max heap size of DataNode take the 1/4 of the computer
-Start the Cluster version with one ConfigNode and one DataNode(1C1D), and
-the default number of replicas is one.
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+Suppose there are 3 computers(3 nodes we called here) with Linux OS and JDK installed(detail see [Prerequisites](../QuickStart/QuickStart.md)) and IoTDB working directory is `/data/iotdb`.
+IP address and configurations is like below:
+
+| Node IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| service | ConfigNode | ConfigNode | ConfigNode |
+| service | DataNode | DataNode | DataNode |
+
+Port:
+
+| Service | ConfigNode | DataNode |
+|---|---|---|
+|port| 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
+
+**illustration:**
+- We could use IP address or hostname/domain to set up an IoTDB cluster, then we would take IP address. If using hostname/domain, `/etc/hosts` must be set well.
+- JVM memory configuration: `MAX_HEAP_SIZE` in `confignode-env.sh` and `datanode-env.sh`, equal to or greater than 1G is recommended. It's enough for ConfigNode taking 1~2G. The memory taking of DataNode is decided by the inputing and querying data.
+
+### 1.1 download
+In every computer, [Download](https://iotdb.apache.org/Download/) the IoTDB install package and extract it to working directory of `/data/iotdb`.
+Then get the directory tree:
+```shell
+/data/iotdb/
+├── conf # configuration files
+├── lib # jar library
+├── sbin # start/stop shell etc.
+└── tools # other tools
```
-## 3. Verify the Minimum Cluster
+### 1.2. configuration
-+ If everything goes well, the minimum cluster will start successfully. Then, we can start the Cli for verification.
+Configuration files are in `/data/iotdb/conf`.
+Modify the specified configuration file according to the table below:
+
+| Configuration| Configuration Option | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**Notice:**
+It's recommended that the configurations of iotdb-common.properties and the heap size of JVM in all nodes are the same.
+
+### 1.3. start IoTDB cluster
+Before starting the IoTDB cluster, make sure the configurations are correct and there is no any data in the working directory.
+
+#### 1.3.1. start the first node
+That is `cn_target_config_node_list` in above configuration table.
+Execute these commands below in node of `192.168.132.10`.
+```shell
+cd /data/iotdb
+# start ConfigNode and DataNode services
+sbin/start-standalone.sh
+
+# check DataNode logs to see whether starting successfully or not
+tail -f logs/log_datanode_all.log
+# expecting statements like below
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-./cluster0/sbin/start-cli.sh
+If there is no such logs mentioned abolve or there are some `Exception`s in log files, it's failed. Then please check `log_confignode_all.log` and `log_datanode_all.log` in directory of `/data/iotdb/logs`.
+
+**Notice**:
+- Make sure the first node, especially the first ConfigNode that `cn_target_config_node_list` specified, starting successfully, and then start the other services.
+- If starting failed,it's necessary to do [cleanup](#【reference】cleanup) before starting again.
+- How to start service ConfigNode or DataNode alone:
+```shell
+# start ConfigNode alone in daemon
+sbin/start-confignode.sh -d
+# start DataNode alone in daemon
+sbin/start-datanode.sh -d
```
-+ Execute the [show cluster details](https://iotdb.apache.org/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#show-all-node-information)
- command on the Cli. The result is shown below:
+#### 1.3.2. start service ConfigNode and DataNode in other nodes
+Execute commands below in both 192.168.132.11 and 192.168.132.12:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+If starting failed, it's necessary to do [cleanup](#【reference】cleanup) in all nodes, and then doging all again from starting the first node.
+
+#### 1.3.3. check the cluster status
+If everything goes well, the cluster will start successfully. Then, we can start the Cli for verification.
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
+**illustration:**
+The IP address of `start-cli.sh -h` could be any IP address of DataNode service.
+
+
+### 【reference】Cleanup
+Execute commands in every node:
+1. End processes of ConfigNode and DataNode
+```shell
+# 1. Stop services ConfigNode and DataNode
+sbin/stop-standalone.sh
+
+# 2. Check whether there are IoTDB processes left or not
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. If there is any IoTDB process left, kill it
+kill -9 <pid>
+# If there is only 1 IoTDB instance, execue command below to remove all IoTDB process
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-## 4. Prepare the Expanding Environment
+2. Remove directories of data and logs
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
+**illustration:**
+It's necessary to remove directory of `data` but it's not necessary to remove directory of `logs`, only for convenience.
-Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster1 and cluster2 folder.
-## 5. Modify the Node Configuration file
+## 2. Expand
+`Expand` means add services of ConfigNode or DataNode into an existing IoTDB cluster.
-For folder cluster1:
+It's the same as starting the other nodes mentioned above. That is downloading IoTDB install package, extracting, configurating and then starting. The new node here is `192.168.132.13`.
+**Notice**
+- It's must be cleaned up, in other words doing [cleanup](#cleanup) in it.
+- `cluster_name` of `iotdb-common.properties` must be the same to the cluster.
+- `cn_target_config_node_list` and `dn_target_config_node_list` must be the same to the cluster.
+- The old data wouldn't be moved to the new node but the new data would be.
-+ Modify ConfigNode configurations:
+### 2.1. configuration
+Modify the specified configuration file according to the table below:
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
+| Configuration | Configuration Option| IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|-------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-For folder cluster2:
-
-+ Modify ConfigNode configurations:
-
-| **configuration item** | **value** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ Modify DataNode configurations:
-
-| **configuration item** | **value** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-## 6. Expanding the Cluster
-
-Expanding the Cluster to three ConfigNode and three DataNode(3C3D).
-The following commands can be executed in arbitrary order.
-
-```
-./cluster1/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster2/sbin/start-datanode.sh
+### 2.2. expand
+Execute commands below in new node of `192.168.132.13`:
+```shell
+cd /data/iotdb
+# start service ConfigNode and DataNode
+sbin/start-standalone.sh
```
-## 7. Verify Cluster expansion
+### 2.3. check the result
+Execute `show cluster` through Cli and the result like below:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# example result:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+
+## 3. Remove service
+`Shrink` means removing a service from the IoTDB cluster.
+**Notice:**
+- `Shrink` could be done in any node within the cluster
+- Any service could be shrinked within cluster. But the DataNode service of the cluster must greater than the data replica of iotdb-common.properties.
+- Be patient to wait for the end of shrinking, and then read the guide in logs carefully.
+
+### 3.1 shrink service ConfigNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 6
```
-## 8. Shrinking the Cluster
+### 3.2 shrink service DataNode
+```shell
+cd /data/iotdb
+# way 1: shrink with ip:port
+sbin/remove-datanode.sh 192.168.132.13:6667
-+ Remove a ConfigNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
-
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 2
+# way 2: shrink with NodeID of `show cluster`
+sbin/remove-confignode.sh 7
```
-+ Remove a DataNode:
-```
-# Removing by ip:port
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.3 check the result
-# Removing by Node index
-./cluster0/sbin/remove-confignode.sh 4
+Execute `show cluster` through Cli, the result is like below:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-
-## 9. Verify Cluster shrinkage
-
-Execute the `show cluster details` command, then the result is shown below:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
\ No newline at end of file
diff --git a/src/zh/UserGuide/Master/QuickStart/ClusterQuickStart.md b/src/zh/UserGuide/Master/QuickStart/ClusterQuickStart.md
index 2a40be1..6eec60a 100644
--- a/src/zh/UserGuide/Master/QuickStart/ClusterQuickStart.md
+++ b/src/zh/UserGuide/Master/QuickStart/ClusterQuickStart.md
@@ -20,162 +20,233 @@
-->
# 集群版
+本文将简单介绍 IoTDB 集群的安装配置、扩容和缩容等常规操作。
+遇到问题可以看:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-以本地环境为例,演示 IoTDB 集群的启动、扩容与缩容。
+## 1. 安装部署
+我们将以最小的改动,启动一个含有3个 ConfigNode 和3个DataNode(3C3D)集群:
+- 数据/元数据副本数为1
+- 集群名称为defaultCluster
+- Confignode JVM 的最大堆内存配置为机器内存的 1/4
+- Datanode JVM 的最大堆内存配置为机器内存的 1/4
-**注意:本文档为使用本地不同端口,进行伪分布式环境部署的教程,仅用于练习。在真实环境部署时,一般不需要修改节点端口,仅需配置节点 IPV4 地址或域名即可。**
+假设有3台物理机(下面称节点),操作系统为Linux,并且已经安装配置好了JAVA环境(具体见[单机版对安装环境说明](../QuickStart/QuickStart.md)),安装目录均为`/data/iotdb`。
+IP地址和服务角色分配如下:
-## 1. 准备启动环境
+| 节点IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| 服务 | ConfigNode | ConfigNode | ConfigNode |
+| 服务 | DataNode | DataNode | DataNode |
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster0 目录。
+端口占用:
-## 2. 启动最小集群
+| 服务 | ConfigNode | DataNode |
+|---|---|---|
+| 端口 | 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
-在 Linux 环境中,部署 1 个 ConfigNode 和 1 个 DataNode(1C1D)集群版,默认 1 副本:
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+**说明:**
+- 可以使用`IP地址`或者`机器名/域名`来安装配置 IoTDB 集群,本文以IP地址为例。如果使用`机器名/域名`,则需要配置`/etc/hosts`。
+- JVM堆内存配置: `confignode-env.sh` 和 `datanode-env.sh` 内配置`MAX_HEAP_SIZE`, 建议设置值大于等于1G。ConfigNode 1~2G就足够了,DataNode的内存配置则要取决于数据接入的数据量和查询数据量。
+
+### 1.1 下载安装包
+在每个节点,将安装包[下载](https://iotdb.apache.org/Download/)后,解压到安装目录,这里为`/data/iotdb`。
+目录结构:
+```shell
+/data/iotdb/
+├── conf # 配置文件
+├── lib # jar library
+├── sbin # 启动/停止等脚本
+└── tools # 其他工具
```
-## 3. 验证最小集群
+### 1.2. 修改节点配置文件
-+ 最小集群启动成功,启动 Cli 进行验证:
-```
-./cluster0/sbin/start-cli.sh
+配置文件在 `/data/iotdb/conf`目录下。
+按照下表修改相应的配置文件:
+
+| 配置| 配置项 | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**注意:**
+我们推荐所有节点的 iotdb-common.properties 和 JVM 的内存配置是一致的。
+
+### 1.3. 启动集群
+启动集群前,需保证配置正确,保证 IoTDB 安装目录下没有数据(`data`目录)。
+#### 1.3.1. 启动第一个节点
+即上面表格中`cn_target_config_node_list`配置的节点。
+登录该节点 192.168.132.10,执行下面命令:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
+
+# 查看 DataNode 日志以确定启动成功
+tail -f logs/log_datanode_all.log
+# 期望看见类似下方的日志
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-+ 在 Cli 执行 [show cluster details](https://iotdb.apache.org/zh/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#%E6%9F%A5%E7%9C%8B%E5%85%A8%E9%83%A8%E8%8A%82%E7%82%B9%E4%BF%A1%E6%81%AF)
- 指令,结果如下所示:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+如果没有看到上面所说的日志或者看到了 Exception,那么代表启动失败了。请查看 `/data/iotdb/logs` 目录内的`log_confignode_all.log` 和 `log_datanode_all.log` 日志文件。
+
+**注意**:
+- 要保证第一个节点启动成功后,再启动其他节点。确切的说,要先保证第一个 ConfigNode 服务启动成功,即`cn_target_config_node_list`配置的节点。
+- 如果启动失败,需要[清理环境](#【附录】清理环境)后,再次启动。
+- ConfigNode 和 DataNode 服务都可以单独启动:
+```shell
+# 单独启动 ConfigNode, 后台启动
+sbin/start-confignode.sh -d
+# 单独启动 DataNode,后台启动
+sbin/start-datanode.sh -d
```
-## 4. 准备扩容环境
-
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster1 目录和 cluster2 目录
-
-## 5. 修改节点配置文件
-
-对于 cluster1 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-对于 cluster2 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-## 6. 集群扩容
-
-将集群扩容至 3 个 ConfigNode 和 3 个 DataNode(3C3D)集群版,
-指令执行顺序为先启动 ConfigNode,再启动 DataNode:
+#### 1.3.2. 启动其他两个节点的 ConfigNode 和 DataNode
+在节点 192.168.132.11 和 192.168.132.12 两个节点上分别执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-./cluster1/sbin/start-confignode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-datanode.sh
+如果启动失败,需要在所有节点执行[清理环境](#【附录】清理环境)后,然后从启动第一个节点开始,再重新执行一次。
+
+#### 1.3.3. 检验集群状态
+在任意节点上,在 Cli 执行 `show cluster`:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+--------------+---------+
+```
+**说明:**
+`start-cli.sh -h` 后指定的IP地址,可以是任意一个 DataNode 的IP地址。
+
+
+### 【附录】清理环境
+在所有节点执行:
+1. 结束 ConfigNode 和 DataNode 进程。
+```shell
+# 1. 停止 ConfigNode 和 DataNode 服务
+sbin/stop-standalone.sh
+
+# 2. 检查是否还有进程残留
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. 如果有进程残留,则手动kill
+kill -9 <pid>
+# 如果确定机器上仅有1个iotdb,可以使用下面命令清理残留进程
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-## 7. 验证扩容结果
+2. 删除 data 和 logs 目录。
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
-在 Cli 执行 `show cluster details`,结果如下:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+说明:删除 data 目录是必要的,删除 logs 目录是为了纯净日志,非必需。
+
+
+## 2. 集群扩容
+扩容方式与上方启动其他节点相同。也就是,在要添加的节点上,下载IoTDB的安装包,解压,修改配置,然后启动。这里要添加节点的IP为 `192.168.132.13`
+**注意:**
+- 扩容的节点必须是干净的节点,不能有数据(也就是`data`目录)
+- iotdb-common.properties中的`cluster_name`的配置必须和已有集群一致。
+- `cn_target_config_node_list` 和 `dn_target_config_node_list`的配置必须和已有集群一致。
+- 原有数据不会移动到新节点,新创建的元数据分区和数据分区很可能在新的节点。
+
+### 2.1. 修改配置
+按照下表修改相应的配置文件:
+
+| 配置 | 配置项 | IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
+
+### 2.2. 扩容
+在新增节点`192.168.132.13`上,执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-## 8. 集群缩容
+### 2.3. 验证扩容结果
+在 Cli 执行 `show cluster`,结果如下:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-+ 缩容一个 ConfigNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
+## 3. 集群缩容
+**注意:**
+- 可以在任何一个集群内的节点上,执行缩容操作。
+- 集群内的任意节点都可以被缩容。但是存留的 DataNode 服务不能小于副本数设置。
+- 请耐心等待缩容脚本执行结束,并仔细阅读日志说明,尤其是结束前的指南说明。
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 2
+### 3.1 缩容一个 ConfigNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 6
```
-+ 缩容一个 DataNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.2 缩容一个 DataNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-datanode.sh 192.168.132.13:6667
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 4
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 7
```
-## 9. 验证缩容结果
+### 3.3 验证缩容结果
-在 Cli 执行 `show cluster details`,结果如下:
+在 Cli 执行 `show cluster`,结果如下:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
-
diff --git a/src/zh/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md b/src/zh/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md
index 35e543c..6eec60a 100644
--- a/src/zh/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md
+++ b/src/zh/UserGuide/V1.0.x/QuickStart/ClusterQuickStart.md
@@ -19,162 +19,234 @@
-->
-# 快速上手
+# 集群版
+本文将简单介绍 IoTDB 集群的安装配置、扩容和缩容等常规操作。
+遇到问题可以看:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-以本地环境为例,演示 IoTDB 集群的启动、扩容与缩容。
+## 1. 安装部署
+我们将以最小的改动,启动一个含有3个 ConfigNode 和3个DataNode(3C3D)集群:
+- 数据/元数据副本数为1
+- 集群名称为defaultCluster
+- Confignode JVM 的最大堆内存配置为机器内存的 1/4
+- Datanode JVM 的最大堆内存配置为机器内存的 1/4
-**注意:本文档为使用本地不同端口,进行伪分布式环境部署的教程,仅用于练习。在真实环境部署时,一般不需要修改节点端口,仅需配置节点 IPV4 地址或域名即可。**
+假设有3台物理机(下面称节点),操作系统为Linux,并且已经安装配置好了JAVA环境(具体见[单机版对安装环境说明](../QuickStart/QuickStart.md)),安装目录均为`/data/iotdb`。
+IP地址和服务角色分配如下:
-## 1. 准备启动环境
+| 节点IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| 服务 | ConfigNode | ConfigNode | ConfigNode |
+| 服务 | DataNode | DataNode | DataNode |
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster0 目录。
+端口占用:
-## 2. 启动最小集群
+| 服务 | ConfigNode | DataNode |
+|---|---|---|
+| 端口 | 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
-在 Linux 环境中,部署 1 个 ConfigNode 和 1 个 DataNode(1C1D)集群版,默认 1 副本:
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+**说明:**
+- 可以使用`IP地址`或者`机器名/域名`来安装配置 IoTDB 集群,本文以IP地址为例。如果使用`机器名/域名`,则需要配置`/etc/hosts`。
+- JVM堆内存配置: `confignode-env.sh` 和 `datanode-env.sh` 内配置`MAX_HEAP_SIZE`, 建议设置值大于等于1G。ConfigNode 1~2G就足够了,DataNode的内存配置则要取决于数据接入的数据量和查询数据量。
+
+### 1.1 下载安装包
+在每个节点,将安装包[下载](https://iotdb.apache.org/Download/)后,解压到安装目录,这里为`/data/iotdb`。
+目录结构:
+```shell
+/data/iotdb/
+├── conf # 配置文件
+├── lib # jar library
+├── sbin # 启动/停止等脚本
+└── tools # 其他工具
```
-## 3. 验证最小集群
+### 1.2. 修改节点配置文件
-+ 最小集群启动成功,启动 Cli 进行验证:
-```
-./cluster0/sbin/start-cli.sh
+配置文件在 `/data/iotdb/conf`目录下。
+按照下表修改相应的配置文件:
+
+| 配置| 配置项 | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**注意:**
+我们推荐所有节点的 iotdb-common.properties 和 JVM 的内存配置是一致的。
+
+### 1.3. 启动集群
+启动集群前,需保证配置正确,保证 IoTDB 安装目录下没有数据(`data`目录)。
+#### 1.3.1. 启动第一个节点
+即上面表格中`cn_target_config_node_list`配置的节点。
+登录该节点 192.168.132.10,执行下面命令:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
+
+# 查看 DataNode 日志以确定启动成功
+tail -f logs/log_datanode_all.log
+# 期望看见类似下方的日志
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-+ 在 Cli 执行 [show cluster details](https://iotdb.apache.org/zh/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#%E6%9F%A5%E7%9C%8B%E5%85%A8%E9%83%A8%E8%8A%82%E7%82%B9%E4%BF%A1%E6%81%AF)
- 指令,结果如下所示:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+如果没有看到上面所说的日志或者看到了 Exception,那么代表启动失败了。请查看 `/data/iotdb/logs` 目录内的`log_confignode_all.log` 和 `log_datanode_all.log` 日志文件。
+
+**注意**:
+- 要保证第一个节点启动成功后,再启动其他节点。确切的说,要先保证第一个 ConfigNode 服务启动成功,即`cn_target_config_node_list`配置的节点。
+- 如果启动失败,需要[清理环境](#【附录】清理环境)后,再次启动。
+- ConfigNode 和 DataNode 服务都可以单独启动:
+```shell
+# 单独启动 ConfigNode, 后台启动
+sbin/start-confignode.sh -d
+# 单独启动 DataNode,后台启动
+sbin/start-datanode.sh -d
```
-## 4. 准备扩容环境
-
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster1 目录和 cluster2 目录
-
-## 5. 修改节点配置文件
-
-对于 cluster1 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-对于 cluster2 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-## 6. 集群扩容
-
-将集群扩容至 3 个 ConfigNode 和 3 个 DataNode(3C3D)集群版,
-指令执行顺序为先启动 ConfigNode,再启动 DataNode:
+#### 1.3.2. 启动其他两个节点的 ConfigNode 和 DataNode
+在节点 192.168.132.11 和 192.168.132.12 两个节点上分别执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-./cluster1/sbin/start-confignode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-datanode.sh
+如果启动失败,需要在所有节点执行[清理环境](#【附录】清理环境)后,然后从启动第一个节点开始,再重新执行一次。
+
+#### 1.3.3. 检验集群状态
+在任意节点上,在 Cli 执行 `show cluster`:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+--------------+---------+
+```
+**说明:**
+`start-cli.sh -h` 后指定的IP地址,可以是任意一个 DataNode 的IP地址。
+
+
+### 【附录】清理环境
+在所有节点执行:
+1. 结束 ConfigNode 和 DataNode 进程。
+```shell
+# 1. 停止 ConfigNode 和 DataNode 服务
+sbin/stop-standalone.sh
+
+# 2. 检查是否还有进程残留
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. 如果有进程残留,则手动kill
+kill -9 <pid>
+# 如果确定机器上仅有1个iotdb,可以使用下面命令清理残留进程
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-## 7. 验证扩容结果
+2. 删除 data 和 logs 目录。
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
-在 Cli 执行 `show cluster details`,结果如下:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+说明:删除 data 目录是必要的,删除 logs 目录是为了纯净日志,非必需。
+
+
+## 2. 集群扩容
+扩容方式与上方启动其他节点相同。也就是,在要添加的节点上,下载IoTDB的安装包,解压,修改配置,然后启动。这里要添加节点的IP为 `192.168.132.13`
+**注意:**
+- 扩容的节点必须是干净的节点,不能有数据(也就是`data`目录)
+- iotdb-common.properties中的`cluster_name`的配置必须和已有集群一致。
+- `cn_target_config_node_list` 和 `dn_target_config_node_list`的配置必须和已有集群一致。
+- 原有数据不会移动到新节点,新创建的元数据分区和数据分区很可能在新的节点。
+
+### 2.1. 修改配置
+按照下表修改相应的配置文件:
+
+| 配置 | 配置项 | IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
+
+### 2.2. 扩容
+在新增节点`192.168.132.13`上,执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-## 8. 集群缩容
+### 2.3. 验证扩容结果
+在 Cli 执行 `show cluster`,结果如下:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-+ 缩容一个 ConfigNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
+## 3. 集群缩容
+**注意:**
+- 可以在任何一个集群内的节点上,执行缩容操作。
+- 集群内的任意节点都可以被缩容。但是存留的 DataNode 服务不能小于副本数设置。
+- 请耐心等待缩容脚本执行结束,并仔细阅读日志说明,尤其是结束前的指南说明。
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 2
+### 3.1 缩容一个 ConfigNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 6
```
-+ 缩容一个 DataNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.2 缩容一个 DataNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-datanode.sh 192.168.132.13:6667
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 4
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 7
```
-## 9. 验证缩容结果
+### 3.3 验证缩容结果
-在 Cli 执行 `show cluster details`,结果如下:
+在 Cli 执行 `show cluster`,结果如下:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
\ No newline at end of file
diff --git a/src/zh/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md b/src/zh/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md
index ab11f3a..6eec60a 100644
--- a/src/zh/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md
+++ b/src/zh/UserGuide/V1.1.x/QuickStart/ClusterQuickStart.md
@@ -19,162 +19,234 @@
-->
-## 集群快速上手
+# 集群版
+本文将简单介绍 IoTDB 集群的安装配置、扩容和缩容等常规操作。
+遇到问题可以看:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-以本地环境为例,演示 IoTDB 集群的启动、扩容与缩容。
+## 1. 安装部署
+我们将以最小的改动,启动一个含有3个 ConfigNode 和3个DataNode(3C3D)集群:
+- 数据/元数据副本数为1
+- 集群名称为defaultCluster
+- Confignode JVM 的最大堆内存配置为机器内存的 1/4
+- Datanode JVM 的最大堆内存配置为机器内存的 1/4
-**注意:本文档为使用本地不同端口,进行伪分布式环境部署的教程,仅用于练习。在真实环境部署时,一般不需要修改节点端口,仅需配置节点 IPV4 地址或域名即可。**
+假设有3台物理机(下面称节点),操作系统为Linux,并且已经安装配置好了JAVA环境(具体见[单机版对安装环境说明](../QuickStart/QuickStart.md)),安装目录均为`/data/iotdb`。
+IP地址和服务角色分配如下:
-### 1. 准备启动环境
+| 节点IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| 服务 | ConfigNode | ConfigNode | ConfigNode |
+| 服务 | DataNode | DataNode | DataNode |
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster0 目录。
+端口占用:
-### 2. 启动最小集群
+| 服务 | ConfigNode | DataNode |
+|---|---|---|
+| 端口 | 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
-在 Linux 环境中,部署 1 个 ConfigNode 和 1 个 DataNode(1C1D)集群版,默认 1 副本:
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+**说明:**
+- 可以使用`IP地址`或者`机器名/域名`来安装配置 IoTDB 集群,本文以IP地址为例。如果使用`机器名/域名`,则需要配置`/etc/hosts`。
+- JVM堆内存配置: `confignode-env.sh` 和 `datanode-env.sh` 内配置`MAX_HEAP_SIZE`, 建议设置值大于等于1G。ConfigNode 1~2G就足够了,DataNode的内存配置则要取决于数据接入的数据量和查询数据量。
+
+### 1.1 下载安装包
+在每个节点,将安装包[下载](https://iotdb.apache.org/Download/)后,解压到安装目录,这里为`/data/iotdb`。
+目录结构:
+```shell
+/data/iotdb/
+├── conf # 配置文件
+├── lib # jar library
+├── sbin # 启动/停止等脚本
+└── tools # 其他工具
```
-### 3. 验证最小集群
+### 1.2. 修改节点配置文件
-+ 最小集群启动成功,启动 Cli 进行验证:
-```
-./cluster0/sbin/start-cli.sh
+配置文件在 `/data/iotdb/conf`目录下。
+按照下表修改相应的配置文件:
+
+| 配置| 配置项 | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**注意:**
+我们推荐所有节点的 iotdb-common.properties 和 JVM 的内存配置是一致的。
+
+### 1.3. 启动集群
+启动集群前,需保证配置正确,保证 IoTDB 安装目录下没有数据(`data`目录)。
+#### 1.3.1. 启动第一个节点
+即上面表格中`cn_target_config_node_list`配置的节点。
+登录该节点 192.168.132.10,执行下面命令:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
+
+# 查看 DataNode 日志以确定启动成功
+tail -f logs/log_datanode_all.log
+# 期望看见类似下方的日志
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-+ 在 Cli 执行 [show cluster details](https://iotdb.apache.org/zh/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#%E6%9F%A5%E7%9C%8B%E5%85%A8%E9%83%A8%E8%8A%82%E7%82%B9%E4%BF%A1%E6%81%AF)
- 指令,结果如下所示:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+如果没有看到上面所说的日志或者看到了 Exception,那么代表启动失败了。请查看 `/data/iotdb/logs` 目录内的`log_confignode_all.log` 和 `log_datanode_all.log` 日志文件。
+
+**注意**:
+- 要保证第一个节点启动成功后,再启动其他节点。确切的说,要先保证第一个 ConfigNode 服务启动成功,即`cn_target_config_node_list`配置的节点。
+- 如果启动失败,需要[清理环境](#【附录】清理环境)后,再次启动。
+- ConfigNode 和 DataNode 服务都可以单独启动:
+```shell
+# 单独启动 ConfigNode, 后台启动
+sbin/start-confignode.sh -d
+# 单独启动 DataNode,后台启动
+sbin/start-datanode.sh -d
```
-### 4. 准备扩容环境
-
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster1 目录和 cluster2 目录
-
-### 5. 修改节点配置文件
-
-对于 cluster1 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-对于 cluster2 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-### 6. 集群扩容
-
-将集群扩容至 3 个 ConfigNode 和 3 个 DataNode(3C3D)集群版,
-指令执行顺序为先启动 ConfigNode,再启动 DataNode:
+#### 1.3.2. 启动其他两个节点的 ConfigNode 和 DataNode
+在节点 192.168.132.11 和 192.168.132.12 两个节点上分别执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-./cluster1/sbin/start-confignode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-datanode.sh
+如果启动失败,需要在所有节点执行[清理环境](#【附录】清理环境)后,然后从启动第一个节点开始,再重新执行一次。
+
+#### 1.3.3. 检验集群状态
+在任意节点上,在 Cli 执行 `show cluster`:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+--------------+---------+
+```
+**说明:**
+`start-cli.sh -h` 后指定的IP地址,可以是任意一个 DataNode 的IP地址。
+
+
+### 【附录】清理环境
+在所有节点执行:
+1. 结束 ConfigNode 和 DataNode 进程。
+```shell
+# 1. 停止 ConfigNode 和 DataNode 服务
+sbin/stop-standalone.sh
+
+# 2. 检查是否还有进程残留
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. 如果有进程残留,则手动kill
+kill -9 <pid>
+# 如果确定机器上仅有1个iotdb,可以使用下面命令清理残留进程
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-### 7. 验证扩容结果
+2. 删除 data 和 logs 目录。
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
-在 Cli 执行 `show cluster details`,结果如下:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+说明:删除 data 目录是必要的,删除 logs 目录是为了纯净日志,非必需。
+
+
+## 2. 集群扩容
+扩容方式与上方启动其他节点相同。也就是,在要添加的节点上,下载IoTDB的安装包,解压,修改配置,然后启动。这里要添加节点的IP为 `192.168.132.13`
+**注意:**
+- 扩容的节点必须是干净的节点,不能有数据(也就是`data`目录)
+- iotdb-common.properties中的`cluster_name`的配置必须和已有集群一致。
+- `cn_target_config_node_list` 和 `dn_target_config_node_list`的配置必须和已有集群一致。
+- 原有数据不会移动到新节点,新创建的元数据分区和数据分区很可能在新的节点。
+
+### 2.1. 修改配置
+按照下表修改相应的配置文件:
+
+| 配置 | 配置项 | IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
+
+### 2.2. 扩容
+在新增节点`192.168.132.13`上,执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-### 8. 集群缩容
+### 2.3. 验证扩容结果
+在 Cli 执行 `show cluster`,结果如下:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-+ 缩容一个 ConfigNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
+## 3. 集群缩容
+**注意:**
+- 可以在任何一个集群内的节点上,执行缩容操作。
+- 集群内的任意节点都可以被缩容。但是存留的 DataNode 服务不能小于副本数设置。
+- 请耐心等待缩容脚本执行结束,并仔细阅读日志说明,尤其是结束前的指南说明。
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 2
+### 3.1 缩容一个 ConfigNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 6
```
-+ 缩容一个 DataNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.2 缩容一个 DataNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-datanode.sh 192.168.132.13:6667
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 4
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 7
```
-### 9. 验证缩容结果
+### 3.3 验证缩容结果
-在 Cli 执行 `show cluster details`,结果如下:
+在 Cli 执行 `show cluster`,结果如下:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
\ No newline at end of file
diff --git a/src/zh/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md b/src/zh/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md
index 2a40be1..6eec60a 100644
--- a/src/zh/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md
+++ b/src/zh/UserGuide/V1.2.x/QuickStart/ClusterQuickStart.md
@@ -20,162 +20,233 @@
-->
# 集群版
+本文将简单介绍 IoTDB 集群的安装配置、扩容和缩容等常规操作。
+遇到问题可以看:
+[FAQ](../FAQ/Frequently-asked-questions.md)
-以本地环境为例,演示 IoTDB 集群的启动、扩容与缩容。
+## 1. 安装部署
+我们将以最小的改动,启动一个含有3个 ConfigNode 和3个DataNode(3C3D)集群:
+- 数据/元数据副本数为1
+- 集群名称为defaultCluster
+- Confignode JVM 的最大堆内存配置为机器内存的 1/4
+- Datanode JVM 的最大堆内存配置为机器内存的 1/4
-**注意:本文档为使用本地不同端口,进行伪分布式环境部署的教程,仅用于练习。在真实环境部署时,一般不需要修改节点端口,仅需配置节点 IPV4 地址或域名即可。**
+假设有3台物理机(下面称节点),操作系统为Linux,并且已经安装配置好了JAVA环境(具体见[单机版对安装环境说明](../QuickStart/QuickStart.md)),安装目录均为`/data/iotdb`。
+IP地址和服务角色分配如下:
-## 1. 准备启动环境
+| 节点IP | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+|--------|:---------------|:---------------|:---------------|
+| 服务 | ConfigNode | ConfigNode | ConfigNode |
+| 服务 | DataNode | DataNode | DataNode |
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster0 目录。
+端口占用:
-## 2. 启动最小集群
+| 服务 | ConfigNode | DataNode |
+|---|---|---|
+| 端口 | 10710, 10720 | 6667, 10730, 10740, 10750, 10760 |
-在 Linux 环境中,部署 1 个 ConfigNode 和 1 个 DataNode(1C1D)集群版,默认 1 副本:
-```
-./cluster0/sbin/start-confignode.sh
-./cluster0/sbin/start-datanode.sh
+**说明:**
+- 可以使用`IP地址`或者`机器名/域名`来安装配置 IoTDB 集群,本文以IP地址为例。如果使用`机器名/域名`,则需要配置`/etc/hosts`。
+- JVM堆内存配置: `confignode-env.sh` 和 `datanode-env.sh` 内配置`MAX_HEAP_SIZE`, 建议设置值大于等于1G。ConfigNode 1~2G就足够了,DataNode的内存配置则要取决于数据接入的数据量和查询数据量。
+
+### 1.1 下载安装包
+在每个节点,将安装包[下载](https://iotdb.apache.org/Download/)后,解压到安装目录,这里为`/data/iotdb`。
+目录结构:
+```shell
+/data/iotdb/
+├── conf # 配置文件
+├── lib # jar library
+├── sbin # 启动/停止等脚本
+└── tools # 其他工具
```
-## 3. 验证最小集群
+### 1.2. 修改节点配置文件
-+ 最小集群启动成功,启动 Cli 进行验证:
-```
-./cluster0/sbin/start-cli.sh
+配置文件在 `/data/iotdb/conf`目录下。
+按照下表修改相应的配置文件:
+
+| 配置| 配置项 | IP:192.168.132.10 | IP:192.168.132.11 | IP:192.168.132.12 |
+|------------|:-------------------------------|----------------------|----------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_internal\_address | 192.168.132.10 | 192.168.132.11 | 192.168.132.12 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 | 192.168.132.10:10710 | 192.168.132.10:10710 |
+
+**注意:**
+我们推荐所有节点的 iotdb-common.properties 和 JVM 的内存配置是一致的。
+
+### 1.3. 启动集群
+启动集群前,需保证配置正确,保证 IoTDB 安装目录下没有数据(`data`目录)。
+#### 1.3.1. 启动第一个节点
+即上面表格中`cn_target_config_node_list`配置的节点。
+登录该节点 192.168.132.10,执行下面命令:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
+
+# 查看 DataNode 日志以确定启动成功
+tail -f logs/log_datanode_all.log
+# 期望看见类似下方的日志
+# 2023-07-21 20:26:01,881 [main] INFO o.a.i.db.service.DataNode:192 - Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!
```
-+ 在 Cli 执行 [show cluster details](https://iotdb.apache.org/zh/UserGuide/Master/Maintenance-Tools/Maintenance-Command.html#%E6%9F%A5%E7%9C%8B%E5%85%A8%E9%83%A8%E8%8A%82%E7%82%B9%E4%BF%A1%E6%81%AF)
- 指令,结果如下所示:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort |SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+--------+-------------------+-----------------+
-Total line number = 2
-It costs 0.242s
+如果没有看到上面所说的日志或者看到了 Exception,那么代表启动失败了。请查看 `/data/iotdb/logs` 目录内的`log_confignode_all.log` 和 `log_datanode_all.log` 日志文件。
+
+**注意**:
+- 要保证第一个节点启动成功后,再启动其他节点。确切的说,要先保证第一个 ConfigNode 服务启动成功,即`cn_target_config_node_list`配置的节点。
+- 如果启动失败,需要[清理环境](#【附录】清理环境)后,再次启动。
+- ConfigNode 和 DataNode 服务都可以单独启动:
+```shell
+# 单独启动 ConfigNode, 后台启动
+sbin/start-confignode.sh -d
+# 单独启动 DataNode,后台启动
+sbin/start-datanode.sh -d
```
-## 4. 准备扩容环境
-
-解压 apache-iotdb-1.0.0-all-bin.zip 至 cluster1 目录和 cluster2 目录
-
-## 5. 修改节点配置文件
-
-对于 cluster1 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10711 |
-| cn\_consensus\_port | 10721 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|----------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6668 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10731 |
-| dn\_mpp\_data\_exchange\_port | 10741 |
-| dn\_schema\_region\_consensus\_port | 10751 |
-| dn\_data\_region\_consensus\_port | 10761 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-对于 cluster2 目录:
-
-+ 修改 ConfigNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------|-----------------|
-| cn\_internal\_address | 127.0.0.1 |
-| cn\_internal\_port | 10712 |
-| cn\_consensus\_port | 10722 |
-| cn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-+ 修改 DataNode 配置:
-
-| **配置项** | **值** |
-|--------------------------------------|-----------------|
-| dn\_rpc\_address | 127.0.0.1 |
-| dn\_rpc\_port | 6669 |
-| dn\_internal\_address | 127.0.0.1 |
-| dn\_internal\_port | 10732 |
-| dn\_mpp\_data\_exchange\_port | 10742 |
-| dn\_schema\_region\_consensus\_port | 10752 |
-| dn\_data\_region\_consensus\_port | 10762 |
-| dn\_target\_config\_node\_list | 127.0.0.1:10710 |
-
-## 6. 集群扩容
-
-将集群扩容至 3 个 ConfigNode 和 3 个 DataNode(3C3D)集群版,
-指令执行顺序为先启动 ConfigNode,再启动 DataNode:
+#### 1.3.2. 启动其他两个节点的 ConfigNode 和 DataNode
+在节点 192.168.132.11 和 192.168.132.12 两个节点上分别执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-./cluster1/sbin/start-confignode.sh
-./cluster2/sbin/start-confignode.sh
-./cluster1/sbin/start-datanode.sh
-./cluster2/sbin/start-datanode.sh
+如果启动失败,需要在所有节点执行[清理环境](#【附录】清理环境)后,然后从启动第一个节点开始,再重新执行一次。
+
+#### 1.3.3. 检验集群状态
+在任意节点上,在 Cli 执行 `show cluster`:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+--------------+---------+
+```
+**说明:**
+`start-cli.sh -h` 后指定的IP地址,可以是任意一个 DataNode 的IP地址。
+
+
+### 【附录】清理环境
+在所有节点执行:
+1. 结束 ConfigNode 和 DataNode 进程。
+```shell
+# 1. 停止 ConfigNode 和 DataNode 服务
+sbin/stop-standalone.sh
+
+# 2. 检查是否还有进程残留
+jps
+# 或者
+ps -ef|gerp iotdb
+
+# 3. 如果有进程残留,则手动kill
+kill -9 <pid>
+# 如果确定机器上仅有1个iotdb,可以使用下面命令清理残留进程
+ps -ef|grep iotdb|grep -v grep|tr -s ' ' ' ' |cut -d ' ' -f2|xargs kill -9
```
-## 7. 验证扩容结果
+2. 删除 data 和 logs 目录。
+```shell
+cd /data/iotdb
+rm -rf data logs
+```
-在 Cli 执行 `show cluster details`,结果如下:
-```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 2|ConfigNode|Running| 127.0.0.1| 10711| 10721| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 4| DataNode|Running| 127.0.0.1| 10731| | 127.0.0.1| 6668| 10741| 10751| 10761|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 6
-It costs 0.012s
+说明:删除 data 目录是必要的,删除 logs 目录是为了纯净日志,非必需。
+
+
+## 2. 集群扩容
+扩容方式与上方启动其他节点相同。也就是,在要添加的节点上,下载IoTDB的安装包,解压,修改配置,然后启动。这里要添加节点的IP为 `192.168.132.13`
+**注意:**
+- 扩容的节点必须是干净的节点,不能有数据(也就是`data`目录)
+- iotdb-common.properties中的`cluster_name`的配置必须和已有集群一致。
+- `cn_target_config_node_list` 和 `dn_target_config_node_list`的配置必须和已有集群一致。
+- 原有数据不会移动到新节点,新创建的元数据分区和数据分区很可能在新的节点。
+
+### 2.1. 修改配置
+按照下表修改相应的配置文件:
+
+| 配置 | 配置项 | IP:192.168.132.13 |
+|------------|:-------------------------------|:---------------------|
+| iotdb-confignode.properties | cn\_internal\_address | 192.168.132.13 |
+| | cn\_target\_config\_node\_list | 192.168.132.10:10710 |
+| iotdb-datanode.properties | dn\_rpc\_address | 192.168.132.13 |
+| | dn\_internal\_address | 192.168.132.13 |
+| | dn\_target\_config\_node\_list | 192.168.132.10:10710 |
+
+### 2.2. 扩容
+在新增节点`192.168.132.13`上,执行:
+```shell
+cd /data/iotdb
+# 启动 ConfigNode 和 DataNode 服务
+sbin/start-standalone.sh
```
-## 8. 集群缩容
+### 2.3. 验证扩容结果
+在 Cli 执行 `show cluster`,结果如下:
+```shell
+/data/iotdb/sbin/start-cli.sh -h 192.168.132.10
+IoTDB>show cluster;
+# 示例结果如下:
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
+| 6|ConfigNode|Running| 192.168.132.13| 10710|1.x.x | xxxxxxx|
+| 7| DataNode|Running| 192.168.132.13| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
+```
-+ 缩容一个 ConfigNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-confignode.sh 127.0.0.1:10711
+## 3. 集群缩容
+**注意:**
+- 可以在任何一个集群内的节点上,执行缩容操作。
+- 集群内的任意节点都可以被缩容。但是存留的 DataNode 服务不能小于副本数设置。
+- 请耐心等待缩容脚本执行结束,并仔细阅读日志说明,尤其是结束前的指南说明。
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 2
+### 3.1 缩容一个 ConfigNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-confignode.sh 192.168.132.13:10710
+
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 6
```
-+ 缩容一个 DataNode:
-```
-# 使用 ip:port 移除
-./cluster0/sbin/remove-datanode.sh 127.0.0.1:6668
+### 3.2 缩容一个 DataNode
+```shell
+cd /data/iotdb
+# 方式一:使用 ip:port 移除
+sbin/remove-datanode.sh 192.168.132.13:6667
-# 使用节点编号移除
-./cluster0/sbin/remove-confignode.sh 4
+# 方式二:使用节点编号移除, `show cluster`中的 NodeID
+sbin/remove-confignode.sh 7
```
-## 9. 验证缩容结果
+### 3.3 验证缩容结果
-在 Cli 执行 `show cluster details`,结果如下:
+在 Cli 执行 `show cluster`,结果如下:
+```shell
++------+----------+-------+---------------+------------+-------+---------+
+|NodeID| NodeType| Status|InternalAddress|InternalPort|Version|BuildInfo|
++------+----------+-------+---------------+------------+-------+---------+
+| 0|ConfigNode|Running| 192.168.132.10| 10710|1.x.x | xxxxxxx|
+| 1| DataNode|Running| 192.168.132.10| 10730|1.x.x | xxxxxxx|
+| 2|ConfigNode|Running| 192.168.132.11| 10710|1.x.x | xxxxxxx|
+| 3| DataNode|Running| 192.168.132.11| 10730|1.x.x | xxxxxxx|
+| 4|ConfigNode|Running| 192.168.132.12| 10710|1.x.x | xxxxxxx|
+| 5| DataNode|Running| 192.168.132.12| 10730|1.x.x | xxxxxxx|
++------+----------+-------+---------------+------------+-------+---------+
```
-IoTDB> show cluster details
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-|NodeID| NodeType| Status|InternalAddress|InternalPort|ConfigConsensusPort|RpcAddress|RpcPort|MppPort|SchemaConsensusPort|DataConsensusPort|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-| 0|ConfigNode|Running| 127.0.0.1| 10710| 10720| | | | | |
-| 3|ConfigNode|Running| 127.0.0.1| 10712| 10722| | | | | |
-| 1| DataNode|Running| 127.0.0.1| 10730| | 127.0.0.1| 6667| 10740| 10750| 10760|
-| 5| DataNode|Running| 127.0.0.1| 10732| | 127.0.0.1| 6669| 10742| 10752| 10762|
-+------+----------+-------+---------------+------------+-------------------+----------+-------+-------+-------------------+-----------------+
-Total line number = 4
-It costs 0.005s
-```
-