Skip to main content

Cluster Deployment

...About 5 min

Cluster Deployment

This section describes how to manually deploy an instance that includes 3 ConfigNodes and 3 DataNodes, commonly known as a 3C3D cluster.

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.

  3. It is recommended to deploy a monitoring panel, which can monitor important operational indicators and keep track of database operation status at any time. The monitoring panel can be obtained by contacting the business department,The steps for deploying a monitoring panel can refer to:Monitoring Panel Deploymentopen in new window

Preparation Steps

  1. Prepare the IoTDB database installation package: iotdb enterprise- {version}-bin.zip(The installation package can be obtained from:IoTDB-Packageopen in new window
  2. Configure the operating system environment according to environmental requirements(The 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  iotdb-enterprise-{version}-bin.zip
cd  iotdb-enterprise-{version}-bin

Environment script configuration

  • ./conf/confignode-env.sh configuration

    ConfigurationDescriptionDefaultRecommended 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. Activate Database

Method 1: Activate file copy activation

  • After starting three confignode nodes in sequence, copy the activation folder of each machine and the system_info file of each machine to the Timecho staff;
  • The staff will return the license files for each ConfigNode node, where 3 license files will be returned;
  • Put the three license files into the activation folder of the corresponding ConfigNode node;

Method 2: Activate Script Activation

  • Obtain the machine codes of three machines in sequence, enter the sbin directory of the installation directory, and execute the activation script start activate.sh:

    cd sbin
    ./start-activate.sh
    
  • The following information is displayed, where the machine code of one machine is displayed:

    Please copy the system_info's content and send it to Timecho:
    Y17hFA0xRCE1TmkVxILuxxxxxxxxxxxxxxxxxxxxxxxxxxxxW5P52KCccFMVeHTc=
    Please enter license:
    
  • The other two nodes execute the activation script start activate.sh in sequence, and then copy the machine codes of the three machines obtained to the Timecho staff

  • The staff will return 3 activation codes, which normally correspond to the order of the provided 3 machine codes. Please paste each activation code into the previous command line prompt Please enter license:, as shown below:

    Please enter license:
    Jw+MmF+Atxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5bAOXNeob5l+HO5fEMgzrW8OJPh26Vl6ljKUpCvpTiw==
    License has been stored to sbin/../activation/license
    Import completed. Please start cluster and excute 'show cluster' to verify activation status
    

5. 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

6. 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.

After the installation success interface appears, continue to check if the activation is successful and use the show cluster command.

When you see the display of Activated on the far right, it indicates successful activation.

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.