From ea06e094b4ea874ade6b427190fc9de55e454c25 Mon Sep 17 00:00:00 2001 From: changxue2022 Date: Tue, 12 Mar 2024 18:29:04 +0800 Subject: [PATCH 1/3] add how to configure and upgrade with docker deployment --- .../Docker-Install.md | 27 +++++++++++++- .../V1.0.x/QuickStart/WayToGetIoTDB.md | 24 ++++++++++++ .../V1.1.x/QuickStart/WayToGetIoTDB.md | 25 +++++++++++++ .../Docker-Install.md | 37 ++++++++++++++++--- .../Docker-Install.md | 27 +++++++++++++- .../Docker-Install.md | 24 +++++++++++- .../V1.0.x/QuickStart/WayToGetIoTDB.md | 22 +++++++++++ .../V1.1.x/QuickStart/WayToGetIoTDB.md | 22 +++++++++++ .../Docker-Install.md | 35 +++++++++++++++--- .../Docker-Install.md | 25 ++++++++++++- 10 files changed, 252 insertions(+), 16 deletions(-) diff --git a/src/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md b/src/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md index 18a07d39b..421d8497b 100644 --- a/src/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md +++ b/src/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md @@ -159,4 +159,29 @@ Notice: 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 and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. \ No newline at end of file +5. Stop and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. + + +## Configuration +All configuration files are in the directory of `conf`. +The elements of environment in docker-compose file is the configurations of IoTDB. +If you'd changed the configurations files in conf, please map the directory of `conf` in docker-compose file. + + +### log level +The conf directory contains log configuration files, namely logback-confignode.xml and logback-datanode.xml. + + +### memory set +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` + +## upgrade IoTDB +1. Downloads the newer IoTDB docker image from docker hub +2. Update the image of docker-compose file +3. Stop the IoTDB docker containers with the commands of docker stop and docker rm. +4. Start IoTDB with `docker-compose -f docker-compose-standalone.yml up -d` + +## boot automatically +1. Add `restart: always` to every service of IoTDB in docker-compose file +2. Set docker service to boot automatically +e.g. in CentOS: `systemctl enable docker` \ No newline at end of file diff --git a/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md b/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md index 7c61b2c97..bb1864ace 100644 --- a/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md +++ b/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md @@ -208,3 +208,27 @@ Notice: 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 and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. + +## Configuration +All configuration files are in the directory of `conf`. +The elements of environment in docker-compose file is the configurations of IoTDB. +If you'd changed the configurations files in conf, please map the directory of `conf` in docker-compose file. + + +### log level +The conf directory contains log configuration files, namely logback-confignode.xml and logback-datanode.xml. + + +### memory set +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` + +## upgrade IoTDB +1. Downloads the newer IoTDB docker image from docker hub +2. Update the image of docker-compose file +3. Stop the IoTDB docker containers with the commands of docker stop and docker rm. +4. Start IoTDB with `docker-compose -f docker-compose-standalone.yml up -d` + +## boot automatically +1. Add `restart: always` to every service of IoTDB in docker-compose file +2. Set docker service to boot automatically +e.g. in CentOS: `systemctl enable docker` \ No newline at end of file diff --git a/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md b/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md index bda484bcd..16c8b512a 100644 --- a/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md +++ b/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md @@ -209,3 +209,28 @@ Notice: 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 and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. + + +## Configuration +All configuration files are in the directory of `conf`. +The elements of environment in docker-compose file is the configurations of IoTDB. +If you'd changed the configurations files in conf, please map the directory of `conf` in docker-compose file. + + +### log level +The conf directory contains log configuration files, namely logback-confignode.xml and logback-datanode.xml. + + +### memory set +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` + +## upgrade IoTDB +1. Downloads the newer IoTDB docker image from docker hub +2. Update the image of docker-compose file +3. Stop the IoTDB docker containers with the commands of docker stop and docker rm. +4. Start IoTDB with `docker-compose -f docker-compose-standalone.yml up -d` + +## boot automatically +1. Add `restart: always` to every service of IoTDB in docker-compose file +2. Set docker service to boot automatically +e.g. in CentOS: `systemctl enable docker` \ No newline at end of file diff --git a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md index ff5db87b1..1907eb09d 100644 --- a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md +++ b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md @@ -28,7 +28,7 @@ Add environments of docker to update the configurations of Apache IoTDB. ```shell # get IoTDB official image -docker pull apache/iotdb:1.1.0-standalone +docker pull apache/iotdb:1.2.0-standalone # create docker bridge network docker network create --driver=bridge --subnet=172.18.0.0/16 --gateway=172.18.0.1 iotdb # create docker container @@ -48,7 +48,7 @@ docker run -d --name iotdb-service \ -e dn_schema_region_consensus_port=10750 \ -e dn_data_region_consensus_port=10760 \ -e dn_rpc_port=6667 \ - apache/iotdb:1.1.0-standalone + apache/iotdb:1.2.0-standalone # execute SQL docker exec -ti iotdb-service /iotdb/sbin/start-cli.sh -h iotdb-service ``` @@ -67,7 +67,7 @@ Notice:The confignode service would fail when restarting this container if the version: "3" services: iotdb-service: - image: apache/iotdb:1.1.0-standalone + image: apache/iotdb:1.2.0-standalone hostname: iotdb-service container_name: iotdb-service ports: @@ -108,7 +108,7 @@ Here is the docker-compose file of iotdb-2, as the sample: version: "3" services: iotdb-confignode: - image: apache/iotdb:1.1.0-confignode + image: apache/iotdb:1.2.0-confignode container_name: iotdb-confignode environment: - cn_internal_address=iotdb-2 @@ -127,7 +127,7 @@ services: network_mode: "host" iotdb-datanode: - image: apache/iotdb:1.1.0-datanode + image: apache/iotdb:1.2.0-datanode container_name: iotdb-datanode environment: - dn_rpc_address=iotdb-2 @@ -155,4 +155,29 @@ Notice: 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 and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. \ No newline at end of file +5. Stop and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. + + +## Configuration +All configuration files are in the directory of `conf`. +The elements of environment in docker-compose file is the configurations of IoTDB. +If you'd changed the configurations files in conf, please map the directory of `conf` in docker-compose file. + + +### log level +The conf directory contains log configuration files, namely logback-confignode.xml and logback-datanode.xml. + + +### memory set +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` + +## upgrade IoTDB +1. Downloads the newer IoTDB docker image from docker hub +2. Update the image of docker-compose file +3. Stop the IoTDB docker containers with the commands of docker stop and docker rm. +4. Start IoTDB with `docker-compose -f docker-compose-standalone.yml up -d` + +## boot automatically +1. Add `restart: always` to every service of IoTDB in docker-compose file +2. Set docker service to boot automatically +e.g. in CentOS: `systemctl enable docker` \ No newline at end of file diff --git a/src/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md b/src/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md index 18a07d39b..421d8497b 100644 --- a/src/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md +++ b/src/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md @@ -159,4 +159,29 @@ Notice: 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 and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. \ No newline at end of file +5. Stop and remove all the IoTDB services and clean up the `data` and `logs` directories of the 3 nodes,then start the cluster again. + + +## Configuration +All configuration files are in the directory of `conf`. +The elements of environment in docker-compose file is the configurations of IoTDB. +If you'd changed the configurations files in conf, please map the directory of `conf` in docker-compose file. + + +### log level +The conf directory contains log configuration files, namely logback-confignode.xml and logback-datanode.xml. + + +### memory set +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` + +## upgrade IoTDB +1. Downloads the newer IoTDB docker image from docker hub +2. Update the image of docker-compose file +3. Stop the IoTDB docker containers with the commands of docker stop and docker rm. +4. Start IoTDB with `docker-compose -f docker-compose-standalone.yml up -d` + +## boot automatically +1. Add `restart: always` to every service of IoTDB in docker-compose file +2. Set docker service to boot automatically +e.g. in CentOS: `systemctl enable docker` \ No newline at end of file diff --git a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md index e39f43f51..c1a3be165 100644 --- a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md +++ b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Docker-Install.md @@ -156,4 +156,26 @@ services: 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`文件夹后,再启动。 \ No newline at end of file +5. 如果部署失败要重新部署集群,必须将所有节点上的IoTDB服务停止并删除,然后清除`data`和`logs`文件夹后,再启动。 + +## 配置 +IoTDB 的配置文件,都在安装目录的conf目录下。 +IoTDB 本身配置都可以在 docker-compose 文件的 environment 中进行配置。 +如果对日志和内存进行了自定义配置,那么需要将`conf`目录映射出来。 + +### 修改日志级别 +日志配置文件为 logback-confignode.xml 和 logback-datanode.xml,可以根据需要进行精细配置。 + +### 修改内存配置 +内存配置文件为 confignode-env.sh 和 datanode-env.sh。堆内存 ON_HEAP_MEMORY, 堆外内存 OFF_HEAP_MEMORY。例如:`ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` + +## 升级 +1. 获取新的镜像 +2. 修改 docker-compose 文件的 image +3. 使用 docker stop 和 docker rm 命令,停止运行的 docker 容器 +4. 启动 IoTDB: `docker-compose -f docker-compose-standalone.yml up -d` + +## 设置开机自启动 +1. 修改 docker-compose 文件,每个docker 容器配置:`restart: always` +2. 将 docker 服务设置为开机自启动 +以 CentOS 操作系统为例: `systemctl enable docker` \ No newline at end of file diff --git a/src/zh/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md b/src/zh/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md index 2ee4a8863..641791b1f 100644 --- a/src/zh/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md +++ b/src/zh/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md @@ -209,3 +209,25 @@ services: 3. 需要映射`/etc/hosts`,文件内配置了 iotdb-1、iotdb-2、iotdb-3 与IP的映射。或者可以在 docker-compose 文件中增加 `extra_hosts` 配置。 4. 首次启动时,必须首先启动 `iotdb-1`。 5. 如果部署失败要重新部署集群,必须将所有节点上的IoTDB服务停止并删除,然后清除`data`和`logs`文件夹后,再启动。 + +## 配置 +IoTDB 的配置文件,都在安装目录的conf目录下。 +IoTDB 本身配置都可以在 docker-compose 文件的 environment 中进行配置。 +如果对日志和内存进行了自定义配置,那么需要将`conf`目录映射出来。 + +### 修改日志级别 +日志配置文件为 logback-confignode.xml 和 logback-datanode.xml,可以根据需要进行精细配置。 + +### 修改内存配置 +内存配置文件为 confignode-env.sh 和 datanode-env.sh。堆内存 MAX_HEAP_SIZE 和 HEAP_NEWSIZE, 堆外内存 MAX_DIRECT_MEMORY_SIZE。例如:`MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` + +## 升级 +1. 获取新的镜像 +2. 修改 docker-compose 文件的 image +3. 使用 docker stop 和 docker rm 命令,停止运行的 docker 容器 +4. 启动 IoTDB: `docker-compose -f docker-compose-standalone.yml up -d` + +## 设置开机自启动 +1. 修改 docker-compose 文件,每个docker 容器配置:`restart: always` +2. 将 docker 服务设置为开机自启动 +以 CentOS 操作系统为例: `systemctl enable docker` \ No newline at end of file diff --git a/src/zh/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md b/src/zh/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md index 52bf70c73..a5aa6bd87 100644 --- a/src/zh/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md +++ b/src/zh/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md @@ -210,3 +210,25 @@ services: 3. 需要映射`/etc/hosts`,文件内配置了 iotdb-1、iotdb-2、iotdb-3 与IP的映射。或者可以在 docker-compose 文件中增加 `extra_hosts` 配置。 4. 首次启动时,必须首先启动 `iotdb-1`。 5. 如果部署失败要重新部署集群,必须将所有节点上的IoTDB服务停止并删除,然后清除`data`和`logs`文件夹后,再启动。 + +## 配置 +IoTDB 的配置文件,都在安装目录的conf目录下。 +IoTDB 本身配置都可以在 docker-compose 文件的 environment 中进行配置。 +如果对日志和内存进行了自定义配置,那么需要将`conf`目录映射出来。 + +### 修改日志级别 +日志配置文件为 logback-confignode.xml 和 logback-datanode.xml,可以根据需要进行精细配置。 + +### 修改内存配置 +内存配置文件为 confignode-env.sh 和 datanode-env.sh。堆内存 MAX_HEAP_SIZE 和 HEAP_NEWSIZE, 堆外内存 MAX_DIRECT_MEMORY_SIZE。例如:`MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` + +## 升级 +1. 获取新的镜像 +2. 修改 docker-compose 文件的 image +3. 使用 docker stop 和 docker rm 命令,停止运行的 docker 容器 +4. 启动 IoTDB + +## 设置开机自启动 +1. 修改 docker-compose 文件,每个docker 容器配置:`restart: always` +2. 将 docker 服务设置为开机自启动 +以 CentOS 操作系统为例: `systemctl enable docker` \ No newline at end of file diff --git a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md index 26ee2ff0f..5709406f7 100644 --- a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md +++ b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md @@ -28,7 +28,7 @@ Apache IoTDB 的配置项以环境变量形式添加到容器内。 ```shell # 获取镜像 -docker pull apache/iotdb:1.1.0-standalone +docker pull apache/iotdb:1.2.0-standalone # 创建 docker bridge 网络 docker network create --driver=bridge --subnet=172.18.0.0/16 --gateway=172.18.0.1 iotdb # 创建 docker 容器 @@ -49,7 +49,7 @@ docker run -d --name iotdb-service \ -e dn_schema_region_consensus_port=10750 \ -e dn_data_region_consensus_port=10760 \ -e dn_rpc_port=6667 \ - apache/iotdb:1.1.0-standalone + apache/iotdb:1.2.0-standalone # 尝试使用命令行执行SQL docker exec -ti iotdb-service /iotdb/sbin/start-cli.sh -h iotdb-service ``` @@ -66,7 +66,7 @@ $IOTDB_HOME/sbin/start-cli.sh -h <主机IP/hostname> -p 6667 version: "3" services: iotdb-service: - image: apache/iotdb:1.1.0-standalone + image: apache/iotdb:1.2.0-standalone hostname: iotdb-service container_name: iotdb-service ports: @@ -106,7 +106,7 @@ networks: version: "3" services: iotdb-confignode: - image: apache/iotdb:1.1.0-confignode + image: apache/iotdb:1.2.0-confignode container_name: iotdb-confignode environment: - cn_internal_address=iotdb-2 @@ -125,7 +125,7 @@ services: network_mode: "host" iotdb-datanode: - image: apache/iotdb:1.1.0-datanode + image: apache/iotdb:1.2.0-datanode container_name: iotdb-datanode environment: - dn_rpc_address=iotdb-2 @@ -153,4 +153,27 @@ services: 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`文件夹后,再启动。 \ No newline at end of file +5. 如果部署失败要重新部署集群,必须将所有节点上的IoTDB服务停止并删除,然后清除`data`和`logs`文件夹后,再启动。 + + +## 配置 +IoTDB 的配置文件,都在安装目录的conf目录下。 +IoTDB 本身配置都可以在 docker-compose 文件的 environment 中进行配置。 +如果对日志和内存进行了自定义配置,那么需要将`conf`目录映射出来。 + +### 修改日志级别 +日志配置文件为 logback-confignode.xml 和 logback-datanode.xml,可以根据需要进行精细配置。 + +### 修改内存配置 +内存配置文件为 confignode-env.sh 和 datanode-env.sh。堆内存 ON_HEAP_MEMORY, 堆外内存 OFF_HEAP_MEMORY。例如:`ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` + +## 升级 +1. 获取新的镜像 +2. 修改 docker-compose 文件的 image +3. 使用 docker stop 和 docker rm 命令,停止运行的 docker 容器 +4. 启动 IoTDB + +## 设置开机自启动 +1. 修改 docker-compose 文件,每个docker 容器配置:`restart: always` +2. 将 docker 服务设置为开机自启动 +以 CentOS 操作系统为例: `systemctl enable docker` \ No newline at end of file diff --git a/src/zh/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md b/src/zh/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md index e39f43f51..bbb1ba746 100644 --- a/src/zh/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md +++ b/src/zh/UserGuide/latest/Deployment-and-Maintenance/Docker-Install.md @@ -156,4 +156,27 @@ services: 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`文件夹后,再启动。 \ No newline at end of file +5. 如果部署失败要重新部署集群,必须将所有节点上的IoTDB服务停止并删除,然后清除`data`和`logs`文件夹后,再启动。 + + +## 配置 +IoTDB 的配置文件,都在安装目录的conf目录下。 +IoTDB 本身配置都可以在 docker-compose 文件的 environment 中进行配置。 +如果对日志和内存进行了自定义配置,那么需要将`conf`目录映射出来。 + +### 修改日志级别 +日志配置文件为 logback-confignode.xml 和 logback-datanode.xml,可以根据需要进行精细配置。 + +### 修改内存配置 +内存配置文件为 confignode-env.sh 和 datanode-env.sh。堆内存 ON_HEAP_MEMORY, 堆外内存 OFF_HEAP_MEMORY。例如:`ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` + +## 升级 +1. 获取新的镜像 +2. 修改 docker-compose 文件的 image +3. 使用 docker stop 和 docker rm 命令,停止运行的 docker 容器 +4. 启动 IoTDB + +## 设置开机自启动 +1. 修改 docker-compose 文件,每个docker 容器配置:`restart: always` +2. 将 docker 服务设置为开机自启动 +以 CentOS 操作系统为例: `systemctl enable docker` \ No newline at end of file From 6d8f37364d411d592282e762a7f00b5b323a5352 Mon Sep 17 00:00:00 2001 From: changxue2022 Date: Wed, 13 Mar 2024 09:02:27 +0800 Subject: [PATCH 2/3] update memory variables of 1.2.x docker deployment and 1.x --- src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md | 2 +- src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md | 2 +- .../V1.2.x/Deployment-and-Maintenance/Docker-Install.md | 3 +-- .../V1.2.x/Deployment-and-Maintenance/Docker-Install.md | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md b/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md index bb1864ace..e80914035 100644 --- a/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md +++ b/src/UserGuide/V1.0.x/QuickStart/WayToGetIoTDB.md @@ -220,7 +220,7 @@ The conf directory contains log configuration files, namely logback-confignode.x ### memory set -The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses MAX_HEAP_SIZE and HEAP_NEWSIZE, and JVM direct memroy uses MAX_DIRECT_MEMORY_SIZE. e.g. `MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` ## upgrade IoTDB 1. Downloads the newer IoTDB docker image from docker hub diff --git a/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md b/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md index 16c8b512a..b153ef2c4 100644 --- a/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md +++ b/src/UserGuide/V1.1.x/QuickStart/WayToGetIoTDB.md @@ -222,7 +222,7 @@ The conf directory contains log configuration files, namely logback-confignode.x ### memory set -The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses MAX_HEAP_SIZE and HEAP_NEWSIZE, and JVM direct memroy uses MAX_DIRECT_MEMORY_SIZE. e.g. `MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` ## upgrade IoTDB 1. Downloads the newer IoTDB docker image from docker hub diff --git a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md index 1907eb09d..3fa6247ec 100644 --- a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md +++ b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md @@ -167,9 +167,8 @@ If you'd changed the configurations files in conf, please map the directory of ` ### log level The conf directory contains log configuration files, namely logback-confignode.xml and logback-datanode.xml. - ### memory set -The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses ON_HEAP_MEMORY and JVM direct memroy uses OFF_HEAP_MEMORY. e.g. `ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` +The conf directory contains memory configuration files, namely confignode-env.sh and datanode-env.sh. JVM heap size uses MAX_HEAP_SIZE and HEAP_NEWSIZE, and JVM direct memroy uses MAX_DIRECT_MEMORY_SIZE. e.g. `MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` ## upgrade IoTDB 1. Downloads the newer IoTDB docker image from docker hub diff --git a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md index 5709406f7..16c1d06d4 100644 --- a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md +++ b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Docker-Install.md @@ -165,7 +165,7 @@ IoTDB 本身配置都可以在 docker-compose 文件的 environment 中进行配 日志配置文件为 logback-confignode.xml 和 logback-datanode.xml,可以根据需要进行精细配置。 ### 修改内存配置 -内存配置文件为 confignode-env.sh 和 datanode-env.sh。堆内存 ON_HEAP_MEMORY, 堆外内存 OFF_HEAP_MEMORY。例如:`ON_HEAP_MEMORY=8G, OFF_HEAP_MEMORY=2G` +内存配置文件为 confignode-env.sh 和 datanode-env.sh。堆内存 MAX_HEAP_SIZE 和 HEAP_NEWSIZE, 堆外内存 MAX_DIRECT_MEMORY_SIZE。例如:`MAX_HEAP_SIZE=8G, HEAP_NEWSIZE=8G, MAX_DIRECT_MEMORY_SIZE=2G` ## 升级 1. 获取新的镜像 From ed50ff7be75fc8188e3642c7e4afe7a97c857df8 Mon Sep 17 00:00:00 2001 From: changxue2022 Date: Fri, 25 Apr 2025 15:37:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?docker:=E6=94=AF=E6=8C=81=E5=9C=A8docker-co?= =?UTF-8?q?mpose=E6=96=87=E4=BB=B6=E4=B8=AD=E4=BD=BF=E7=94=A8=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AEJVM=E5=86=85?= =?UTF-8?q?=E5=AD=98=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Docker-Deployment_apache.md | 10 ++++++++++ .../Docker-Deployment_timecho.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_apache.md b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_apache.md index 9f315a1d4..9f59dc3f8 100644 --- a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_apache.md +++ b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_apache.md @@ -196,6 +196,16 @@ docker cp iotdb:/iotdb/conf /docker-iotdb/iotdb/conf ```bash docker-compose -f docker-compose-standalone.yml up -d ``` +### 2.7 使用环境变量配置内存 +功能:在docker-compose的配置文件中配置JVM启动内存。 +IoTDB版本大于等于2.0.4.1 或者大于等于1.3.5 以后才支持这种做法。 +```bash + environment: + # for datanode + - IOTDB_JMX_OPTS=-Xms4G -Xmx4G -XX:MaxDirectMemorySize=1G + # for confignode + - CONFIGNODE_JMX_OPTS=-Xms1G -Xmx1G -XX:MaxDirectMemorySize=256M +``` ## 3. 集群版 diff --git a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_timecho.md b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_timecho.md index b328607fc..e3bb3c638 100644 --- a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_timecho.md +++ b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/Docker-Deployment_timecho.md @@ -238,6 +238,16 @@ docker cp iotdb:/iotdb/conf /docker-iotdb/iotdb/conf ```Bash docker-compose -f docker-compose-standalone.yml up -d ``` +### 2.9 使用环境变量配置内存 +功能:在docker-compose的配置文件中配置JVM启动内存。 +IoTDB版本大于等于2.0.4.1 或者大于等于1.3.5 以后才支持这种做法。 +```bash + environment: + # for datanode + - IOTDB_JMX_OPTS=-Xms4G -Xmx4G -XX:MaxDirectMemorySize=1G + # for confignode + - CONFIGNODE_JMX_OPTS=-Xms1G -Xmx1G -XX:MaxDirectMemorySize=256M +``` ## 3. 集群版部署