Skip to main content

Cluster Deployment

...About 4 min

Cluster Deployment

This section will take the IoTDB classic cluster deployment architecture 3C3D (3 ConfigNodes and 3 DataNodes) as an example to introduce how to deploy a cluster, commonly known as the 3C3D cluster. The architecture diagram of the 3C3D cluster is as follows:

Note

  1. It is recommended to prioritize using hostname for IP configuration during deployment, which can avoid the problem of modifying the host IP in the later stage and causing the database to fail to start. To set the host name, you need to configure /etc/hosts on the target server. For example, if the local IP is 192.168.1.3 and the host name is iotdb-1, you can use the following command to set the server's host name and configure the cn_internal_address and dn_internal_address of IoTDB using the host name.

    echo "192.168.1.3  iotdb-1" >> /etc/hosts 
    
  2. Some parameters cannot be modified after the first startup. Please refer to the "Parameter Configuration" section below for settings.

Preparation Steps

  1. Prepare the IoTDB database installation package::apache-iotdb-{version}-all-bin.zip(Please refer to the installation package for details:IoTDB-Packageopen in new window

  2. Configure the operating system environment according to environmental requirements (system environment configuration can be found in:Environment Requirementsopen in new window)

Installation Steps

Assuming there are three Linux servers now, the IP addresses and service roles are assigned as follows:

Node IPHost NameService
192.168.1.3iotdb-1ConfigNode、DataNode
192.168.1.4iotdb-2ConfigNode、DataNode
192.168.1.5iotdb-3ConfigNode、DataNode

1. Set Host Name

On three machines, configure the host names separately. To set the host names, configure /etc/hosts on the target server. Use the following command:

echo "192.168.1.3  iotdb-1"  >> /etc/hosts
echo "192.168.1.4  iotdb-2"  >> /etc/hosts
echo "192.168.1.5  iotdb-3"  >> /etc/hosts 

2. Configuration

Unzip the installation package and enter the installation directory

unzip  apache-iotdb-{version}-all-bin.zip 
cd  apache-iotdb-{version}-all-bin

Environment Script Configuration

  • ./conf/confignode-env.sh configuration
配置项DescriptionDefaultRecommended valueNote
MEMORY_SIZEThe total amount of memory that IoTDB ConfigNode nodes can use-Can be filled in as needed, and the system will allocate memory based on the filled in valuesRestarting the service takes effect
  • ./conf/datanode-env.sh configuration
ConfigurationDescriptionDefaultRecommended valueNote
MEMORY_SIZEThe total amount of memory that IoTDB DataNode nodes can use-Can be filled in as needed, and the system will allocate memory based on the filled in valuesRestarting the service takes effect

General Configuration

Open the general configuration file ./conf/iotdb-common.properties, The following parameters can be set according to the deployment method:

ConfigurationDescription192.168.1.3192.168.1.4192.168.1.5
cluster_nameCluster NamedefaultClusterdefaultClusterdefaultCluster
schema_replication_factorThe number of metadata replicas, the number of DataNodes should not be less than this number333
data_replication_factorThe number of data replicas should not be less than this number of DataNodes222

ConfigNode Configuration

Open the ConfigNode configuration file ./conf/iotdb-confignode.properties, Set the following parameters

ConfigurationDescriptionDefaultRecommended value192.168.1.3192.168.1.4192.168.1.5Note
cn_internal_addressThe address used by ConfigNode for communication within the cluster127.0.0.1The IPV4 address or host name of the server where it is located, and it is recommended to use host nameiotdb-1iotdb-2iotdb-3Cannot be modified after initial startup
cn_internal_portThe port used by ConfigNode for communication within the cluster1071010710107101071010710Cannot be modified after initial startup
cn_consensus_portThe port used for ConfigNode replica group consensus protocol communication1072010720107201072010720Cannot be modified after initial startup
cn_seed_config_nodeThe address of the ConfigNode that the node connects to when registering to join the cluster, cn_internal_address:cn_internal_port127.0.0.1:10710The first CongfigNode's cn_internal-address: cn_internal_portiotdb-1:10710iotdb-1:10710iotdb-1:10710Cannot be modified after initial startup

DataNode Configuration

Open DataNode Configuration File ./conf/iotdb-datanode.properties,Set the following parameters:

ConfigurationDescriptionDefaultRecommended value192.168.1.3192.168.1.4192.168.1.5Note
dn_rpc_addressThe address of the client RPC service0.0.0.00.0.0.00.0.0.00.0.0.00.0.0.0Restarting the service takes effect
dn_rpc_portThe port of the client RPC service66676667666766676667Restarting the service takes effect
dn_internal_addressThe address used by DataNode for communication within the cluster127.0.0.1The IPV4 address or host name of the server where it is located, and it is recommended to use host nameiotdb-1iotdb-2iotdb-3Cannot be modified after initial startup
dn_internal_portThe port used by DataNode for communication within the cluster1073010730107301073010730Cannot be modified after initial startup
dn_mpp_data_exchange_portThe port used by DataNode to receive data streams1074010740107401074010740Cannot be modified after initial startup
dn_data_region_consensus_portThe port used by DataNode for data replica consensus protocol communication1075010750107501075010750Cannot be modified after initial startup
dn_schema_region_consensus_portThe port used by DataNode for metadata replica consensus protocol communication1076010760107601076010760Cannot be modified after initial startup
dn_seed_config_nodeThe ConfigNode address that the node connects to when registering to join the cluster, i.e. cn_internal-address: cn_internal_port127.0.0.1:10710The first CongfigNode's cn_internal-address: cn_internal_portiotdb-1:10710iotdb-1:10710iotdb-1:10710Cannot be modified after initial startup

3. Start ConfigNode

Start the first confignode of IoTDB-1 first, ensuring that the seed confignode node starts first, and then start the second and third confignode nodes in sequence

cd sbin
./start-confignode.sh    -d      #"- d" parameter will start in the background

4. Start DataNode

Enter the sbin directory of iotdb and start three datanode nodes in sequence:

cd sbin
./start-datanode.sh   -d   #"- d" parameter will start in the background

5. Verify Deployment

Can be executed directly Cli startup script in ./sbin directory:

./start-cli.sh  -h  ip(local IP or domain name)  -p  port(6667)

After successful startup, the following interface will appear displaying successful installation of IOTDB.

You can use the show cluster command to view cluster information:

Copyright © 2024 The Apache Software Foundation.
Apache IoTDB, IoTDB, Apache, the Apache feather logo, and the Apache IoTDB project logo are either registered trademarks or trademarks of The Apache Software Foundation in all countries

Have a question? Connect with us on QQ, WeChat, or Slack. Join the community now.