Iotdb 0.13 configure cluster and data synchronization sharing

describe

Official website cluster configuration example: official documentation

Prepare 2 servers, and they can ping each other and the relevant ports are open:

  • 192.168.1.1
  • 192.168.1.2

For relevant introduction, please check the official website and related documents.

Configuration

1. Download iotdb version 0.13 (skip if it is already installed), enter the opt directory and download.

cd /opt	
wget  https://dlcdn.apache.org/iotdb/0.13.4/apache-iotdb-0.13.4-all-bin.zip  --no-check-certificate

2. Unzip and enter the folder

unzip apache-iotdb-0.13.4-all-bin.zip
cd apache-iotdb-0.13.4-all-bin

3. Modify the configuration file:iotdb-cluster.properties

vi conf/iotdb-cluster.properties

internal_ipIs the local IP of the current server, and modify the following configuration

Insert image description here

internal_meta_portAnd internal_data_portif it is pseudo-distributed, it must be modified as needed, and the default is enough for real machine clusters.

Insert image description here

seed_nodesIt is the IP and iotdb port of all clusters. Multiple clusters are separated by commas.

At this point, the iotdb cluster configuration is completed. Other clusters are the same as this configuration, but need to be modified internal_ipto the local IP.

但是需要注意:如果往其他机器上配置集群,请勿直接用scp复制已修改的iotdb到其他机器,因为有问题,这个坑我填了很久,一定要复制下载好的iotdb.zip的压缩包或重新下载iotdb包到其他机器。

start up

apache-iotdb-0.13.3-all-binExecute in the directory on the 192.168.1.1 machine

./sbin/start-node.sh

Insert image description here

If this happens, don't worry. It's because other nodes behind the cluster have not started and a connection timeout exception is thrown.

apache-iotdb-0.13.3-all-binExecute in the directory on the 192.168.1.2 machine

./sbin/start-node.sh

At this time 192.168.1.1, the machine log output is normal.
Insert image description here
At this time, 192.168.1.2the machine log output is normal.

Insert image description here

test

1. Open a new xshell window and connect to any server, as long as this server can ping the first two servers and has iotdb.

2. 192.168.1.1Machine test

Enter apache-iotdb-0.13.3-all-binthe directory and execute

./sbin/start-cli.sh -h 192.168.1.1

Insert image description here
Connection successful, view data

Insert image description here

2. 192.168.1.2Machine test

Enter apache-iotdb-0.13.3-all-binthe directory and execute

./sbin/start-cli.sh -h 192.168.1.2

Insert image description here
Connection successful, view data

Insert image description here

3. Test machine data synchronization after inserting data

Currently 192.168.1.2inserting data is performed on the machine

insert into root.ln.wf02.wt02(timestamp,test) values(1, '测试')

Insert image description here
The insertion is successful and there is data.

Log in to 192.168.1.1the machine to check whether the data is synchronized and written

Insert image description here

The data is successfully written and synchronized, and that's it.

Guess you like

Origin blog.csdn.net/u014641168/article/details/132055802