You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/12/13 10:05:03 UTC
[iotdb] branch master updated: docker deploy for 1.0.0: dockerfiles,docker-compose files,support she… (#8393)
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new cb871b4cf1 docker deploy for 1.0.0: dockerfiles,docker-compose files,support she… (#8393)
cb871b4cf1 is described below
commit cb871b4cf14e04aaad3f0b7258e82e6e863e9854
Author: changxue2022 <11...@users.noreply.github.com>
AuthorDate: Tue Dec 13 18:04:55 2022 +0800
docker deploy for 1.0.0: dockerfiles,docker-compose files,support she… (#8393)
---
.gitignore | 3 +
docker/ReadMe.md | 30 +++-
docker/src/main/DockerCompose/do-docker-build.sh | 134 +++++++++++++++
.../src/main/DockerCompose/docker-compose-1c1d.yml | 41 +++++
.../DockerCompose/docker-compose-cluster-1c2d.yml | 69 ++++++++
.../DockerCompose/docker-compose-cluster-3c3d.yml | 60 +++++++
.../DockerCompose/docker-compose-host-3c3d.yml | 58 +++++++
docker/src/main/DockerCompose/entrypoint.sh | 57 +++++++
.../main/DockerCompose/replace-conf-from-env.sh | 64 ++++++++
docker/src/main/Dockerfile-1.0.0-1c1d | 50 ++++++
docker/src/main/Dockerfile-1.0.0-confignode | 54 ++++++
docker/src/main/Dockerfile-1.0.0-datanode | 56 +++++++
docs/UserGuide/QuickStart/WayToGetIoTDB.md | 175 +++++++++++++-------
docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md | 182 +++++++++++++--------
14 files changed, 895 insertions(+), 138 deletions(-)
diff --git a/.gitignore b/.gitignore
index 590d10a880..bb3192215b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,9 @@ derby-tsfile-db
# build generated
**/target/
+# build docker images
+tmp
+
# intermediately generated locally
tsfile-timeseries/src/main/resources/logback.out.out.xml
diff --git a/docker/ReadMe.md b/docker/ReadMe.md
index 33402b689f..2d5e9289fb 100644
--- a/docker/ReadMe.md
+++ b/docker/ReadMe.md
@@ -27,6 +27,9 @@ Before v0.12, Apache IoTDB's docker image name and version format is:
From 0.12 on, we release two images: one is for a single node, and the other is for the cluster mode.
The format is: `apache/iotdb:0.<major>.<minor>-node` and `apache/iotdb:0.<major>.<minor>-cluster`.
+From 1.0.0, we split 3 kinds of images: datanode,confignode and all of them in one image called 1C1D.
+The format is: `apache/iotdb:<version>-confignode`,`apache/iotdb:<version>-datanode` and `apache/iotdb:<version>-1c1d`.
+
## The definition of tag "latest"
Before v0.12, the "latest" tag will forward to the largest `apache/iotdb:0.<major>.<minor>`.
@@ -41,6 +44,21 @@ e.g.,
```shell
docker build -t my-iotdb:<version> -f Dockerfile-<version>
+# for 1.0.0
+cd src/main/DockerCompose
+./do-docker-build.sh -t <target> -v <version>
+e.g.
+./do-docker-build.sh -t confignode -v 1.0.0
+```
+Notice:
+Make directory of src/main/tmp and put the files you'd like to use in dockerfile if you don't want to build the source codes of IoTDB.
+e.g.
+```shell
+$ ls -hl tmp/
+total 215M
+-rw-r--r-- 1 root root 75M Nov 30 20:04 apache-iotdb-1.0.0-all-bin.zip
+-rw-r--r-- 1 root root 69M Dec 1 17:12 apache-iotdb-1.0.0-confignode-bin.zip
+-rw-r--r-- 1 root root 73M Dec 1 17:13 apache-iotdb-1.0.0-datanode-bin.zip
```
# How to run IoTDB server
@@ -50,13 +68,13 @@ Actually, we maintain a repo on dockerhub, so that you can get the docker image
For example,
```shell
-docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 5555:5555 apache/iotdb:<version>
+docker run -d --name iotdb -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 5555:5555 apache/iotdb:<version>
```
```shell
-docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 5555:5555 -p 9003:9003 -p 40010:40010 apache/iotdb:<version>
+docker run -d --name iotdb -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 5555:5555 -p 9003:9003 -p 40010:40010 apache/iotdb:<version>
```
-
+Since 1.0.0, see [offical documents.](https://iotdb.apache.org/UserGuide/Master/QuickStart/WayToGetIoTDB.html)
## Port description
By default, the ports that IoTDB uses are:
@@ -91,12 +109,12 @@ e.g.,
```shell
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-c82321c70137 apache/iotdb:<version> "/iotdb/sbin/start-s…" 12 minutes ago Up 12 minutes 0.0.0.0:6667->6667/tcp, 0.0.0.0:8181->8181/tcp, 5555/tcp, 0.0.0.0:31999->31999/tcp elegant_germain
+c82321c70137 apache/iotdb:<version> "/iotdb/sbin/start-s…" 12 minutes ago Up 12 minutes 0.0.0.0:6667->6667/tcp, 0.0.0.0:8181->8181/tcp, 5555/tcp, 0.0.0.0:31999->31999/tcp iotdb
```
2. Use `docker exec` to attach the container:
```shell
-docker exec -it c82321c70137 /bin/bash
+docker exec -it iotdb /bin/bash
```
Then, for the latest version (or, >=0.10.x), run `start-cli.sh`, for version 0.9.x and 0.8.1, run `start-client.sh`.
@@ -104,7 +122,7 @@ Then, for the latest version (or, >=0.10.x), run `start-cli.sh`, for version 0.9
Or,
```shell
-docker exec -it c82321c70137 start-cli.sh
+docker exec -it iotdb start-cli.sh
```
# How to run IoTDB-grafana-connector
diff --git a/docker/src/main/DockerCompose/do-docker-build.sh b/docker/src/main/DockerCompose/do-docker-build.sh
new file mode 100755
index 0000000000..c7167f48de
--- /dev/null
+++ b/docker/src/main/DockerCompose/do-docker-build.sh
@@ -0,0 +1,134 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#docker network create --driver=bridge --subnet=172.20.0.0/16 --gateway=172.20.0.1 iotdb
+
+current_path=$(cd $(dirname $0); pwd)
+iotdb_path=$(cd ${current_path}/../../../../; pwd)
+iotdb_zip_path=${current_path}/../tmp
+options="confignode datanode 1c1d"
+nocache="true"
+do_build="false"
+
+function print_usage(){
+ echo "Usage: $(basename $0) [option] "
+ echo " -t image to build, required. Options:$options all"
+ echo " -v iotdb version, default 1.0.1"
+ echo " -u specified the docker image maintainer, default git current user"
+ echo " -c commit id, default git current short commit id"
+ exit -1
+}
+while getopts 'v:u:t:c:bh' OPT; do
+ case $OPT in
+ t) build_what="$OPTARG";;
+ v) version="$OPTARG";;
+ u) maintainer="$OPTARG";;
+ c) commit_id="$OPTARG";;
+ b) do_build=true;;
+ h) print_usage;;
+ ?) print_usage;;
+ esac
+done
+
+if [[ -z "$build_what" ]]; then echo "-t is required."; print_usage; fi
+
+version=${version:-"1.0.1-SNAPSHOT"}
+maintainer=${maintainer:-"$(git config user.name)"}
+build_date="$(date +'%Y-%m-%dT%H:%M:%S+08:00')"
+commit_id=${commit_id:-"$(git rev-parse --short HEAD)"}
+image_prefix="apache/iotdb"
+
+echo "#################################"
+echo "build_what=$build_what"
+echo "version=$version"
+echo "do_build=$do_build"
+echo "maintainer=$maintainer"
+echo "commit_id=$commit_id"
+echo "#################################"
+
+set -ex
+
+function build_single(){
+ echo "##### build docker image #####"
+ local dockerfile="Dockerfile-1.0.0-$1"
+ local image="${image_prefix}:${version}-$1"
+ cd ${current_path}/../
+ docker build -f ${dockerfile} \
+ --build-arg version=${version} \
+ --label build_date="${build_date}" \
+ --label maintainer="${maintainer}" \
+ --label commit_id="${commit_id}" \
+ --no-cache=${nocache} -t ${image} .
+ echo "##### done #####"
+}
+
+function build_iotdb(){
+ if [[ "$do_build" == "false" ]]; then
+ return;
+ fi
+ echo "##### build iotdb #####"
+ cd $iotdb_path
+ mvn clean package -pl distribution -am -DskipTests
+ if [[ ! -d ${iotdb_zip_path} ]]; then mkdir ${iotdb_zip_path}; fi
+ cd ${iotdb_path}/distribution/target
+ cp apache-iotdb-${version}-all-bin.zip apache-iotdb-${version}-confignode-bin.zip apache-iotdb-${version}-datanode-bin.zip ${iotdb_zip_path}/
+ do_build=false
+ echo "##### done #####"
+}
+
+function check_build(){
+ local zip_file=${iotdb_zip_path}/apache-iotdb-${version}-$1-bin.zip
+ if [[ ! -f ${zip_file} ]]; then
+ do_build=true
+ fi
+}
+
+function process_single(){
+ check_build "${1:-$build_what}"
+ build_iotdb
+ build_single ${build_what}
+}
+
+function main() {
+ case "$build_what" in
+ confignode)
+ process_single
+ ;;
+ datanode)
+ process_single
+ ;;
+ 1c1d)
+ process_single all
+ ;;
+ all)
+ check_build all
+ build_iotdb
+ for b in $options ; do
+ build_single ${b}
+ done
+ ;;
+ ?)
+ print_usage ;;
+ esac
+ # clean up docker images
+ docker rmi `docker images|grep '<none>'|awk '{ print $3 }'` > /dev/null 2>&1 || true
+}
+main
+exit $?
diff --git a/docker/src/main/DockerCompose/docker-compose-1c1d.yml b/docker/src/main/DockerCompose/docker-compose-1c1d.yml
new file mode 100644
index 0000000000..2cf7e5f05a
--- /dev/null
+++ b/docker/src/main/DockerCompose/docker-compose-1c1d.yml
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version: "3"
+services:
+ iotdb-service:
+ image: apache/iotdb:1.0.1-SNAPSHOT-1c1d
+ hostname: iotdb-service
+ container_name: iotdb-service
+ ports:
+ - "26667:6667"
+ environment:
+ - cn_internal_address=iotdb-service
+ - cn_target_config_node_list=iotdb-service:22277
+ - dn_rpc_address=iotdb-service
+ - dn_target_config_node_list=iotdb-service:22277
+ volumes:
+ - ./data:/iotdb/data
+ - ./logs:/iotdb/logs
+ networks:
+ iotdb:
+ ipv4_address: 172.20.0.6
+
+networks:
+ iotdb:
+ external: true
diff --git a/docker/src/main/DockerCompose/docker-compose-cluster-1c2d.yml b/docker/src/main/DockerCompose/docker-compose-cluster-1c2d.yml
new file mode 100644
index 0000000000..3795f1e13e
--- /dev/null
+++ b/docker/src/main/DockerCompose/docker-compose-cluster-1c2d.yml
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version: "3"
+services:
+ iodb-confignode:
+ image: apache/iotdb:1.0.1-SNAPSHOT-confignode
+ hostname: iotdb-confignode
+ container_name: iotdb-confignode
+ environment:
+ - cn_internal_address=iotdb-confignode
+ - cn_target_config_node_list=iotdb-confignode:22277
+ volumes:
+ - ./data/confignode:/iotdb/data
+ - ./logs/confignode:/iotdb/logs
+ networks:
+ iotdb:
+ ipv4_address: 172.20.0.2
+
+ iotdb-datanode1:
+ image: apache/iotdb:1.0.1-SNAPSHOT-datanode
+ hostname: iotdb-datanode-1
+ container_name: iotdb-datanode-1
+ ports:
+ - "16667:6667"
+ environment:
+ - dn_rpc_address=iotdb-datanode-1
+ - dn_internal_address=iotdb-datanode-1
+ - dn_target_config_node_list=iotdb-confignode:22277
+ volumes:
+ - ./data/datanode1:/iotdb/data/
+ - ./logs/datanode1:/iotdb/logs/
+ networks:
+ iotdb:
+ ipv4_address: 172.20.0.3
+
+ iotdb-datanode2:
+ image: apache/iotdb:1.0.1-SNAPSHOT-datanode
+ hostname: iotdb-datanode-2
+ container_name: iotdb-datanode-2
+ environment:
+ - dn_rpc_address=iotdb-datanode-2
+ - dn_internal_address=iotdb-datanode-2
+ - dn_target_config_node_list=iotdb-confignode:22277
+ volumes:
+ - ./data/datanode2:/iotdb/data/
+ - ./logs/datanode2:/iotdb/logs/
+ networks:
+ iotdb:
+ ipv4_address: 172.20.0.4
+
+networks:
+ iotdb:
+ external: true
diff --git a/docker/src/main/DockerCompose/docker-compose-cluster-3c3d.yml b/docker/src/main/DockerCompose/docker-compose-cluster-3c3d.yml
new file mode 100644
index 0000000000..0509eab92f
--- /dev/null
+++ b/docker/src/main/DockerCompose/docker-compose-cluster-3c3d.yml
@@ -0,0 +1,60 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version: "3"
+services:
+ iotdb-confignode:
+ image: apache/iotdb:1.0.1-SNAPSHOT-confignode
+ container_name: iotdb-confignode
+ ports:
+ - "22277:22277"
+ - "22278:22278"
+ environment:
+ - cn_internal_address=iotdb-confignode-1
+ - cn_target_config_node_list=iotdb-confignode-1:22277
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/confignode:/iotdb/data
+ - ./logs/confignode:/iotdb/logs
+ networks:
+ iotdb:
+ ipv4_address: 172.20.0.12
+
+ iotdb-datanode:
+ image: apache/iotdb:1.0.1-SNAPSHOT-datanode
+ container_name: iotdb-datanode
+ ports:
+ - "6667:6667"
+ - "8777:8777"
+ - "9003:9003"
+ - "50010:50010"
+ - "40010:40010"
+ environment:
+ - dn_rpc_address=iotdb-datanode-1
+ - dn_internal_address=iotdb-datanode-1
+ - dn_target_config_node_list=iotdb-confignode-1:22277
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/datanode1:/iotdb/data/
+ - ./logs/datanode1:/iotdb/logs/
+ networks:
+ iotdb:
+ ipv4_address: 172.20.0.13
+networks:
+ iotdb:
+ external: true
diff --git a/docker/src/main/DockerCompose/docker-compose-host-3c3d.yml b/docker/src/main/DockerCompose/docker-compose-host-3c3d.yml
new file mode 100644
index 0000000000..f27f9658c6
--- /dev/null
+++ b/docker/src/main/DockerCompose/docker-compose-host-3c3d.yml
@@ -0,0 +1,58 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version: "3"
+services:
+ iotdb-confignode:
+ image: apache/iotdb:1.0.1-SNAPSHOT-confignode
+ container_name: iotdb-confignode
+ ports:
+ - "22277:22277"
+ - "22278:22278"
+ environment:
+ - cn_internal_address=iotdb-1
+ - cn_target_config_node_list=iotdb-1:22277
+ - schema_replication_factor=3
+ - schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ - config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/confignode:/iotdb/data
+ - ./logs/confignode:/iotdb/logs
+ network_mode: "host"
+
+ iotdb-datanode:
+ image: apache/iotdb:1.0.1-SNAPSHOT-datanode
+ container_name: iotdb-datanode
+ ports:
+ - "6667:6667"
+ - "8777:8777"
+ - "9003:9003"
+ - "50010:50010"
+ - "40010:40010"
+ environment:
+ - dn_rpc_address=iotdb-1
+ - dn_internal_address=iotdb-1
+ - dn_target_config_node_list=iotdb-1:22277
+ - data_replication_factor=3
+ - data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/datanode1:/iotdb/data/
+ - ./logs/datanode1:/iotdb/logs/
+ network_mode: "host"
diff --git a/docker/src/main/DockerCompose/entrypoint.sh b/docker/src/main/DockerCompose/entrypoint.sh
new file mode 100755
index 0000000000..55be9899b0
--- /dev/null
+++ b/docker/src/main/DockerCompose/entrypoint.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+current_path=$(cd $(dirname $0);pwd)
+start_what=$1
+
+function on_stop(){
+ echo "#### on_stop $start_what ####"
+ if [[ "$start_what" != "confignode" ]]; then
+ echo "###### manually flush ######";
+ start-cli.sh -e "flush;" || true
+ stop-datanode.sh
+ echo "##### done ######";
+ else
+ stop-confignode.sh;
+ fi
+}
+
+trap 'on_stop' SIGTERM SIGKILL SIGQUIT
+
+
+replace-conf-from-env.sh ${start_what}
+
+case "$1" in
+ datanode)
+ exec start-datanode.sh
+ ;;
+ confignode)
+ exec start-confignode.sh
+ ;;
+ all)
+ start-confignode.sh > /dev/null 2>&1 &
+ sleep 5
+ exec start-datanode.sh
+ ;;
+ *)
+ echo "bad parameter!"
+ exit -1
+ ;;
+esac
diff --git a/docker/src/main/DockerCompose/replace-conf-from-env.sh b/docker/src/main/DockerCompose/replace-conf-from-env.sh
new file mode 100755
index 0000000000..93be28bc24
--- /dev/null
+++ b/docker/src/main/DockerCompose/replace-conf-from-env.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+conf_path=${IOTDB_HOME}/conf
+
+function process_single(){
+ local key_value="$1"
+ local filename=$2
+ local key=$(echo $key_value|cut -d = -f1)
+ local line=$(grep -ni "${key}=" ${filename})
+ #echo "line=$line"
+ if [[ -n "${line}" ]]; then
+ echo "update $key $filename"
+ local line_no=$(echo $line|cut -d : -f1)
+ local content=$(echo $line|cut -d : -f2)
+ if [[ "${content:0:1}" != "#" ]]; then
+ sed -i "${line_no}d" ${filename}
+ fi
+ sed -i "${line_no} i${key_value}" ${filename}
+ fi
+}
+
+function replace_configs(){
+ for v in $(env); do
+ if [[ "${v}" =~ "=" && "${v}" =~ "_" && ! "${v}" =~ "JAVA_" ]]; then
+# echo "###### $v ####"
+ for f in ${target_files}; do
+ process_single $v ${conf_path}/$f
+ done
+ fi
+ done
+}
+
+case "$1" in
+ confignode)
+ target_files="iotdb-common.properties iotdb-confignode.properties"
+ ;;
+ datanode)
+ target_files="iotdb-common.properties iotdb-datanode.properties"
+ ;;
+ all)
+ target_files="iotdb-common.properties iotdb-confignode.properties iotdb-datanode.properties"
+ ;;
+esac
+
+replace_configs
+
diff --git a/docker/src/main/Dockerfile-1.0.0-1c1d b/docker/src/main/Dockerfile-1.0.0-1c1d
new file mode 100644
index 0000000000..79b767a760
--- /dev/null
+++ b/docker/src/main/Dockerfile-1.0.0-1c1d
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+FROM openjdk:11-jre-slim
+ARG version=1.0.0
+ARG target=apache-iotdb-${version}-all-bin
+
+RUN apt update \
+ && apt install lsof dos2unix procps unzip dumb-init -y \
+ && apt autoremove -y \
+ && apt purge --auto-remove -y \
+ && apt clean -y
+
+COPY tmp/${target}.zip /
+RUN cd / && unzip ${target}.zip \
+ && rm ${target}.zip \
+ && mv ${target} iotdb
+
+ENV IOTDB_HOME=/iotdb VERSION=${version}
+WORKDIR ${IOTDB_HOME}/sbin
+
+COPY DockerCompose/replace-conf-from-env.sh .
+COPY DockerCompose/entrypoint.sh .
+RUN chmod +x *.sh && dos2unix *.sh \
+ && dos2unix ${IOTDB_HOME}/conf/*.sh
+
+EXPOSE 6667
+VOLUME /iotdb/data
+VOLUME /iotdb/logs
+
+ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
+
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+CMD ["bash", "-c", "entrypoint.sh all"]
diff --git a/docker/src/main/Dockerfile-1.0.0-confignode b/docker/src/main/Dockerfile-1.0.0-confignode
new file mode 100644
index 0000000000..91d4cb314b
--- /dev/null
+++ b/docker/src/main/Dockerfile-1.0.0-confignode
@@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+FROM openjdk:11-jre-slim
+ARG version=1.0.1-SNAPSHOT
+ARG target=apache-iotdb-${version}-confignode-bin
+
+RUN apt update \
+ && apt install lsof dos2unix procps unzip dumb-init -y \
+# && apt remove unzip -y \
+ && apt autoremove -y \
+ && apt purge --auto-remove -y \
+ && apt clean -y
+
+COPY tmp/${target}.zip /
+RUN cd / && unzip ${target}.zip \
+ && rm ${target}.zip \
+ && mv ${target} iotdb
+
+ENV IOTDB_HOME=/iotdb VERSION=${version}
+WORKDIR ${IOTDB_HOME}/sbin
+
+COPY DockerCompose/replace-conf-from-env.sh .
+COPY DockerCompose/entrypoint.sh .
+RUN chmod +x *.sh && dos2unix *.sh \
+ && dos2unix ${IOTDB_HOME}/conf/*.sh
+
+EXPOSE 22277
+EXPOSE 22278
+VOLUME ${IOTDB_HOME}/data
+VOLUME ${IOTDB_HOME}/logs
+
+ENV PATH="${IOTDB_HOME}/sbin/:${IOTDB_HOME}/tools/:${PATH}"
+
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+CMD ["bash", "-c", "entrypoint.sh confignode"]
+
+LABEL build_date="$build_date" maintainer="$maintainer" version="$version" commit_id="$commit_id"
diff --git a/docker/src/main/Dockerfile-1.0.0-datanode b/docker/src/main/Dockerfile-1.0.0-datanode
new file mode 100644
index 0000000000..d1b083592b
--- /dev/null
+++ b/docker/src/main/Dockerfile-1.0.0-datanode
@@ -0,0 +1,56 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+FROM openjdk:11-jre-slim
+ARG version=1.0.1-SNAPSHOT
+ARG target=apache-iotdb-${version}-datanode-bin
+
+RUN apt update \
+ && apt install lsof dos2unix procps unzip dumb-init wget inetutils-ping -y \
+# && apt remove unzip -y \
+ && apt autoremove -y \
+ && apt purge --auto-remove -y \
+ && apt clean -y
+
+COPY tmp/${target}.zip /
+RUN cd / && unzip ${target}.zip \
+ && rm ${target}.zip \
+ && mv apache-iotdb-${version}-server-bin iotdb
+
+ENV IOTDB_HOME=/iotdb VERSION=${version}
+WORKDIR ${IOTDB_HOME}/sbin
+
+COPY DockerCompose/replace-conf-from-env.sh .
+COPY DockerCompose/entrypoint.sh .
+
+RUN chmod +x *.sh && dos2unix *.sh \
+ && dos2unix ${IOTDB_HOME}/conf/*.sh
+
+EXPOSE 6667
+EXPOSE 8777
+EXPOSE 9003
+VOLUME $IOTDB_HOME/data
+VOLUME $IOTDB_HOME/logs
+
+ENV PATH="${IOTDB_HOME}/sbin/:${IOTDB_HOME}/tools/:${PATH}"
+
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+CMD ["bash", "-c", "entrypoint.sh datanode"]
+
+LABEL build_date="$build_date" maintainer="$maintainer" version="$version" commit_id="$commit_id"
diff --git a/docs/UserGuide/QuickStart/WayToGetIoTDB.md b/docs/UserGuide/QuickStart/WayToGetIoTDB.md
index 56b1263ee9..01f24ae46e 100644
--- a/docs/UserGuide/QuickStart/WayToGetIoTDB.md
+++ b/docs/UserGuide/QuickStart/WayToGetIoTDB.md
@@ -84,67 +84,118 @@ If you need the jar with dependencies, you can add parameter `-P get-jar-with-de
Then you can find it under the path `{module.name}/target`.
-### Installation by Docker (Dockerfile)
-
-Apache IoTDB' Docker image is released on [https://hub.docker.com/r/apache/iotdb](https://hub.docker.com/r/apache/iotdb),
-
-
-1. **Get IoTDB docker image**
- - **Recommended:** Using `docker pull apache/iotdb:latest` can get the latest docker image.
- - Users can also build a docker image themselves. Now a Dockerfile has been written at docker/src/main/Dockerfile.
- - Way 1: `$ docker build -t iotdb:base git://github.com/apache/iotdb#master:docker`
- - Way 2:
- ```shell
- $ git clone https://github.com/apache/iotdb
- $ cd iotdb
- $ cd docker
- $ docker build -t iotdb:base .
- ```
-
-Once the docker image has been built locally (the tag is iotdb:base in this example), you are almost done!
-
-2. **Create docker volume for data files and logs:**
+### Installation by Docker
+Apache IoTDB' Docker image is released on [https://hub.docker.com/r/apache/iotdb](https://hub.docker.com/r/apache/iotdb)
+Add environments of docker to update the configurations of Apache IoTDB.
+#### Have a try
```shell
-$ docker volume create mydata
-$ docker volume create mylogs
-```
-3. **Run a docker container:**
+# get IoTDB official image
+docker pull apache/iotdb:1.0.0-1c1d
+# create docker bridge network
+docker network create --driver=bridge --subnet=172.18.0.0/16 --gateway=172.18.0.1 iotdb
+# create docker container
+docker run -d --name iotdb-service \
+ --hostname iotdb-service \
+ --network iotdb \
+ --ip 172.18.0.6 \
+ -p 26667:6667 \
+ -e cn_internal_address=iotdb-service \
+ -e cn_target_config_node_list=iotdb-service:22277 \
+ -e dn_rpc_address=iotdb-service \
+ -e dn_internal_address=iotdb-service \
+ -e dn_target_config_node_list=iotdb-service:22277 \
+ apache/iotdb:1.0.0-1c1d
+# execute SQL
+docker exec -ti iotdb-service /iotdb/sbin/start-cli.sh -h iotdb-service
+```
+External access:
```shell
-$ docker run -p 6667:6667 -v mydata:/iotdb/data -v mylogs:/iotdb/logs -d iotdb:base /iotdb/bin/start-server.sh
-```
-If success, you can run `docker ps`, and get something like the following:
-```
-CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-2a68b6944cb5 iotdb:base "/iotdb/bin/start-se…" 4 minutes ago Up 5 minutes 0.0.0.0:6667->6667/tcp laughing_meitner
-```
-You can use the above command to get the container ID:
-```shell
-$ docker container ls
-```
-suppose the ID is <C_ID>.
-
-And get the docker IP by the following, suppose the IP is <C_IP>.:
-```shell
-$ docker inspect --format='{{.NetworkSettings.IPAddress}}' <C_ID>
-```
-Now IoTDB server has started succesfully.
-
-4. If you just want to have a try by using iotdb-cli, you can:
-```shell
-$ docker exec -it <C_ID> /bin/bash
-$ (now you have enter the container): /iotdb/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
-```
-
-Or, if you have an iotdb-cli locally, execute the following command:
-```shell
-$ /%IOTDB_HOME%/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
-```
-5. If you want to write codes to insert data and query data, please add the following dependencies:
-```xml
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-jdbc</artifactId>
- <version>1.0.0</version>
- </dependency>
-```
-Some examples about how to use IoTDB with IoTDB-JDBC can be found at: https://github.com/apache/iotdb/tree/master/example/jdbc/src/main/java/org/apache/iotdb
+$IOTDB_HOME/sbin/start-cli.sh -h <IP Address/hostname> -p 26667
+```
+Notice:The confignode service would fail when restarting this container if the IP Adress of the container has been changed.
+```yaml
+# docker-compose-1c1d.yml
+version: "3"
+services:
+ iotdb-service:
+ image: apache/iotdb:1.0.0-1c1d
+ hostname: iotdb-service
+ container_name: iotdb-service
+ ports:
+ - "26667:6667"
+ environment:
+ - cn_internal_address=iotdb-service
+ - cn_target_config_node_list=iotdb-service:22277
+ - dn_rpc_address=iotdb-service
+ - dn_internal_address=iotdb-service
+ - dn_target_config_node_list=iotdb-service:22277
+ volumes:
+ - ./data:/iotdb/data
+ - ./logs:/iotdb/logs
+ networks:
+ iotdb:
+ ipv4_address: 172.18.0.6
+
+networks:
+ iotdb:
+ external: true
+```
+#### deploy cluster
+Until now, we support host and overlay networks but haven't supported bridge networks on multiple computers.
+Overlay networks see [1C2D](https://github.com/apache/iotdb/tree/master/docker/src/main/DockerCompose/docker-compose-cluster-1c2d.yml) and here are the configurations and operation steps to start an IoTDB cluster with docker using host networks。
+
+Suppose that there are three computers of iotdb-1, iotdb-2 and iotdb-3. We called them nodes.
+Here is the docker-compose file of iotdb-2, as the sample:
+```yaml
+version: "3"
+services:
+ iotdb-confignode:
+ image: apache/iotdb:1.0.0-confignode
+ container_name: iotdb-confignode
+ ports:
+ - "22277:22277"
+ - "22278:22278"
+ environment:
+ - cn_internal_address=iotdb-2
+ - cn_target_config_node_list=iotdb-1:22277
+ - schema_replication_factor=3
+ - schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ - config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ - data_replication_factor=3
+ - data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/confignode:/iotdb/data
+ - ./logs/confignode:/iotdb/logs
+ network_mode: "host"
+
+ iotdb-datanode:
+ image: apache/iotdb:1.0.0-datanode
+ container_name: iotdb-datanode
+ ports:
+ - "6667:6667"
+ - "8777:8777"
+ - "9003:9003"
+ - "50010:50010"
+ - "40010:40010"
+ environment:
+ - dn_rpc_address=iotdb-2
+ - dn_internal_address=iotdb-2
+ - dn_target_config_node_list=iotdb-1:22277
+ - data_replication_factor=3
+ - data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
+ - schema_replication_factor=3
+ - schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ - config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/datanode:/iotdb/data/
+ - ./logs/datanode:/iotdb/logs/
+ network_mode: "host"
+```
+Notice:
+1. The `dn_target_config_node_list` of three nodes must the same and it is the first starting node of `iotdb-1` with the cn_internal_port of 22277。
+2. In this docker-compose file,`iotdb-2` should be replace with the real IP or hostname of each node to generate docker compose files in the other nodes.
+3. The services would talk with each other, so they need map the /etc/hosts file or add the `extra_hosts` to the docker compose file.
+4. We must start the IoTDB services of `iotdb-1` first at the first time of starting.
+5. Stop all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again.
diff --git a/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md b/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md
index bba974fd34..97fe7142e9 100644
--- a/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md
+++ b/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md
@@ -84,77 +84,119 @@ Shell > unzip iotdb-<version>.zip
编译完成后就可以在`{module.name}/target`目录中找到需要的包了。
-### 通过 Docker 安装 (Dockerfile)
+### 通过 Docker 安装
-Apache IoTDB 的 Docker 镜像已经上传至 [https://hub.docker.com/r/apache/iotdb](https://hub.docker.com/r/apache/iotdb),
-
-1. **获取 IoTDB docker 镜像**
-
- - **推荐**:执行 `docker pull apache/iotdb:latest` 即可获取最新的 docker 镜像。
-
- - 用户也可以根据代码提供的 Dockerfile 文件来自己生成镜像。Dockerfile 存放在的 docker 工程下的 src/main/Dockerfile 中。
-
- - 方法 1:```$ docker build -t iotdb:base git://github.com/apache/iotdb#master:docker```
-
- - 方法 2:
- ```shell
- $ git clone https://github.com/apache/iotdb
- $ cd iotdb
- $ mvn package -DskipTests
- $ cd docker
- $ docker build -t iotdb:base .
- ```
-
- 当 docker image 在本地构建完成的时候 (示例中的 tag 为 iotdb:base),已经距完成只有一步之遥了!
-
-2. **创建数据文件和日志的 docker 挂载目录 (docker volume):**
-```
-$ docker volume create mydata
-$ docker volume create mylogs
-```
-3. **运行 docker 容器:**
+Apache IoTDB 的 Docker 镜像已经上传至 [https://hub.docker.com/r/apache/iotdb](https://hub.docker.com/r/apache/iotdb)。
+Apache IoTDB 的配置项以环境变量形式添加到容器内。
+#### 简单尝试
```shell
-$ docker run -p 6667:6667 -v mydata:/iotdb/data -v mylogs:/iotdb/logs -d iotdb:base /iotdb/bin/start-server.sh
-```
-您可以使用`docker ps`来检查是否运行成功,当成功时控制台会输出下面的日志:
-```
-CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-2a68b6944cb5 iotdb:base "/iotdb/bin/start-se…" 4 minutes ago Up 5 minutes 0.0.0.0:6667->6667/tcp laughing_meitner
-```
-您可以使用下面的命令来获取 container 的 ID:
-
+# 获取镜像
+docker pull apache/iotdb:1.0.0-1c1d
+# 创建 docker bridge 网络
+docker network create --driver=bridge --subnet=172.18.0.0/16 --gateway=172.18.0.1 iotdb
+# 创建 docker 容器
+docker run -d --name iotdb-service \
+ --hostname iotdb-service \
+ --network iotdb \
+ --ip 172.18.0.6 \
+ -p 26667:6667 \
+ -e cn_internal_address=iotdb-service \
+ -e cn_target_config_node_list=iotdb-service:22277 \
+ -e dn_rpc_address=iotdb-service \
+ -e dn_internal_address=iotdb-service \
+ -e dn_target_config_node_list=iotdb-service:22277 \
+ apache/iotdb:1.0.0-1c1d
+# 尝试使用命令行执行SQL
+docker exec -ti iotdb-service /iotdb/sbin/start-cli.sh -h iotdb-service
+```
+外部连接:
```shell
-$ docker container ls
-```
-假设这个 ID 为 <C_ID>.
-
-然后使用下面的命令获取这个 ID 对应的 IP 地址,假设获取的 IP 为 <C_IP>:
-
-```shell
-$ docker inspect --format='{{.NetworkSettings.IPAddress}}' <C_ID>
-```
-现在 IoTDB 服务器已经启动成功了。
-
-4. 如果您想尝试使用 iotdb-cli 命令行,您可以使用如下命令:
-
-```shell
-$ docker exec -it <C_ID> /bin/bash
-$ (now you have enter the container): /iotdb/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
-```
-
-还可以使用本地的 iotdb-cli,执行如下命令:
-
-```shell
-$ /%IOTDB_HOME%/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
-```
-5. 如果您想写一些代码来插入或者查询数据,您可以在 pom.xml 文件中加入下面的依赖:
-
-```xml
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-jdbc</artifactId>
- <version>1.0.0</version>
- </dependency>
-```
-这里是一些使用 IoTDB-JDBC 连接 IoTDB 的示例:https://github.com/apache/iotdb/tree/master/example/jdbc/src/main/java/org/apache/iotdb
+$IOTDB_HOME/sbin/start-cli.sh -h <主机IP/hostname> -p 26667
+```
+注意:必须固定IP部署。IP改变会导致 confignode 启动失败。
+```yaml
+# docker-compose-1c1d.yml
+version: "3"
+services:
+ iotdb-service:
+ image: apache/iotdb:1.0.0-1c1d
+ hostname: iotdb-service
+ container_name: iotdb-service
+ ports:
+ - "26667:6667"
+ environment:
+ - cn_internal_address=iotdb-service
+ - cn_target_config_node_list=iotdb-service:22277
+ - dn_rpc_address=iotdb-service
+ - dn_internal_address=iotdb-service
+ - dn_target_config_node_list=iotdb-service:22277
+ volumes:
+ - ./data:/iotdb/data
+ - ./logs:/iotdb/logs
+ networks:
+ iotdb:
+ ipv4_address: 172.18.0.6
+
+networks:
+ iotdb:
+ external: true
+```
+#### 集群部署
+目前只支持 host 网络和 overlay 网络,不支持 bridge 网络。overlay 网络参照[1C2D](https://github.com/apache/iotdb/tree/master/docker/src/main/DockerCompose/docker-compose-cluster-1c2d.yml)的写法,host 网络如下。
+
+假如有三台物理机,它们的hostname分别是iotdb-1、iotdb-2、iotdb-3。依次启动。
+以 iotdb-2 节点的docker-compose文件为例:
+```yaml
+version: "3"
+services:
+ iotdb-confignode:
+ image: apache/iotdb:1.0.0-confignode
+ container_name: iotdb-confignode
+ ports:
+ - "22277:22277"
+ - "22278:22278"
+ environment:
+ - cn_internal_address=iotdb-2
+ - cn_target_config_node_list=iotdb-1:22277
+ - schema_replication_factor=3
+ - schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ - config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ - data_replication_factor=3
+ - data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/confignode:/iotdb/data
+ - ./logs/confignode:/iotdb/logs
+ network_mode: "host"
+
+ iotdb-datanode:
+ image: apache/iotdb:1.0.0-datanode
+ container_name: iotdb-datanode
+ ports:
+ - "6667:6667"
+ - "8777:8777"
+ - "9003:9003"
+ - "50010:50010"
+ - "40010:40010"
+ environment:
+ - dn_rpc_address=iotdb-2
+ - dn_internal_address=iotdb-2
+ - dn_target_config_node_list=iotdb-1:22277
+ - data_replication_factor=3
+ - data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
+ - schema_replication_factor=3
+ - schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ - config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
+ volumes:
+ - /etc/hosts:/etc/hosts:ro
+ - ./data/datanode:/iotdb/data/
+ - ./logs/datanode:/iotdb/logs/
+ network_mode: "host"
+```
+注意:
+1. `dn_target_config_node_list`所有节点配置一样,需要配置第一个启动的节点,这里为`iotdb-1`。
+2. 上面docker-compose文件中,`iotdb-2`需要替换为每个节点的 hostname、域名或者IP地址。
+3. 需要映射`/etc/hosts`,文件内配置了 iotdb-1、iotdb-2、iotdb-3 与IP的映射。或者可以在 docker-compose 文件中增加 `extra_hosts` 配置。
+4. 首次启动时,必须首先启动 `iotdb-1`。
+5. 如果部署失败要重新部署集群,必须将所有节点上的IoTDB服务停止,然后清除`data`和`logs`文件夹后,再启动。