From b1c3afc02bda7ef3db563510b857976d48ed13d3 Mon Sep 17 00:00:00 2001 From: Cloudwise_Luke <282583553@qq.com> Date: Wed, 23 Aug 2023 14:45:28 +0800 Subject: [PATCH 1/5] update iotdb-deploy doc --- .../Deployment-Guide_timecho.md | 407 +++++++++++++++--- 1 file changed, 345 insertions(+), 62 deletions(-) diff --git a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index f94180f9..ba3d85e6 100644 --- a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -84,7 +84,7 @@ IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。 IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat、unzip功能如果没有请自行安装,可以参考文档最后的一节环境所需安装命令。 -提示:IoTDB集群管理工具需要使用具有root权限的账号 +提示:IoTDB集群管理工具需要使用有root权限的账号 ##### 部署方法 @@ -122,23 +122,31 @@ iotd cluster check example 例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotd cluster check default_cluster`即可, 更多详细命令请参考下面命令列表。 -| 参数 | 说明 | 是否必填 | -| -------------------------- | ------------------------------------------------------------ | -------- | -| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | -| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | -| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | -| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到目标节点该文件夹下最终部署完成的路径是`/jdk_iotdb` | 非必填 | -| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释 | 非必填 | -| user | ssh登陆部署机器的用户名 | 必填 | -| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | -| pkey | 密钥登陆如果password 有值优先使用password否则使用pkey登陆 | 非必填 | -| ssh_port | ssh登录端口 | 必填 | -| deploy_dir | iotdb 部署目录,会把 iotdb 部署到目标节点该文件夹下最终部署完成的路径是`/iotdb` | 必填 | -| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` | 非必填 | -| confignode-env.sh | 对应`iotdb/config/confignode-env.sh` | 非必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | -| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | +| 参数 | 说明 | 是否必填 | +|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | +| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | +| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | +| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | +| jdk_dir_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | +| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可 | 非必填 | +| user | ssh登陆部署机器的用户名 | 必填 | +| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | +| pkey | 密钥登陆如果password有值优先使用password否则使用pkey登陆 | 非必填 | +| ssh_port | ssh登录端口 | 必填 | +| deploy_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | +| iotdb_dir_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | +| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` ,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值 | 非必填 | +| confignode-env.sh | 对应`iotdb/config/confignode-env.sh`,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值 | 非必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | +| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | +| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | + +其中datanode-env.sh 和confignode-env.sh 可以配置额外参数extra_opts,当该参数配置后会在datanode-env.sh 和confignode-env.sh 后面追加对应的值,可参考default_cluster.yaml,配置示例如下: +datanode-env.sh: + extra_opts: | + I OTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+UseG1GC" + IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" * confignode_servers 是部署IoTDB Confignodes配置,里面可以配置多个Confignode 默认将第一个启动的ConfigNode节点node1当作Seed-ConfigNode @@ -170,19 +178,130 @@ iotd cluster check example | dn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port` | 必填 | | iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值 | 非必填 | -* grafana_servers 是部署Grafana 相关配置 - 该模块暂不支持 +* grafana_server 是部署Grafana 相关配置 + +| 参数 | 说明 | 是否必填 | +|------------------|------------------|-------------------| +| grafana_dir_name | Grafana 解压目录名称 | 非必填默认grafana_iotdb | +| host | Grafana 部署的服务器ip | 必填 | +| grafana_port | Grafana 部署机器的端口 | 非必填,默认3000 | +| deploy_dir | Grafana 部署服务器目录 | 必填 | +| grafana_tar_dir | Grafana 压缩包位置 | 必填 | +| dashboards | dashboards 所在的位置 | 非必填,多个用逗号隔开 | + +* prometheus_server 是部署Prometheus 相关配置 + +| 参数 | 说明 | 是否必填 | +|---------------------|----------------------------------------------------|-----------------------| +| prometheus_dir_name | Prometheus 解压目录名称 | 非必填默认prometheus_iotdb | +| host | Prometheus 部署的服务器ip | 必填 | +| prometheus_port | Prometheus 部署机器的端口 | 非必填,默认9090 | +| deploy_dir | Prometheus 部署服务器目录 | 必填 | +| prometheus_tar_dir | Prometheus 压缩包位置 | 必填 | +| storage_tsdb_retention_time | 默认保存数据天数 默认15天 | 非必填 | +| storage_tsdb_retention_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | + +如果在config/xxx.yaml的`iotdb-datanode.properties`和`iotdb-confignode.properties`中配置了metrics,则会自动把配置放入到Promethues无需手动修改 注意:如何配置yaml key对应的值包含特殊字符如:等建议整个value使用双引号,对应的文件路径中不要使用包含空格的路径,防止出现识别出现异常问题。 +#### 使用场景 + +##### 清理数据场景 + +* 清理集群数据场景会删除IoTDB集群中的data目录以及yaml文件中配置的`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`和`ext`目录。 +* 首先执行停止集群命令、然后在执行集群清理命令。 +```bash +iotd cluster stop default_cluster +iotd cluster clean default_cluster +``` + +##### 集群销毁场景 + +* 集群销毁场景会删除IoTDB集群中的`data`、`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`、`ext`、`IoTDB`部署目录、 + grafana部署目录和prometheus部署目录。 +* 首先执行停止集群命令、然后在执行集群销毁命令。 + +```bash +iotd cluster stop default_cluster +iotd cluster destroy default_cluster +``` + +##### 集群升级场景 + +* 集群升级首先需要在config/xxx.yaml中配置`iotdb_lib_dir`为要上传到服务器的jar所在目录路径(例如iotdb/lib)或者jar的zip包路径。 +* 执行上传命令、然后执行重启IoTDB集群命令即可完成集群升级 + +```bash +iotd cluster upgrade default_cluster +iotd cluster restart default_cluster +``` + +##### 集群配置文件的热部署场景 + +* 首先修改在config/xxx.yaml中配置。 +* 执行分发命令、然后执行热部署命令即可完成集群配置的热部署 + +```bash +iotd cluster distribute default_cluster +iotd cluster reload default_cluster +``` + +##### 集群扩容场景 + +* 首先修改在config/xxx.yaml中添加一个datanode 或者confignode 节点。 +* 执行集群扩容命令 +```bash +iotd cluster scaleout default_cluster +``` + +##### 集群缩容场景 + +* 首先在config/xxx.yaml中找到要缩容的节点名字或者ip+port(其中confignode port 是cn_internal_port、datanode port 是rpc_port) +* 执行集群缩容命令 +```bash +iotd cluster scalein default_cluster +``` + +##### 已有IoTDB集群,使用集群部署工具场景 + +* 配置服务器的`user`、`passwod`或`pkey`、`ssh_port` +* 修改config/xxx.yaml中IoTDB 部署路径,`deploy_dir`(IoTDB 部署目录)、`iotdb_dir_name`(IoTDB解压目录名称,默认是iotdb) + 例如IoTDB 部署完整路径是`/home/data/apache-iotdb-1.1.1`则需要修改yaml文件`deploy_dir:/home/data/`、`iotdb_dir_name:apache-iotdb-1.1.1` +* 如果服务器不是使用的java_home则修改`jdk_deploy_dir`(jdk 部署目录)、`jdk_dir_name`(jdk解压后的目录名称,默认是jdk_iotdb),如果使用的是java_home 则不需要修改配置 + 例如jdk部署完整路径是`/home/data/jdk_1.8.2`则需要修改yaml文件`jdk_deploy_dir:/home/data/`、`jdk_dir_name:jdk_1.8.2` +* 配置`cn_target_config_node_list`、`dn_target_config_node_list` +* 配置`confignode_servers`中`iotdb-confignode.properties`里面的`cn_internal_address`、`cn_internal_port`、`cn_consensus_port`、`cn_system_dir`、 + `cn_consensus_dir`和`iotdb-common.properties`里面的值不是IoTDB默认的则需要配置否则可不必配置 +* 配置`datanode_servers`中`iotdb-datanode.properties`里面的`dn_rpc_address`、`dn_internal_address`、`dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`和`iotdb-common.properties`等 +* 执行初始化命令 + +```bash +iotd cluster init default_cluster +``` + +##### 一键部署IoTDB、Grafana和Prometheus 场景 + +* 配置`iotdb-datanode.properties` 、`iotdb-confignode.properties` 打开metrics接口 +* 配置Grafana 配置,如果`dashboards` 有多个就用逗号隔开,名字不能重复否则会被覆盖。 +* 配置Prometheus配置,IoTDB 集群配置了metrics 则无需手动修改Prometheus 配置会根据哪个节点配置了metrics,自动修改Prometheus 配置。 +* 启动集群 + +```bash +iotd cluster start default_cluster +``` + +更加详细参数请参考上方的 集群配置文件介绍 + + #### 命令格式 本工具的基本用法为: - ```bash iotd cluster [params (Optional)] ``` - * key 表示了具体的命令。 * cluster name 表示集群名称(即`iotd/config` 文件中yaml文件名字)。 @@ -197,24 +316,25 @@ iotd cluster deploy default_cluster * 集群的功能及参数列表如下: -| 命令 | 功能 | 参数 | -| ---------- | --------------------------------------------- | ------------------------------------------------------------ | -| check | 检测集群是否可以部署 | 集群名称列表 | -| clean | 清理集群 | 集群名称 | -| deploy | 部署集群 | 集群名称 | -| list | 打印集群及状态列表 | 无 | -| start | 启动集群 | 集群名称,-N,节点名称(可选) | -| stop | 关闭集群 | 集群名称,-N,节点名称(可选) | -| restart | 重启集群 | 集群名称 | -| show | 查看集群信息,details字段表示展示集群信息细节 | 集群名称, details(可选) | -| destroy | 销毁集群 | 集群名称 | -| scaleout | 集群扩容 | 集群名称 | -| scalein | 集群缩容 | 集群名称,-N,集群节点名字或集群节点ip+port | -| reload | 集群热加载 | 集群名称 | -| distribute | 集群配置文件分发 | 集群名称 | -| dumplog | 备份指定集群日志 | 集群名称,-N,集群节点名字 -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -loglevel 日志类型 -l 传输速度 | -| dumpdata | 备份指定集群数据 | 集群名称, -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -l 传输速度 | -| upgrade | lib 包升级 | 集群名字(升级完后请重启) | +| 命令 | 功能 | 参数 | +|------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------| +| check | 检测集群是否可以部署 | 集群名称列表 | +| clean | 清理集群 | 集群名称 | +| deploy | 部署集群 | 集群名称 ,-op force(可选) | +| list | 打印集群及状态列表 | 无 | +| start | 启动集群 | 集群名称,-N,节点名称(可选) | +| stop | 关闭集群 | 集群名称,-N,节点名称(可选) ,-op force(可选) | +| restart | 重启集群 | 集群名称,-op force(可选) | +| show | 查看集群信息,details字段表示展示集群信息细节 | 集群名称, details(可选) | +| destroy | 销毁集群 | 集群名称 | +| scaleout | 集群扩容 | 集群名称 | +| scalein | 集群缩容 | 集群名称,-N,集群节点名字或集群节点ip+port | +| reload | 集群热加载 | 集群名称 | +| distribute | 集群配置文件分发 | 集群名称 | +| dumplog | 备份指定集群日志 | 集群名称,-N,集群节点名字 -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -loglevel 日志类型 -l 传输速度 | +| dumpdata | 备份指定集群数据 | 集群名称, -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -l 传输速度 | +| upgrade | lib 包升级 | 集群名字(升级完后请重启) | +| init | 已有集群使用集群部署工具时,初始化集群配置 | 集群名字,初始化集群配置 | #### 详细命令执行过程 @@ -233,7 +353,9 @@ iotd cluster check default_cluster * 验证对应节点上的 JDK 版本是否满足IoTDB jdk1.8及以上版本、服务器是否按照unzip、是否安装lsof 或者netstat * 如果看到下面提示`Info:example check successfully!` 证明服务器已经具备安装的要求, - 如果输出`Warn:example check fail!` 证明有部分条件没有满足需求可以查看上面的Warn日志进行修复,假如jdk没有满足要求,我们可以自己在yaml 文件中配置一个jdk1.8 及以上版本的进行部署不影响后面使用,如果检查lsof、netstat或者unzip 不满足要求需要在服务器上自行安装 + 如果输出`Error:example check fail!` 证明有部分条件没有满足需求可以查看上面的输出的Error日志(例如:`Error:Server (ip:172.20.31.76) iotdb port(10713) is listening`)进行修复, + 如果检查jdk没有满足要求,我们可以自己在yaml 文件中配置一个jdk1.8 及以上版本的进行部署不影响后面使用, + 如果检查lsof、netstat或者unzip 不满足要求需要在服务器上自行安装。 ##### 部署集群命令 @@ -244,17 +366,20 @@ iotd cluster deploy default_cluster * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 -* 根据`confignode_servers` 和`datanode_servers`中的节点信息上传iotdb压缩包和jdk压缩包(如果yaml中配置`jdk_tar_dir`和`jdk_deploy_dir`值) +* 根据`confignode_servers` 和`datanode_servers`中的节点信息上传IoTDB压缩包和jdk压缩包(如果yaml中配置`jdk_tar_dir`和`jdk_deploy_dir`值) * 根据yaml文件节点配置信息生成并上传`iotdb-common.properties`、`iotdb-confignode.properties`、`iotdb-datanode.properties` -提示:这里的confignode 和datanode部署到同一台机器上时目录不能为相同,否则会被后部署的节点文件覆盖 +```bash +iotd cluster deploy default_cluster -op force +``` +注意:该命令会强制执行部署,具体过程会删除已存在的部署目录重新部署 ##### 启动集群命令 ```bash -iotd cluster check default_cluster +iotd cluster start default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -269,19 +394,20 @@ iotd cluster check default_cluster *启动单个节点命令* ```bash +#按照IoTDB 节点名称启动 iotd cluster start default_cluster -N datanode_1 -``` - -or - -```bash +#按照IoTDB 集群ip+port启动,其中port对应confignode的cn_internal_port、datanode的rpc_port iotd cluster start default_cluster -N 192.168.1.5:6667 +#启动grafana +iotd cluster start default_cluster -N grafana +#启动prometheus +iotd cluster start default_cluster -N prometheus ``` * 根据 cluster-name 找到默认位置的 yaml 文件 * 根据提供的节点名称或者ip:port找到对于节点位置信息,如果启动的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 - 如果启动的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` + 如果启动的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` * 启动该节点 @@ -289,14 +415,9 @@ iotd cluster start default_cluster -N 192.168.1.5:6667 ```bash iotd cluster show default_cluster -``` - -or - -```bash +#查看IoTDB集群详细信息 iotd cluster show default_cluster details ``` - * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 * 依次在datanode通过cli执行`show cluster details` 如果有一个节点执行成功则不会在后续节点继续执行cli直接返回结果 @@ -307,32 +428,194 @@ iotd cluster show default_cluster details ```bash iotd cluster stop default_cluster ``` - * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 * 根据`datanode_servers`中datanode节点信息,按照配置先后顺序依次停止datanode节点 * 根据`confignode_servers`中confignode节点信息,按照配置依次停止confignode节点 +*强制停止集群命令* + +```bash +iotd cluster stop default_cluster -op force +``` +会直接执行kill -9 pid 命令强制停止集群 *停止单个节点命令* ```bash +#按照IoTDB 节点名称停止 iotd cluster stop default_cluster -N datanode_1 +#按照IoTDB 集群ip+port停止(ip+port是按照datanode中的ip+dn_rpc_port获取唯一节点或confignode中的ip+cn_internal_port获取唯一节点) +iotd cluster stop default_cluster -N 192.168.1.5:6667 +#停止grafana +iotd cluster stop default_cluster -N grafana +#停止prometheus +iotd cluster stop default_cluster -N prometheus ``` -or +* 根据 cluster-name 找到默认位置的 yaml 文件 + +* 根据提供的节点名称或者ip:port找到对应节点位置信息,如果停止的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 + 如果停止的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` + +* 停止该节点 +##### 清理集群数据命令 ```bash -iotd cluster stop default_cluster -N 192.168.1.5:6667 +iotd cluster clean default_cluster +``` + +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`配置信息 + +* 根据`confignode_servers`、`datanode_servers`中的信息,检查是否还有服务正在运行, + 如果有任何一个服务正在运行则不会执行清理命令 + +* 删除IoTDB集群中的data目录以及yaml文件中配置的`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`和`ext`目录。 + + +##### 重启集群命令 + +```bash +iotd cluster restart default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 + +* 执行上述的停止集群命令(stop),然后执行启动集群命令(start) 具体参考上面的start 和stop 命令 + +*强制重启集群命令* +```bash +iotd cluster restart default_cluster -op force +``` +会直接执行kill -9 pid 命令强制停止集群,然后启动集群 + +*停止单个节点命令* + +##### 集群缩容命令 + +```bash +#按照节点名称缩容 +iotd cluster scalein default_cluster -N nodename +#按照ip+port缩容(ip+port按照datanode中的ip+dn_rpc_port获取唯一节点,confignode中的ip+cn_internal_port获取唯一节点) +iotd cluster scalein default_cluster -N ip:port +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 判断要缩容的confignode节点和datanode是否只剩一个,如果只剩一个则不能执行缩容 + +* 然后根据ip:port或者nodename 获取要缩容的节点信息,执行缩容命令,然后销毁该节点目录,如果缩容的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 + 如果缩容的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` + + +提示:目前一次仅支持一个节点缩容 + +##### 集群扩容命令 +```bash +iotd cluster scaleout default_cluster +``` +* 修改config/xxx.yaml 文件添加一个datanode 节点或者confignode节点 + +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 找到要扩容的节点,执行上传IoTDB压缩包和jdb包(如果yaml中配置`jdk_tar_dir`和`jdk_deploy_dir`值)并解压 + +* 根据yaml文件节点配置信息生成并上传`iotdb-common.properties`、`iotdb-confignode.properties`或`iotdb-datanode.properties` + +* 执行启动该节点命令并校验节点是否启动成功 + +提示:目前一次仅支持一个节点扩容 + +##### 销毁集群命令 +```bash +iotd cluster destroy default_cluster ``` +* cluster-name 找到默认位置的 yaml 文件 + +* 根据`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`中node节点信息,检查是否节点还在运行, + 如果有任何一个节点正在运行则停止销毁命令 + +* 删除IoTDB集群中的`data`以及yaml文件配置的`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`、`ext`、`IoTDB`部署目录、 + Grafana部署目录和Prometheus部署目录 + +##### 分发集群配置命令 +```bash +iotd cluster distribute default_cluster +``` + +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 + +* 根据yaml文件节点配置信息生成并依次上传`iotdb-common.properties`、`iotdb-confignode.properties`、`iotdb-datanode.properties`、到指定节点 + +##### 热加载集群配置命令 +```bash +iotd cluster reload default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 根据yaml文件节点配置信息依次在cli中执行`load configuration` + +##### 集群节点日志备份 +```bash +iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' +``` * 根据 cluster-name 找到默认位置的 yaml 文件 -* 根据提供的节点名称或者ip:port找到对于节点位置信息,如果停止的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 - 如果停止的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` +* 该命令会根据yaml文件校验datanode_1,confignode_1 是否存在,然后根据配置的起止日期(startdate<=logtime<=enddate)备份指定节点datanode_1,confignode_1 的日志数据到指定服务`192.168.9.48` 端口`36000` 数据备份路径是 `/iotdb/logs` ,IoTDB日志存储路径在`/root/data/db/iotdb/logs`(非必填,如果不填写-logs xxx 默认从IoTDB安装路径/logs下面备份日志) + +| 命令 | 功能 | 是否必填 | +|------------|------------------------------------| ---| +| -h | 存放备份数据机器ip |否| +| -u | 存放备份数据机器用户名 |否| +| -pw | 存放备份数据机器密码 |否| +| -p | 存放备份数据机器端口(默认22) |否| +| -path | 存放备份数据的路径(默认当前路径) |否| +| -loglevel | 日志基本有all、info、error、warn(默认是全部) |否| +| -l | 限速(默认不限速范围0到104857601 单位Kbit/s) |否| +| -N | 配置文件集群名称多个用逗号隔开 |是| +| -startdate | 起始时间(包含默认1970-01-01) |否| +| -enddate | 截止时间(包含) |否| +| -logs | IoTDB 日志存放路径,默认是({iotdb}/logs) |否| + +##### 集群节点数据备份 +```bash +iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' +``` +* 该命令会根据yaml文件获取leader 节点,然后根据起止日期(startdate<=logtime<=enddate)备份数据到192.168.9.48 服务上的/iotdb/datas 目录下 + +| 命令 | 功能 | 是否必填 | +| ---|---------------------------------| ---| +|-h| 存放备份数据机器ip |否| +|-u| 存放备份数据机器用户名 |否| +|-pw| 存放备份数据机器密码 |否| +|-p| 存放备份数据机器端口(默认22) |否| +|-path| 存放备份数据的路径(默认当前路径) |否| +|-granularity| 类型partition |是| +|-l| 限速(默认不限速范围0到104857601 单位Kbit/s) |否| +|-startdate| 起始时间(包含) |是| +|-enddate| 截止时间(包含) |是| + +##### 集群升级 +```bash +iotd cluster upgrade default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 上传lib包 + +注意执行完升级后请重启IoTDB 才能生效 + +#### 集群部署工具样例介绍 +在集群部署工具安装目录中config/example 下面有3个yaml样例,如果需要可以复制到config 中进行修改即可 + +| 名称 | 说明 | +|-------------------|------------------------------------------------| +| default_1c1d.yaml | 1个confignode和1个datanode 配置样例 | +| default_3c3d.yaml | 3个confignode和3个datanode 配置样例 | +| default_3c3d_grafa_prome | 3个confignode、3个datanode、Grafana、Prometheus配置样例 | -* 停止该节点 ## 手动部署 From 225b9c44f3ee0d6326133e22a6dcc6c43af7d7c0 Mon Sep 17 00:00:00 2001 From: Cloudwise_Luke <282583553@qq.com> Date: Tue, 29 Aug 2023 14:35:26 +0800 Subject: [PATCH 2/5] update iotdb-deploy doc --- .../Deployment-Guide_timecho.md | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index ba3d85e6..aa84220f 100644 --- a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -335,7 +335,7 @@ iotd cluster deploy default_cluster | dumpdata | 备份指定集群数据 | 集群名称, -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -l 传输速度 | | upgrade | lib 包升级 | 集群名字(升级完后请重启) | | init | 已有集群使用集群部署工具时,初始化集群配置 | 集群名字,初始化集群配置 | - +| status | 查看进程状态 | 集群名字 | #### 详细命令执行过程 下面的命令都是以default_cluster.yaml 为示例执行的,用户可以修改成自己的集群文件来执行 @@ -376,6 +376,16 @@ iotd cluster deploy default_cluster -op force ``` 注意:该命令会强制执行部署,具体过程会删除已存在的部署目录重新部署 +*部署单个模块* +```bash +# 部署grafana模块 +iotd cluster deploy default_cluster -N grafana +# 部署prometheus模块 +iotd cluster deploy default_cluster -N prometheus +# 部署iotdb模块 +iotd cluster deploy default_cluster -N iotdb +``` + ##### 启动集群命令 ```bash @@ -411,7 +421,10 @@ iotd cluster start default_cluster -N prometheus * 启动该节点 -##### 查看集群状态命令 +说明:由于集群部署工具仅是调用了IoTDB集群中的start-confignode.sh和start-datanode.sh 脚本, +在实际输出结果失败时有可能是集群还未正常启动,建议使用status命令进行查看当前集群状态(iotd cluster status xxx) + +##### 查看IoTDB集群状态命令 ```bash iotd cluster show default_cluster @@ -490,7 +503,20 @@ iotd cluster restart default_cluster -op force ``` 会直接执行kill -9 pid 命令强制停止集群,然后启动集群 -*停止单个节点命令* +*重启单个节点命令* + +```bash +#按照IoTDB 节点名称重启datanode_1 +iotd cluster restart default_cluster -N datanode_1 +#按照IoTDB 节点名称重启confignode_1 +iotd cluster restart default_cluster -N confignode_1 +#重启grafana +iotd cluster restart default_cluster -N grafana +#重启prometheus +iotd cluster restart default_cluster -N prometheus +``` + + ##### 集群缩容命令 @@ -540,6 +566,16 @@ iotd cluster destroy default_cluster `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`、`ext`、`IoTDB`部署目录、 Grafana部署目录和Prometheus部署目录 +*销毁单个模块* +```bash +# 销毁grafana模块 +iotd cluster destroy default_cluster -N grafana +# 销毁prometheus模块 +iotd cluster destroy default_cluster -N prometheus +# 销毁iotdb模块 +iotd cluster destroy default_cluster -N iotdb +``` + ##### 分发集群配置命令 ```bash iotd cluster distribute default_cluster @@ -607,6 +643,21 @@ iotd cluster upgrade default_cluster 注意执行完升级后请重启IoTDB 才能生效 +##### 集群初始化 +```bash +iotd cluster init default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 +* 初始化集群配置 + +##### 查看集群进程状态 +```bash +iotd cluster status default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 +* 展示集群的存活状态 + + #### 集群部署工具样例介绍 在集群部署工具安装目录中config/example 下面有3个yaml样例,如果需要可以复制到config 中进行修改即可 From c680ddc86507038a1288015c75aa88f5ba71e919 Mon Sep 17 00:00:00 2001 From: Cloudwise_Luke <282583553@qq.com> Date: Mon, 4 Sep 2023 17:59:06 +0800 Subject: [PATCH 3/5] Updated iotdb-deploy user manual to include Chinese and English --- .../Deployment-Guide_timecho.md | 615 +++++++++++++++++- .../Deployment-Guide_timecho.md | 614 ++++++++++++++++- .../Deployment-Guide_timecho.md | 188 +++--- .../Deployment-Guide_timecho.md | 551 +++++++++++++--- 4 files changed, 1781 insertions(+), 187 deletions(-) diff --git a/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index f4b2178c..8e3d2088 100644 --- a/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -79,9 +79,620 @@ Users can start IoTDB standalone mode by the start-standalone script under the s Note: Currently, To run standalone mode, you need to ensure that all addresses are set to 127.0.0.1, If you need to access the IoTDB from a machine different from the one where the IoTDB is located, please change the configuration item `dn_rpc_address` to the IP of the machine where the IoTDB lives. And replication factors set to 1, which is by now the default setting. Besides, it's recommended to use SimpleConsensus in this mode, since it brings additional efficiency. -## Cluster Management Tool +### Cluster deployment + +#### Cluster management tool + +The IoTDB cluster management tool is an easy-to-use operation and maintenance tool (enterprise version tool). +It is designed to solve the operation and maintenance problems of multiple nodes in the IoTDB distributed system. +It mainly includes cluster deployment, cluster start and stop, elastic expansion, configuration update, data export and other functions, thereby realizing one-click command issuance for complex database clusters, which greatly Reduce management difficulty. +This document will explain how to remotely deploy, configure, start and stop IoTDB cluster instances with cluster management tools. + +#### Deploy cluster management tools + +##### Environment dependence + +The machine where IoTDB is to be deployed needs to rely on jdk 8 and above, lsof, netstat, and unzip functions. If not, please install them yourself. You can refer to the installation commands required for the environment in the last section of the document. + +Tip: The IoTDB cluster management tool requires an account with root privileges + +##### Deployment method + +###### Download and install + +This tool is a supporting tool for IoTDB Enterprise Edition. You can contact your salesperson to obtain the tool download method. + +Note: Since the binary package only supports GLIBC2.17 and above, the minimum version is Centos7. + +* After entering the following commands in the iotd directory: + +```bash +bash install-iotd.sh +``` + +The iotd keyword can be activated in the subsequent shell, such as checking the environment instructions required before deployment as follows: + +```bash +iotd cluster check example +``` + +* You can also directly use /sbin/iotd without activating iotd to execute commands, such as checking the environment required before deployment: + +```bash +/sbin/iotd cluster check example +``` + +#### Introduction to cluster configuration files + +* There is a cluster configuration yaml file in the `iotd/config` directory. The yaml file name is the cluster name. There can be multiple yaml files. In order to facilitate users to configure yaml files, a `default_cluster.yaml` example is provided under the iotd/config directory. +* The yaml file configuration consists of five major parts: `global`, `confignode_servers`, `datanode_servers`, `grafana_server`, and `prometheus_server` +* `global` is a general configuration that mainly configures machine username and password, IoTDB local installation files, Jdk configuration, etc. A `default_cluster.yaml` sample data is provided in the `iotd/config` directory, + Users can copy and modify it to their own cluster name and refer to the instructions inside to configure the IoTDB cluster. In the `default_cluster.yaml` sample, all uncommented items are required, and those that have been commented are non-required. + +例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotd cluster check default_cluster`即可, +更多详细命令请参考下面命令列表。 + + +| parameter name | parameter describe | required | +|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| iotdb_zip_dir | IoTDB deployment distribution directory, if the value is empty, it will be downloaded from the address specified by `iotdb_download_url` | NO | +| iotdb_download_url | IoTDB download address, if `iotdb_zip_dir` has no value, download from the specified address | NO | +| jdk_tar_dir | jdk local directory, you can use this jdk path to upload and deploy to the target node. | NO | +| jdk_deploy_dir | jdk remote machine deployment directory, jdk will be deployed to this directory, and the following `jdk_dir_name` parameter forms a complete jdk deployment directory, that is, `/` | NO | +| jdk_dir_name | The directory name after jdk decompression defaults to jdk_iotdb | NO | +| iotdb_lib_dir | The IoTDB lib directory or the IoTDB lib compressed package only supports .zip format and is only used for IoTDB upgrade. It is in the comment state by default. If you need to upgrade, please open the comment and modify the path. If you use a zip file, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* d | NO | +| user | User name for ssh login deployment machine | YES | +| password | The password for ssh login. If the password does not specify the use of pkey to log in, please ensure that the ssh login between nodes has been configured without a key. | NO | +| pkey | Key login: If password has a value, password is used first, otherwise pkey is used to log in. | NO | +| ssh_port | ssh port | YES | +| deploy_dir | IoTDB deployment directory, IoTDB will be deployed to this directory and the following `iotdb_dir_name` parameter will form a complete IoTDB deployment directory, that is, `/` | YES | +| iotdb_dir_name | The directory name after decompression of IoTDB is iotdb by default. | NO | +| datanode-env.sh | Corresponding to `iotdb/config/datanode-env.sh`, when `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first | NO | +| confignode-env.sh | Corresponding to `iotdb/config/confignode-env.sh`, the value in `datanode_servers` is used first when `global` and `datanode_servers` are configured at the same time | NO | +| iotdb-common.properties | Corresponds to `/config/iotdb-common.properties` | NO | +| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | +| dn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties` | YES | + +Among them, datanode-env.sh and confignode-env.sh can be configured with extra parameters extra_opts. When this parameter is configured, corresponding values will be appended after datanode-env.sh and confignode-env.sh. Refer to default_cluster.yaml for configuration examples as follows: +datanode-env.sh: +extra_opts: | +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+UseG1GC" +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" + +* `confignode_servers` is the configuration for deploying IoTDB Confignodes, in which multiple Confignodes can be configured + By default, the first started ConfigNode node node1 is regarded as the Seed-ConfigNode + +|parameter name | parameter describe | required | +|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| name | Confignode name | YES | +| deploy_dir | IoTDB config node deployment directory | YES| | +| iotdb-confignode.properties | Corresponding to `iotdb/config/iotdb-confignode.properties`, please refer to the `iotdb-confignode.properties` file description for more details. | NO | +| cn_internal_address | Corresponds to iotdb/internal communication address, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn_internal_port | Internal communication port, corresponding to `cn_internal_port` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn_consensus_port | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` | NO | +| cn_data_dir | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` Corresponds to `cn_data_dir` in `iotdb/config/iotdb-confignode.properties` | YES | +| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `confignode_servers` at the same time, the value in confignode_servers will be used first. | NO | + +* datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode + +|parameter name | parameter describe | required | +| ---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +|name| Datanode name | YES | +|deploy_dir| IoTDB data node deployment directory | YES | +|iotdb-datanode.properties| Corresponding to `iotdb/config/iotdb-datanode.properties`, please refer to the `iotdb-datanode.properties` file description for more details. | NO | +|dn_rpc_address| The datanode rpc address corresponds to `dn_rpc_address` in `iotdb/config/iotdb-datanode.properties` | YES | +|dn_internal_address| Internal communication address, corresponding to `dn_internal_address` in `iotdb/config/iotdb-datanode.properties` | YES | +|dn_target_config_node_list| The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties`. | YES | +|dn_rpc_port| Datanode rpc port address, corresponding to `dn_rpc_port` in `iotdb/config/iotdb-datanode.properties` | YES | +|dn_internal_port| Internal communication port, corresponding to `dn_internal_port` in `iotdb/config/iotdb-datanode.properties` | YES | +|iotdb-common.properties| Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `datanode_servers` at the same time, the value in `datanode_servers` will be used first. | NO | + +* grafana_server is the configuration related to deploying Grafana + +|parameter name | parameter describe | required | +|------------------|-------------------------------------------------------------|-----------| +| grafana_dir_name | Grafana decompression directory name(default grafana_iotdb) | NO | +| host | Server ip deployed by grafana | YES | +| grafana_port | The port of grafana deployment machine, default 3000 | NO | +| deploy_dir | grafana deployment server directory | YES | +| grafana_tar_dir | Grafana compressed package location | YES | +| dashboards | dashboards directory | NO | + +* prometheus_server 是部署Prometheus 相关配置 + +|parameter name | parameter describe | required | +|---------------------|----------------------------------------------------|----------| +| prometheus_dir_name | prometheus decompression directory name, default prometheus_iotdb | NO | +| host | Server IP deployed by prometheus | YES | +| prometheus_port | The port of prometheus deployment machine, default 9090 | NO | +| deploy_dir | prometheus deployment server directory | YES | +| prometheus_tar_dir | prometheus compressed package path | YES | +| storage_tsdb_retention_time | The number of days to save data is 15 days by default | NO | +| storage_tsdb_retention_size | The data size that can be saved by the specified block defaults to 512M. Please note the units are KB, MB, GB, TB, PB, and EB. | NO | + +If metrics are configured in `iotdb-datanode.properties` and `iotdb-confignode.properties` of config/xxx.yaml, the configuration will be automatically put into promethues without manual modification. + +Note: How to configure the value corresponding to the yaml key to contain special characters such as: etc. It is recommended to use double quotes for the entire value, and do not use paths containing spaces in the corresponding file paths to prevent abnormal recognition problems. + +#### scenes to be used + +##### Clean data + +* Cleaning up the cluster data scenario will delete the data directory in the IoTDB cluster and `cn_system_dir`, `cn_consensus_dir`, `cn_consensus_dir` configured in the yaml file + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs` and `ext` directories. +* First execute the stop cluster command, and then execute the cluster cleanup command. + +```bash +iotd cluster stop default_cluster +iotd cluster clean default_cluster +``` + +##### Cluster destruction + +* The cluster destruction scenario will delete `data`, `cn_system_dir`, `cn_consensus_dir`, in the IoTDB cluster + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs`, `ext`, `IoTDB` deployment directory, + grafana deployment directory and prometheus deployment directory. +* First execute the stop cluster command, and then execute the cluster destruction command. + + +```bash +iotd cluster stop default_cluster +iotd cluster destroy default_cluster +``` + +##### Cluster upgrade + +* To upgrade the cluster, you first need to configure `iotdb_lib_dir` in config/xxx.yaml as the directory path where the jar to be uploaded to the server is located (for example, iotdb/lib). +* If you use zip files to upload, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* +* Execute the upload command and then execute the restart IoTDB cluster command to complete the cluster upgrade. + +```bash +iotd cluster upgrade default_cluster +iotd cluster restart default_cluster +``` + +##### hot deployment + +* First modify the configuration in config/xxx.yaml. +* Execute the distribution command, and then execute the hot deployment command to complete the hot deployment of the cluster configuration + +```bash +iotd cluster distribute default_cluster +iotd cluster reload default_cluster +``` + +##### Cluster expansion + +* First modify and add a datanode or confignode node in config/xxx.yaml. +* Execute the cluster expansion command + +```bash +iotd cluster scaleout default_cluster +``` + +##### Cluster scaling + +* First find the node name or ip+port to shrink in config/xxx.yaml (where confignode port is cn_internal_port, datanode port is rpc_port) +* Execute cluster shrink command + +```bash +iotd cluster scalein default_cluster +``` + +##### Using cluster management tools to manipulate existing IoTDB clusters + +* Configure the server's `user`, `passwod` or `pkey`, `ssh_port` +* Modify the IoTDB deployment path in config/xxx.yaml, `deploy_dir` (IoTDB deployment directory), `iotdb_dir_name` (IoTDB decompression directory name, the default is iotdb) + For example, if the full path of IoTDB deployment is `/home/data/apache-iotdb-1.1.1`, you need to modify the yaml files `deploy_dir:/home/data/` and `iotdb_dir_name:apache-iotdb-1.1.1` +* If the server is not using java_home, modify `jdk_deploy_dir` (jdk deployment directory) and `jdk_dir_name` (the directory name after jdk decompression, the default is jdk_iotdb). If java_home is used, there is no need to modify the configuration. + For example, the full path of jdk deployment is `/home/data/jdk_1.8.2`, you need to modify the yaml files `jdk_deploy_dir:/home/data/`, `jdk_dir_name:jdk_1.8.2` +* Configure `cn_target_config_node_list`, `dn_target_config_node_list` +* Configure `cn_internal_address`, `cn_internal_port`, `cn_consensus_port`, `cn_system_dir`, in `iotdb-confignode.properties` in `confignode_servers` + If the values in `cn_consensus_dir` and `iotdb-common.properties` are not the default for IoTDB, they need to be configured, otherwise there is no need to configure them. +* Configure `dn_rpc_address`, `dn_internal_address`, `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir` and `iotdb-common.properties` in `iotdb-datanode.properties` in `datanode_servers` +* Execute initialization command + +```bash +iotd cluster init default_cluster +``` + +##### Deploy IoTDB, Grafana and Prometheus + +* Configure `iotdb-datanode.properties`, `iotdb-confignode.properties` to open the metrics interface +* Configure the Grafana configuration. If there are multiple `dashboards`, separate them with commas. The names cannot be repeated or they will be overwritten. +* Configure the Prometheus configuration. If the IoTDB cluster is configured with metrics, there is no need to manually modify the Prometheus configuration. The Prometheus configuration will be automatically modified according to which node is configured with metrics. +* Start the cluster + +```bash +iotd cluster start default_cluster +``` + +For more detailed parameters, please refer to the cluster configuration file introduction above + +#### Command + +The basic usage of this tool is: +```bash +iotd cluster [params (Optional)] +``` +* key indicates a specific command. + +* cluster name indicates the cluster name (that is, the name of the yaml file in the `iotd/config` file). + +* params indicates the required parameters of the command (optional). + +* For example, the command format to deploy the default_cluster cluster is: + +```bash +iotd cluster deploy default_cluster +``` + +* The functions and parameters of the cluster are listed as follows: + +| command | description | parameter | +|------------|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| check | check whether the cluster can be deployed | Cluster name list | +| clean | cleanup-cluster | cluster-name | +| deploy | deploy cluster | Cluster name, -N, module name (optional for iotdb, grafana, prometheus), -op force (optional) | +| list | cluster status list | None | +| start | start cluster | Cluster name, -N, node name (nodename, grafana, prometheus optional) | +| stop | stop cluster | Cluster name, -N, node name (nodename, grafana, prometheus optional), -op force (nodename, grafana, prometheus optional) | +| restart | restart cluster | Cluster name, -N, node name (nodename, grafana, prometheus optional), -op force (nodename, grafana, prometheus optional) | +| show | view cluster information. The details field indicates the details of the cluster information. | Cluster name, details (optional) | +| destroy | destroy cluster | Cluster name, -N, module name (iotdb, grafana, prometheus optional) | +| scaleout | cluster expansion | Cluster name | +| scalein | cluster shrink | Cluster name, -N, cluster node name or cluster node ip+port | +| reload | hot loading of cluster configuration files | Cluster name | +| distribute | cluster configuration file distribution | Cluster name | +| dumplog | Back up specified cluster logs | Cluster name, -N, cluster node name -h Back up to target machine ip -pw Back up to target machine password -p Back up to target machine port -path Backup directory -startdate Start time -enddate End time -loglevel Log type -l transfer speed | +| dumpdata | Backup cluster data | Cluster name, -h backup to target machine ip -pw backup to target machine password -p backup to target machine port -path backup directory -startdate start time -enddate end time -l transmission speed | +| upgrade | lib package upgrade | Cluster name | +| init | When an existing cluster uses the cluster deployment tool, initialize the cluster configuration | Cluster name | +| status | View process status | Cluster name | + +#### Detailed command execution process + +The following commands are executed using default_cluster.yaml as an example, and users can modify them to their own cluster files to execute + +##### Check cluster deployment environment commands + +```bash +iotd cluster check default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Verify that the target node is able to log in via SSH + +* Verify whether the JDK version on the corresponding node meets IoTDB jdk1.8 and above, and whether the server is installed with unzip, lsof, and netstat. + +* If you see the following prompt `Info:example check successfully!`, it proves that the server has already met the installation requirements. + If `Error:example check fail!` is output, it proves that some conditions do not meet the requirements. You can check the Error log output above (for example: `Error:Server (ip:172.20.31.76) iotdb port(10713) is listening`) to make repairs. , + If the jdk check does not meet the requirements, we can configure a jdk1.8 or above version in the yaml file ourselves for deployment without affecting subsequent use. + If checking lsof, netstat or unzip does not meet the requirements, you need to install it on the server yourself. + +##### Deploy cluster command + +```bash +iotd cluster deploy default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Upload IoTDB compressed package and jdk compressed package according to the node information in `confignode_servers` and `datanode_servers` (if `jdk_tar_dir` and `jdk_deploy_dir` values ​​are configured in yaml) + +* Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties`, `iotdb-datanode.properties` according to the yaml file node configuration information + +```bash +iotd cluster deploy default_cluster -op force +``` + +Note: This command will force the deployment, and the specific process will delete the existing deployment directory and redeploy + +*deploy a single module* +```bash +# Deploy grafana module +iotd cluster deploy default_cluster -N grafana +# Deploy the prometheus module +iotd cluster deploy default_cluster -N prometheus +# Deploy the iotdb module +iotd cluster deploy default_cluster -N iotdb +``` + +##### Start cluster command + +```bash +iotd cluster start default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Start confignode, start sequentially according to the order in `confignode_servers` in the yaml configuration file and check whether the confignode is normal according to the process id, the first confignode is seek config + +* Start the datanode in sequence according to the order in `datanode_servers` in the yaml configuration file and check whether the datanode is normal according to the process id. + +* After checking the existence of the process according to the process id, check whether each service in the cluster list is normal through the cli. If the cli link fails, retry every 10s until it succeeds and retry up to 5 times + + +* +Start a single node command* +```bash +#Start according to the IoTDB node name +iotd cluster start default_cluster -N datanode_1 +#Start according to IoTDB cluster ip+port, where port corresponds to cn_internal_port of confignode and rpc_port of datanode. +iotd cluster start default_cluster -N 192.168.1.5:6667 +#Start grafana +iotd cluster start default_cluster -N grafana +#Start prometheus +iotd cluster start default_cluster -N prometheus +``` + +* Find the yaml file in the default location based on cluster-name + +* Find the node location information based on the provided node name or ip:port. If the started node is `data_node`, the ip uses `dn_rpc_address` in the yaml file, and the port uses `dn_rpc_port` in datanode_servers in the yaml file. + If the started node is `config_node`, the ip uses `cn_internal_address` in confignode_servers in the yaml file, and the port uses `cn_internal_port` + +* start the node + +Note: Since the cluster deployment tool only calls the start-confignode.sh and start-datanode.sh scripts in the IoTDB cluster, +When the actual output result fails, it may be that the cluster has not started normally. It is recommended to use the status command to check the current cluster status (iotd cluster status xxx) + + +##### View IoTDB cluster status command + +```bash +iotd cluster show default_cluster +#View IoTDB cluster details +iotd cluster show default_cluster details +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Execute `show cluster details` through cli on datanode in turn. If one node is executed successfully, it will not continue to execute cli on subsequent nodes and return the result directly. + +##### Stop cluster command + + +```bash +iotd cluster stop default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* According to the datanode node information in `datanode_servers`, stop the datanode nodes in order according to the configuration. + +* Based on the confignode node information in `confignode_servers`, stop the confignode nodes in sequence according to the configuration + +*force stop cluster command* + +```bash +iotd cluster stop default_cluster -op force +``` +Will directly execute the kill -9 pid command to forcibly stop the cluster + +*Stop single node command* + +```bash +#Stop by IoTDB node name +iotd cluster stop default_cluster -N datanode_1 +#Stop according to IoTDB cluster ip+port (ip+port is to get the only node according to ip+dn_rpc_port in datanode or ip+cn_internal_port in confignode to get the only node) +iotd cluster stop default_cluster -N 192.168.1.5:6667 +#Stop grafana +iotd cluster stop default_cluster -N grafana +#Stop prometheus +iotd cluster stop default_cluster -N prometheus +``` + +* Find the yaml file in the default location based on cluster-name + +* Find the corresponding node location information based on the provided node name or ip:port. If the stopped node is `data_node`, the ip uses `dn_rpc_address` in the yaml file, and the port uses `dn_rpc_port` in datanode_servers in the yaml file. + If the stopped node is `config_node`, the ip uses `cn_internal_address` in confignode_servers in the yaml file, and the port uses `cn_internal_port` + +* stop the node + +Note: Since the cluster deployment tool only calls the stop-confignode.sh and stop-datanode.sh scripts in the IoTDB cluster, in some cases the iotdb cluster may not be stopped. + + +##### Clean cluster data command + +```bash +iotd cluster clean default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Based on the information in `confignode_servers` and `datanode_servers`, check whether there are still services running, + If any service is running, the cleanup command will not be executed. + +* Delete the data directory in the IoTDB cluster and the `cn_system_dir`, `cn_consensus_dir`, configured in the yaml file + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs` and `ext` directories. + + + +##### Restart cluster command + +```bash +iotd cluster restart default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` + +* Execute the above stop cluster command (stop), and then execute the start cluster command (start). For details, refer to the above start and stop commands. + +*Force restart cluster command* + +```bash +iotd cluster restart default_cluster -op force +``` +Will directly execute the kill -9 pid command to force stop the cluster, and then start the cluster + + +*Restart a single node command* + +```bash +#Restart datanode_1 according to the IoTDB node name +iotd cluster restart default_cluster -N datanode_1 +#Restart confignode_1 according to the IoTDB node name +iotd cluster restart default_cluster -N confignode_1 +#Restart grafana +iotd cluster restart default_cluster -N grafana +#Restart prometheus +iotd cluster restart default_cluster -N prometheus +``` + +##### Cluster shrink command + +```bash +#Scale down by node name +iotd cluster scalein default_cluster -N nodename +#Scale down according to ip+port (ip+port obtains the only node according to ip+dn_rpc_port in datanode, and obtains the only node according to ip+cn_internal_port in confignode) +iotd cluster scalein default_cluster -N ip:port +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Determine whether there is only one confignode node and datanode to be reduced. If there is only one left, the reduction cannot be performed. + +* Then get the node information to shrink according to ip:port or nodename, execute the shrink command, and then destroy the node directory. If the shrink node is `data_node`, use `dn_rpc_address` in the yaml file for ip, and use `dn_rpc_address` in the port. `dn_rpc_port` in datanode_servers in yaml file. + If the shrinking node is `config_node`, the ip uses `cn_internal_address` in confignode_servers in the yaml file, and the port uses `cn_internal_port` + + +Tip: Currently, only one node scaling is supported at a time + +##### Cluster expansion command + +```bash +iotd cluster scaleout default_cluster +``` +* Modify the config/xxx.yaml file to add a datanode node or confignode node + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Find the node to be expanded, upload the IoTDB compressed package and jdb package (if the `jdk_tar_dir` and `jdk_deploy_dir` values ​​are configured in yaml) and decompress it + +* Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties` or `iotdb-datanode.properties` according to the yaml file node configuration information + +* Execute the command to start the node and verify whether the node is started successfully + +Tip: Currently, only one node expansion is supported at a time + +##### destroy cluster command +```bash +iotd cluster destroy default_cluster +``` + +* cluster-name finds the yaml file in the default location + +* Check whether the node is still running based on the node node information in `confignode_servers`, `datanode_servers`, `grafana`, and `prometheus`. + Stop the destroy command if any node is running + +* Delete `data` in the IoTDB cluster and `cn_system_dir`, `cn_consensus_dir` configured in the yaml file + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs`, `ext`, `IoTDB` deployment directory, + grafana deployment directory and prometheus deployment directory + +*Destroy a single module* + +```bash +# Destroy grafana module +iotd cluster destroy default_cluster -N grafana +# Destroy prometheus module +iotd cluster destroy default_cluster -N prometheus +# Destroy iotdb module +iotd cluster destroy default_cluster -N iotdb +``` + +##### Distribute cluster configuration commands + +```bash +iotd cluster distribute default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` + +* Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties`, `iotdb-datanode.properties` to the specified node according to the node configuration information of the yaml file + +##### Hot load cluster configuration command + +```bash +iotd cluster reload default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Execute `load configuration` in the cli according to the node configuration information of the yaml file. + +##### Cluster node log backup +```bash +iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' +``` + +* Find the yaml file in the default location based on cluster-name + +* This command will verify the existence of datanode_1 and confignode_1 according to the yaml file, and then back up the log data of the specified node datanode_1 and confignode_1 to the specified service `192.168.9.48` port `36000 according to the configured start and end dates (startdate<=logtime<=enddate) ` The data backup path is `/iotdb/logs`, and the IoTDB log storage path is `/root/data/db/iotdb/logs` (not required, if you do not fill in -logs xxx, the default is to backup logs from the IoTDB installation path /logs ) + +| command | description | required | +|------------|-------------------------------------------------------------------------|----------| +| -h | backup data server ip | NO | +| -u | backup data server username | NO | +| -pw | backup data machine password | NO | +| -p | backup data machine port(default 22) | NO | +| -path | path to backup data (default current path) | NO | +| -loglevel | Log levels include all, info, error, warn (default is all) | NO | +| -l | speed limit (default 1024 speed limit range 0 to 104857601 unit Kbit/s) | NO | +| -N | multiple configuration file cluster names are separated by commas. | YES | +| -startdate | start time (including default 1970-01-01) | NO | +| -enddate | end time (included) | NO | +| -logs | IoTDB log storage path, the default is ({iotdb}/logs)) | NO | + +##### Cluster data backup +```bash +iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' +``` +* This command will obtain the leader node based on the yaml file, and then back up the data to the /iotdb/datas directory on the 192.168.9.48 service based on the start and end dates (startdate<=logtime<=enddate) + +| command | description | required | +|--------------|-------------------------------------------------------------------------|----------| +| -h | backup data server ip | NO | +| -u | backup data server username | NO | +| -pw | backup data machine password | NO | +| -p | backup data machine port(default 22) | NO | +| -path | path to backup data (default current path) | NO | +| -granularity | partition | YES | +| -l | speed limit (default 1024 speed limit range 0 to 104857601 unit Kbit/s) | NO | +| -startdate | start time (including default 1970-01-01) | YES | +| -enddate | end time (included) | YES | + +##### Cluster upgrade +```bash +iotd cluster upgrade default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Upload lib package + +Note that after performing the upgrade, please restart IoTDB for it to take effect. + +##### Cluster initialization +```bash +iotd cluster init default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` +* Initialize cluster configuration + +##### View cluster process status +```bash +iotd cluster status default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` +* Display the survival status of each node in the cluster + +#### Introduction to Cluster Deployment Tool Samples + +In the cluster deployment tool installation directory config/example, there are three yaml examples. If necessary, you can copy them to config and modify them. + +| name | description | +|--------------------------|------------------------------------------------| +| default_1c1d.yaml | 1 confignode and 1 datanode configuration example | +| default_3c3d.yaml | 3 confignode and 3 datanode configuration samples | +| default_3c3d_grafa_prome | 3 confignode and 3 datanode, Grafana, Prometheus configuration examples | -TODO ## Manual Deployment diff --git a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md index f4b2178c..fd583819 100644 --- a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -79,9 +79,619 @@ Users can start IoTDB standalone mode by the start-standalone script under the s Note: Currently, To run standalone mode, you need to ensure that all addresses are set to 127.0.0.1, If you need to access the IoTDB from a machine different from the one where the IoTDB is located, please change the configuration item `dn_rpc_address` to the IP of the machine where the IoTDB lives. And replication factors set to 1, which is by now the default setting. Besides, it's recommended to use SimpleConsensus in this mode, since it brings additional efficiency. -## Cluster Management Tool +### Cluster deployment -TODO +#### Cluster management tool + +The IoTDB cluster management tool is an easy-to-use operation and maintenance tool (enterprise version tool). +It is designed to solve the operation and maintenance problems of multiple nodes in the IoTDB distributed system. +It mainly includes cluster deployment, cluster start and stop, elastic expansion, configuration update, data export and other functions, thereby realizing one-click command issuance for complex database clusters, which greatly Reduce management difficulty. +This document will explain how to remotely deploy, configure, start and stop IoTDB cluster instances with cluster management tools. + +#### Deploy cluster management tools + +##### Environment dependence + +The machine where IoTDB is to be deployed needs to rely on jdk 8 and above, lsof, netstat, and unzip functions. If not, please install them yourself. You can refer to the installation commands required for the environment in the last section of the document. + +Tip: The IoTDB cluster management tool requires an account with root privileges + +##### Deployment method + +###### Download and install + +This tool is a supporting tool for IoTDB Enterprise Edition. You can contact your salesperson to obtain the tool download method. + +Note: Since the binary package only supports GLIBC2.17 and above, the minimum version is Centos7. + +* After entering the following commands in the iotd directory: + +```bash +bash install-iotd.sh +``` + +The iotd keyword can be activated in the subsequent shell, such as checking the environment instructions required before deployment as follows: + +```bash +iotd cluster check example +``` + +* You can also directly use /sbin/iotd without activating iotd to execute commands, such as checking the environment required before deployment: + +```bash +/sbin/iotd cluster check example +``` + +#### Introduction to cluster configuration files + +* There is a cluster configuration yaml file in the `iotd/config` directory. The yaml file name is the cluster name. There can be multiple yaml files. In order to facilitate users to configure yaml files, a `default_cluster.yaml` example is provided under the iotd/config directory. +* The yaml file configuration consists of five major parts: `global`, `confignode_servers`, `datanode_servers`, `grafana_server`, and `prometheus_server` +* `global` is a general configuration that mainly configures machine username and password, IoTDB local installation files, Jdk configuration, etc. A `default_cluster.yaml` sample data is provided in the `iotd/config` directory, + Users can copy and modify it to their own cluster name and refer to the instructions inside to configure the IoTDB cluster. In the `default_cluster.yaml` sample, all uncommented items are required, and those that have been commented are non-required. + +例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotd cluster check default_cluster`即可, +更多详细命令请参考下面命令列表。 + + +| parameter name | parameter describe | required | +|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| iotdb_zip_dir | IoTDB deployment distribution directory, if the value is empty, it will be downloaded from the address specified by `iotdb_download_url` | NO | +| iotdb_download_url | IoTDB download address, if `iotdb_zip_dir` has no value, download from the specified address | NO | +| jdk_tar_dir | jdk local directory, you can use this jdk path to upload and deploy to the target node. | NO | +| jdk_deploy_dir | jdk remote machine deployment directory, jdk will be deployed to this directory, and the following `jdk_dir_name` parameter forms a complete jdk deployment directory, that is, `/` | NO | +| jdk_dir_name | The directory name after jdk decompression defaults to jdk_iotdb | NO | +| iotdb_lib_dir | The IoTDB lib directory or the IoTDB lib compressed package only supports .zip format and is only used for IoTDB upgrade. It is in the comment state by default. If you need to upgrade, please open the comment and modify the path. If you use a zip file, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* d | NO | +| user | User name for ssh login deployment machine | YES | +| password | The password for ssh login. If the password does not specify the use of pkey to log in, please ensure that the ssh login between nodes has been configured without a key. | NO | +| pkey | Key login: If password has a value, password is used first, otherwise pkey is used to log in. | NO | +| ssh_port | ssh port | YES | +| deploy_dir | IoTDB deployment directory, IoTDB will be deployed to this directory and the following `iotdb_dir_name` parameter will form a complete IoTDB deployment directory, that is, `/` | YES | +| iotdb_dir_name | The directory name after decompression of IoTDB is iotdb by default. | NO | +| datanode-env.sh | Corresponding to `iotdb/config/datanode-env.sh`, when `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first | NO | +| confignode-env.sh | Corresponding to `iotdb/config/confignode-env.sh`, the value in `datanode_servers` is used first when `global` and `datanode_servers` are configured at the same time | NO | +| iotdb-common.properties | Corresponds to `/config/iotdb-common.properties` | NO | +| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | +| dn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties` | YES | + +Among them, datanode-env.sh and confignode-env.sh can be configured with extra parameters extra_opts. When this parameter is configured, corresponding values will be appended after datanode-env.sh and confignode-env.sh. Refer to default_cluster.yaml for configuration examples as follows: +datanode-env.sh: +extra_opts: | +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+UseG1GC" +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" + +* `confignode_servers` is the configuration for deploying IoTDB Confignodes, in which multiple Confignodes can be configured + By default, the first started ConfigNode node node1 is regarded as the Seed-ConfigNode + +|parameter name | parameter describe | required | +|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| name | Confignode name | YES | +| deploy_dir | IoTDB config node deployment directory | YES| | +| iotdb-confignode.properties | Corresponding to `iotdb/config/iotdb-confignode.properties`, please refer to the `iotdb-confignode.properties` file description for more details. | NO | +| cn_internal_address | Corresponds to iotdb/internal communication address, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn_internal_port | Internal communication port, corresponding to `cn_internal_port` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn_consensus_port | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` | NO | +| cn_data_dir | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` Corresponds to `cn_data_dir` in `iotdb/config/iotdb-confignode.properties` | YES | +| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `confignode_servers` at the same time, the value in confignode_servers will be used first. | NO | + +* datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode + +|parameter name | parameter describe | required | +| ---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +|name| Datanode name | YES | +|deploy_dir| IoTDB data node deployment directory | YES | +|iotdb-datanode.properties| Corresponding to `iotdb/config/iotdb-datanode.properties`, please refer to the `iotdb-datanode.properties` file description for more details. | NO | +|dn_rpc_address| The datanode rpc address corresponds to `dn_rpc_address` in `iotdb/config/iotdb-datanode.properties` | YES | +|dn_internal_address| Internal communication address, corresponding to `dn_internal_address` in `iotdb/config/iotdb-datanode.properties` | YES | +|dn_target_config_node_list| The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties`. | YES | +|dn_rpc_port| Datanode rpc port address, corresponding to `dn_rpc_port` in `iotdb/config/iotdb-datanode.properties` | YES | +|dn_internal_port| Internal communication port, corresponding to `dn_internal_port` in `iotdb/config/iotdb-datanode.properties` | YES | +|iotdb-common.properties| Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `datanode_servers` at the same time, the value in `datanode_servers` will be used first. | NO | + +* grafana_server is the configuration related to deploying Grafana + +|parameter name | parameter describe | required | +|------------------|-------------------------------------------------------------|-----------| +| grafana_dir_name | Grafana decompression directory name(default grafana_iotdb) | NO | +| host | Server ip deployed by grafana | YES | +| grafana_port | The port of grafana deployment machine, default 3000 | NO | +| deploy_dir | grafana deployment server directory | YES | +| grafana_tar_dir | Grafana compressed package location | YES | +| dashboards | dashboards directory | NO | + +* prometheus_server 是部署Prometheus 相关配置 + +|parameter name | parameter describe | required | +|---------------------|----------------------------------------------------|----------| +| prometheus_dir_name | prometheus decompression directory name, default prometheus_iotdb | NO | +| host | Server IP deployed by prometheus | YES | +| prometheus_port | The port of prometheus deployment machine, default 9090 | NO | +| deploy_dir | prometheus deployment server directory | YES | +| prometheus_tar_dir | prometheus compressed package path | YES | +| storage_tsdb_retention_time | The number of days to save data is 15 days by default | NO | +| storage_tsdb_retention_size | The data size that can be saved by the specified block defaults to 512M. Please note the units are KB, MB, GB, TB, PB, and EB. | NO | + +If metrics are configured in `iotdb-datanode.properties` and `iotdb-confignode.properties` of config/xxx.yaml, the configuration will be automatically put into promethues without manual modification. + +Note: How to configure the value corresponding to the yaml key to contain special characters such as: etc. It is recommended to use double quotes for the entire value, and do not use paths containing spaces in the corresponding file paths to prevent abnormal recognition problems. + +#### scenes to be used + +##### Clean data + +* Cleaning up the cluster data scenario will delete the data directory in the IoTDB cluster and `cn_system_dir`, `cn_consensus_dir`, `cn_consensus_dir` configured in the yaml file + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs` and `ext` directories. +* First execute the stop cluster command, and then execute the cluster cleanup command. + +```bash +iotd cluster stop default_cluster +iotd cluster clean default_cluster +``` + +##### Cluster destruction + +* The cluster destruction scenario will delete `data`, `cn_system_dir`, `cn_consensus_dir`, in the IoTDB cluster + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs`, `ext`, `IoTDB` deployment directory, + grafana deployment directory and prometheus deployment directory. +* First execute the stop cluster command, and then execute the cluster destruction command. + + +```bash +iotd cluster stop default_cluster +iotd cluster destroy default_cluster +``` + +##### Cluster upgrade + +* To upgrade the cluster, you first need to configure `iotdb_lib_dir` in config/xxx.yaml as the directory path where the jar to be uploaded to the server is located (for example, iotdb/lib). +* If you use zip files to upload, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* +* Execute the upload command and then execute the restart IoTDB cluster command to complete the cluster upgrade. + +```bash +iotd cluster upgrade default_cluster +iotd cluster restart default_cluster +``` + +##### hot deployment + +* First modify the configuration in config/xxx.yaml. +* Execute the distribution command, and then execute the hot deployment command to complete the hot deployment of the cluster configuration + +```bash +iotd cluster distribute default_cluster +iotd cluster reload default_cluster +``` + +##### Cluster expansion + +* First modify and add a datanode or confignode node in config/xxx.yaml. +* Execute the cluster expansion command + +```bash +iotd cluster scaleout default_cluster +``` + +##### Cluster scaling + +* First find the node name or ip+port to shrink in config/xxx.yaml (where confignode port is cn_internal_port, datanode port is rpc_port) +* Execute cluster shrink command + +```bash +iotd cluster scalein default_cluster +``` + +##### Using cluster management tools to manipulate existing IoTDB clusters + +* Configure the server's `user`, `passwod` or `pkey`, `ssh_port` +* Modify the IoTDB deployment path in config/xxx.yaml, `deploy_dir` (IoTDB deployment directory), `iotdb_dir_name` (IoTDB decompression directory name, the default is iotdb) + For example, if the full path of IoTDB deployment is `/home/data/apache-iotdb-1.1.1`, you need to modify the yaml files `deploy_dir:/home/data/` and `iotdb_dir_name:apache-iotdb-1.1.1` +* If the server is not using java_home, modify `jdk_deploy_dir` (jdk deployment directory) and `jdk_dir_name` (the directory name after jdk decompression, the default is jdk_iotdb). If java_home is used, there is no need to modify the configuration. + For example, the full path of jdk deployment is `/home/data/jdk_1.8.2`, you need to modify the yaml files `jdk_deploy_dir:/home/data/`, `jdk_dir_name:jdk_1.8.2` +* Configure `cn_target_config_node_list`, `dn_target_config_node_list` +* Configure `cn_internal_address`, `cn_internal_port`, `cn_consensus_port`, `cn_system_dir`, in `iotdb-confignode.properties` in `confignode_servers` + If the values in `cn_consensus_dir` and `iotdb-common.properties` are not the default for IoTDB, they need to be configured, otherwise there is no need to configure them. +* Configure `dn_rpc_address`, `dn_internal_address`, `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir` and `iotdb-common.properties` in `iotdb-datanode.properties` in `datanode_servers` +* Execute initialization command + +```bash +iotd cluster init default_cluster +``` + +##### Deploy IoTDB, Grafana and Prometheus + +* Configure `iotdb-datanode.properties`, `iotdb-confignode.properties` to open the metrics interface +* Configure the Grafana configuration. If there are multiple `dashboards`, separate them with commas. The names cannot be repeated or they will be overwritten. +* Configure the Prometheus configuration. If the IoTDB cluster is configured with metrics, there is no need to manually modify the Prometheus configuration. The Prometheus configuration will be automatically modified according to which node is configured with metrics. +* Start the cluster + +```bash +iotd cluster start default_cluster +``` + +For more detailed parameters, please refer to the cluster configuration file introduction above + +#### Command + +The basic usage of this tool is: +```bash +iotd cluster [params (Optional)] +``` +* key indicates a specific command. + +* cluster name indicates the cluster name (that is, the name of the yaml file in the `iotd/config` file). + +* params indicates the required parameters of the command (optional). + +* For example, the command format to deploy the default_cluster cluster is: + +```bash +iotd cluster deploy default_cluster +``` + +* The functions and parameters of the cluster are listed as follows: + +| command | description | parameter | +|------------|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| check | check whether the cluster can be deployed | Cluster name list | +| clean | cleanup-cluster | cluster-name | +| deploy | deploy cluster | Cluster name, -N, module name (optional for iotdb, grafana, prometheus), -op force (optional) | +| list | cluster status list | None | +| start | start cluster | Cluster name, -N, node name (nodename, grafana, prometheus optional) | +| stop | stop cluster | Cluster name, -N, node name (nodename, grafana, prometheus optional), -op force (nodename, grafana, prometheus optional) | +| restart | restart cluster | Cluster name, -N, node name (nodename, grafana, prometheus optional), -op force (nodename, grafana, prometheus optional) | +| show | view cluster information. The details field indicates the details of the cluster information. | Cluster name, details (optional) | +| destroy | destroy cluster | Cluster name, -N, module name (iotdb, grafana, prometheus optional) | +| scaleout | cluster expansion | Cluster name | +| scalein | cluster shrink | Cluster name, -N, cluster node name or cluster node ip+port | +| reload | hot loading of cluster configuration files | Cluster name | +| distribute | cluster configuration file distribution | Cluster name | +| dumplog | Back up specified cluster logs | Cluster name, -N, cluster node name -h Back up to target machine ip -pw Back up to target machine password -p Back up to target machine port -path Backup directory -startdate Start time -enddate End time -loglevel Log type -l transfer speed | +| dumpdata | Backup cluster data | Cluster name, -h backup to target machine ip -pw backup to target machine password -p backup to target machine port -path backup directory -startdate start time -enddate end time -l transmission speed | +| upgrade | lib package upgrade | Cluster name | +| init | When an existing cluster uses the cluster deployment tool, initialize the cluster configuration | Cluster name | +| status | View process status | Cluster name | + +#### Detailed command execution process + +The following commands are executed using default_cluster.yaml as an example, and users can modify them to their own cluster files to execute + +##### Check cluster deployment environment commands + +```bash +iotd cluster check default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Verify that the target node is able to log in via SSH + +* Verify whether the JDK version on the corresponding node meets IoTDB jdk1.8 and above, and whether the server is installed with unzip, lsof, and netstat. + +* If you see the following prompt `Info:example check successfully!`, it proves that the server has already met the installation requirements. + If `Error:example check fail!` is output, it proves that some conditions do not meet the requirements. You can check the Error log output above (for example: `Error:Server (ip:172.20.31.76) iotdb port(10713) is listening`) to make repairs. , + If the jdk check does not meet the requirements, we can configure a jdk1.8 or above version in the yaml file ourselves for deployment without affecting subsequent use. + If checking lsof, netstat or unzip does not meet the requirements, you need to install it on the server yourself. + +##### Deploy cluster command + +```bash +iotd cluster deploy default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Upload IoTDB compressed package and jdk compressed package according to the node information in `confignode_servers` and `datanode_servers` (if `jdk_tar_dir` and `jdk_deploy_dir` values ​​are configured in yaml) + +* Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties`, `iotdb-datanode.properties` according to the yaml file node configuration information + +```bash +iotd cluster deploy default_cluster -op force +``` + +Note: This command will force the deployment, and the specific process will delete the existing deployment directory and redeploy + +*deploy a single module* +```bash +# Deploy grafana module +iotd cluster deploy default_cluster -N grafana +# Deploy the prometheus module +iotd cluster deploy default_cluster -N prometheus +# Deploy the iotdb module +iotd cluster deploy default_cluster -N iotdb +``` + +##### Start cluster command + +```bash +iotd cluster start default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Start confignode, start sequentially according to the order in `confignode_servers` in the yaml configuration file and check whether the confignode is normal according to the process id, the first confignode is seek config + +* Start the datanode in sequence according to the order in `datanode_servers` in the yaml configuration file and check whether the datanode is normal according to the process id. + +* After checking the existence of the process according to the process id, check whether each service in the cluster list is normal through the cli. If the cli link fails, retry every 10s until it succeeds and retry up to 5 times + + +* +Start a single node command* +```bash +#Start according to the IoTDB node name +iotd cluster start default_cluster -N datanode_1 +#Start according to IoTDB cluster ip+port, where port corresponds to cn_internal_port of confignode and rpc_port of datanode. +iotd cluster start default_cluster -N 192.168.1.5:6667 +#Start grafana +iotd cluster start default_cluster -N grafana +#Start prometheus +iotd cluster start default_cluster -N prometheus +``` + +* Find the yaml file in the default location based on cluster-name + +* Find the node location information based on the provided node name or ip:port. If the started node is `data_node`, the ip uses `dn_rpc_address` in the yaml file, and the port uses `dn_rpc_port` in datanode_servers in the yaml file. + If the started node is `config_node`, the ip uses `cn_internal_address` in confignode_servers in the yaml file, and the port uses `cn_internal_port` + +* start the node + +Note: Since the cluster deployment tool only calls the start-confignode.sh and start-datanode.sh scripts in the IoTDB cluster, +When the actual output result fails, it may be that the cluster has not started normally. It is recommended to use the status command to check the current cluster status (iotd cluster status xxx) + + +##### View IoTDB cluster status command + +```bash +iotd cluster show default_cluster +#View IoTDB cluster details +iotd cluster show default_cluster details +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Execute `show cluster details` through cli on datanode in turn. If one node is executed successfully, it will not continue to execute cli on subsequent nodes and return the result directly. + +##### Stop cluster command + + +```bash +iotd cluster stop default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* According to the datanode node information in `datanode_servers`, stop the datanode nodes in order according to the configuration. + +* Based on the confignode node information in `confignode_servers`, stop the confignode nodes in sequence according to the configuration + +*force stop cluster command* + +```bash +iotd cluster stop default_cluster -op force +``` +Will directly execute the kill -9 pid command to forcibly stop the cluster + +*Stop single node command* + +```bash +#Stop by IoTDB node name +iotd cluster stop default_cluster -N datanode_1 +#Stop according to IoTDB cluster ip+port (ip+port is to get the only node according to ip+dn_rpc_port in datanode or ip+cn_internal_port in confignode to get the only node) +iotd cluster stop default_cluster -N 192.168.1.5:6667 +#Stop grafana +iotd cluster stop default_cluster -N grafana +#Stop prometheus +iotd cluster stop default_cluster -N prometheus +``` + +* Find the yaml file in the default location based on cluster-name + +* Find the corresponding node location information based on the provided node name or ip:port. If the stopped node is `data_node`, the ip uses `dn_rpc_address` in the yaml file, and the port uses `dn_rpc_port` in datanode_servers in the yaml file. + If the stopped node is `config_node`, the ip uses `cn_internal_address` in confignode_servers in the yaml file, and the port uses `cn_internal_port` + +* stop the node + +Note: Since the cluster deployment tool only calls the stop-confignode.sh and stop-datanode.sh scripts in the IoTDB cluster, in some cases the iotdb cluster may not be stopped. + + +##### Clean cluster data command + +```bash +iotd cluster clean default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Based on the information in `confignode_servers` and `datanode_servers`, check whether there are still services running, + If any service is running, the cleanup command will not be executed. + +* Delete the data directory in the IoTDB cluster and the `cn_system_dir`, `cn_consensus_dir`, configured in the yaml file + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs` and `ext` directories. + + + +##### Restart cluster command + +```bash +iotd cluster restart default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` + +* Execute the above stop cluster command (stop), and then execute the start cluster command (start). For details, refer to the above start and stop commands. + +*Force restart cluster command* + +```bash +iotd cluster restart default_cluster -op force +``` +Will directly execute the kill -9 pid command to force stop the cluster, and then start the cluster + + +*Restart a single node command* + +```bash +#Restart datanode_1 according to the IoTDB node name +iotd cluster restart default_cluster -N datanode_1 +#Restart confignode_1 according to the IoTDB node name +iotd cluster restart default_cluster -N confignode_1 +#Restart grafana +iotd cluster restart default_cluster -N grafana +#Restart prometheus +iotd cluster restart default_cluster -N prometheus +``` + +##### Cluster shrink command + +```bash +#Scale down by node name +iotd cluster scalein default_cluster -N nodename +#Scale down according to ip+port (ip+port obtains the only node according to ip+dn_rpc_port in datanode, and obtains the only node according to ip+cn_internal_port in confignode) +iotd cluster scalein default_cluster -N ip:port +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Determine whether there is only one confignode node and datanode to be reduced. If there is only one left, the reduction cannot be performed. + +* Then get the node information to shrink according to ip:port or nodename, execute the shrink command, and then destroy the node directory. If the shrink node is `data_node`, use `dn_rpc_address` in the yaml file for ip, and use `dn_rpc_address` in the port. `dn_rpc_port` in datanode_servers in yaml file. + If the shrinking node is `config_node`, the ip uses `cn_internal_address` in confignode_servers in the yaml file, and the port uses `cn_internal_port` + + +Tip: Currently, only one node scaling is supported at a time + +##### Cluster expansion command + +```bash +iotd cluster scaleout default_cluster +``` +* Modify the config/xxx.yaml file to add a datanode node or confignode node + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Find the node to be expanded, upload the IoTDB compressed package and jdb package (if the `jdk_tar_dir` and `jdk_deploy_dir` values ​​are configured in yaml) and decompress it + +* Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties` or `iotdb-datanode.properties` according to the yaml file node configuration information + +* Execute the command to start the node and verify whether the node is started successfully + +Tip: Currently, only one node expansion is supported at a time + +##### destroy cluster command +```bash +iotd cluster destroy default_cluster +``` + +* cluster-name finds the yaml file in the default location + +* Check whether the node is still running based on the node node information in `confignode_servers`, `datanode_servers`, `grafana`, and `prometheus`. + Stop the destroy command if any node is running + +* Delete `data` in the IoTDB cluster and `cn_system_dir`, `cn_consensus_dir` configured in the yaml file + `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs`, `ext`, `IoTDB` deployment directory, + grafana deployment directory and prometheus deployment directory + +*Destroy a single module* + +```bash +# Destroy grafana module +iotd cluster destroy default_cluster -N grafana +# Destroy prometheus module +iotd cluster destroy default_cluster -N prometheus +# Destroy iotdb module +iotd cluster destroy default_cluster -N iotdb +``` + +##### Distribute cluster configuration commands + +```bash +iotd cluster distribute default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` + +* Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties`, `iotdb-datanode.properties` to the specified node according to the node configuration information of the yaml file + +##### Hot load cluster configuration command + +```bash +iotd cluster reload default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Execute `load configuration` in the cli according to the node configuration information of the yaml file. + +##### Cluster node log backup +```bash +iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' +``` + +* Find the yaml file in the default location based on cluster-name + +* This command will verify the existence of datanode_1 and confignode_1 according to the yaml file, and then back up the log data of the specified node datanode_1 and confignode_1 to the specified service `192.168.9.48` port `36000 according to the configured start and end dates (startdate<=logtime<=enddate) ` The data backup path is `/iotdb/logs`, and the IoTDB log storage path is `/root/data/db/iotdb/logs` (not required, if you do not fill in -logs xxx, the default is to backup logs from the IoTDB installation path /logs ) + +| command | description | required | +|------------|-------------------------------------------------------------------------|----------| +| -h | backup data server ip | NO | +| -u | backup data server username | NO | +| -pw | backup data machine password | NO | +| -p | backup data machine port(default 22) | NO | +| -path | path to backup data (default current path) | NO | +| -loglevel | Log levels include all, info, error, warn (default is all) | NO | +| -l | speed limit (default 1024 speed limit range 0 to 104857601 unit Kbit/s) | NO | +| -N | multiple configuration file cluster names are separated by commas. | YES | +| -startdate | start time (including default 1970-01-01) | NO | +| -enddate | end time (included) | NO | +| -logs | IoTDB log storage path, the default is ({iotdb}/logs)) | NO | + +##### Cluster data backup +```bash +iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' +``` +* This command will obtain the leader node based on the yaml file, and then back up the data to the /iotdb/datas directory on the 192.168.9.48 service based on the start and end dates (startdate<=logtime<=enddate) + +| command | description | required | +|--------------|-------------------------------------------------------------------------|----------| +| -h | backup data server ip | NO | +| -u | backup data server username | NO | +| -pw | backup data machine password | NO | +| -p | backup data machine port(default 22) | NO | +| -path | path to backup data (default current path) | NO | +| -granularity | partition | YES | +| -l | speed limit (default 1024 speed limit range 0 to 104857601 unit Kbit/s) | NO | +| -startdate | start time (including default 1970-01-01) | YES | +| -enddate | end time (included) | YES | + +##### Cluster upgrade +```bash +iotd cluster upgrade default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` + +* Upload lib package + +Note that after performing the upgrade, please restart IoTDB for it to take effect. + +##### Cluster initialization +```bash +iotd cluster init default_cluster +``` +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` +* Initialize cluster configuration + +##### View cluster process status +```bash +iotd cluster status default_cluster +``` + +* Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` +* Display the survival status of each node in the cluster + +#### Introduction to Cluster Deployment Tool Samples + +In the cluster deployment tool installation directory config/example, there are three yaml examples. If necessary, you can copy them to config and modify them. + +| name | description | +|--------------------------|------------------------------------------------| +| default_1c1d.yaml | 1 confignode and 1 datanode configuration example | +| default_3c3d.yaml | 3 confignode and 3 datanode configuration samples | +| default_3c3d_grafa_prome | 3 confignode and 3 datanode, Grafana, Prometheus configuration examples | ## Manual Deployment diff --git a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index aa84220f..1aa7663d 100644 --- a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -72,17 +72,18 @@ Windows 系统启动命令如下: 注意:目前,要使用单机模式,你需要保证所有的地址设置为 127.0.0.1,如果需要从非 IoTDB 所在的机器访问此IoTDB,请将配置项 `dn_rpc_address` 修改为 IoTDB 所在的机器 IP。副本数设置为1。并且,推荐使用 SimpleConsensus,因为这会带来额外的效率。这些现在都是默认配置。 -## 集群版部署 +### 集群版部署 -### 集群管理工具部署 +#### 集群管理工具部署 -IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB 分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发,极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止 IoTDB 集群实例。 +IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB 分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发, +极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止 IoTDB 集群实例。 #### 部署集群管理工具 ##### 环境依赖 -IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat、unzip功能如果没有请自行安装,可以参考文档最后的一节环境所需安装命令。 +IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof、netstat、unzip功能如果没有请自行安装,可以参考文档最后的一节环境所需安装命令。 提示:IoTDB集群管理工具需要使用有root权限的账号 @@ -94,7 +95,7 @@ IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat 注意:由于二进制包仅支持GLIBC2.17 及以上版本,因此最低适配Centos7版本 -* 在在iotd目录内输入以下指令后: +* 在iotd目录内输入以下指令后: ```bash bash install-iotd.sh @@ -106,102 +107,114 @@ bash install-iotd.sh iotd cluster check example ``` -* 也可以不激活iotd直接使用 <iotd absolute path>/sbin/iotd 来执行命令,如检查部署前所需的环境: +* 也可以不激活iotd直接使用 /sbin/iotd 来执行命令,如检查部署前所需的环境: ```bash /sbin/iotd cluster check example ``` +#### 系统结构 + +IoTDB集群管理工具主要由config、logs、doc、sbin目录组成。 + +* `config`存放要部署的集群配置文件如果要使用集群部署工具需要修改里面的yaml文件。 + +* `logs` 存放部署工具日志,如果想要查看部署工具执行日志请查看`logs/iotd_yyyy_mm_dd.log`。 + +* `sbin` 存放集群部署工具所需的二进制包。 + +* `doc` 存放用户手册、开发手册和推荐部署手册。 + #### 集群配置文件介绍 * 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml 文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。 -* yaml 文件配置由`global`、`confignode_servers`、`datanode_servers`、`grafana_servers`(功能待开发)四大部分组成 +* yaml 文件配置由`global`、`confignode_servers`、`datanode_servers`、`grafana_server`、`prometheus_server`五大部分组成 * global 是通用配置主要配置机器用户名密码、IoTDB本地安装文件、Jdk配置等。在`iotd/config`目录中提供了一个`default_cluster.yaml`样例数据, - 用户可以复制修改成自己集群名字并参考里面的说明进行配置iotdb集群,在`default_cluster.yaml`样例中没有注释的均为必填项,已经注释的为非必填项。 + 用户可以复制修改成自己集群名字并参考里面的说明进行配置IoTDB集群,在`default_cluster.yaml`样例中没有注释的均为必填项,已经注释的为非必填项。 例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotd cluster check default_cluster`即可, 更多详细命令请参考下面命令列表。 -| 参数 | 说明 | 是否必填 | -|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| -| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | -| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | -| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | -| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | -| jdk_dir_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | -| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可 | 非必填 | -| user | ssh登陆部署机器的用户名 | 必填 | -| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | -| pkey | 密钥登陆如果password有值优先使用password否则使用pkey登陆 | 非必填 | -| ssh_port | ssh登录端口 | 必填 | -| deploy_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | -| iotdb_dir_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | -| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` ,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值 | 非必填 | -| confignode-env.sh | 对应`iotdb/config/confignode-env.sh`,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值 | 非必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | + +| 参数 | 说明 | 是否必填 | +|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | +| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | +| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | +| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | +| jdk_dir_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | +| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可。如果使用zip文件请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* | 非必填 | +| user | ssh登陆部署机器的用户名 | 必填 | +| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | +| pkey | 密钥登陆如果password有值优先使用password否则使用pkey登陆 | 非必填 | +| ssh_port | ssh登录端口 | 必填 | +| deploy_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | +| iotdb_dir_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | +| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` ,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值 | 非必填 | +| confignode-env.sh | 对应`iotdb/config/confignode-env.sh`,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值 | 非必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | | cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | +| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | 其中datanode-env.sh 和confignode-env.sh 可以配置额外参数extra_opts,当该参数配置后会在datanode-env.sh 和confignode-env.sh 后面追加对应的值,可参考default_cluster.yaml,配置示例如下: datanode-env.sh: - extra_opts: | - I OTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+UseG1GC" - IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" +extra_opts: | +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+UseG1GC" +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" * confignode_servers 是部署IoTDB Confignodes配置,里面可以配置多个Confignode - 默认将第一个启动的ConfigNode节点node1当作Seed-ConfigNode - -| 参数 | 说明 | 是否必填 | -| --------------------------- | ------------------------------------------------------------ | -------- | -| name | Confignode 名称 | 必填 | -| deploy_dir | IoTDB config node 部署目录,注:该目录不能与下面的IoTDB data node部署目录相同 | 必填| | -| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | -| cn_internal_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | -| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| cn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | -| cn_consensus_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | -| cn_data_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode_servers中的值 | 非必填 | - + 默认将第一个启动的ConfigNode节点node1当作Seed-ConfigNode + +| 参数 | 说明 | 是否必填 | +|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| name | Confignode 名称 | 必填 | +| deploy_dir | IoTDB config node 部署目录 | 必填| | +| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | +| cn_internal_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | +| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | +| cn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | +| cn_consensus_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | +| cn_data_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode_servers中的值 | 非必填 | * datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode -| 参数 | 说明 | 是否必填 | -| -------------------------- | ------------------------------------------------------------ | -------- | -| name | Datanode 名称 | 必填 | -| deploy_dir | IoTDB data node 部署目录,注:该目录不能与下面的IoTDB config node部署目录相同 | 必填 | -| iotdb-datanode.properties | 对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明 | 非必填 | -| dn_rpc_address | datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address` | 必填 | -| dn_internal_address | 内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address` | 必填 | -| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | -| dn_rpc_port | datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port` | 必填 | -| dn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port` | 必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值 | 非必填 | +| 参数 | 说明 |是否必填| +| ---| --- |--- | +|name|Datanode 名称|必填| +|deploy_dir|IoTDB data node 部署目录|必填| +|iotdb-datanode.properties|对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明|非必填| +|dn_rpc_address|datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address`|必填| +|dn_internal_address|内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address`|必填| +|dn_target_config_node_list|集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list`|必填| +|dn_rpc_port|datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port`|必填| +|dn_internal_port|内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port`|必填| +|iotdb-common.properties|对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值|非必填| * grafana_server 是部署Grafana 相关配置 | 参数 | 说明 | 是否必填 | |------------------|------------------|-------------------| -| grafana_dir_name | Grafana 解压目录名称 | 非必填默认grafana_iotdb | -| host | Grafana 部署的服务器ip | 必填 | -| grafana_port | Grafana 部署机器的端口 | 非必填,默认3000 | -| deploy_dir | Grafana 部署服务器目录 | 必填 | -| grafana_tar_dir | Grafana 压缩包位置 | 必填 | +| grafana_dir_name | grafana 解压目录名称 | 非必填默认grafana_iotdb | +| host | grafana 部署的服务器ip | 必填 | +| grafana_port | grafana 部署机器的端口 | 非必填,默认3000 | +| deploy_dir | grafana 部署服务器目录 | 必填 | +| grafana_tar_dir | grafana 压缩包位置 | 必填 | | dashboards | dashboards 所在的位置 | 非必填,多个用逗号隔开 | * prometheus_server 是部署Prometheus 相关配置 -| 参数 | 说明 | 是否必填 | -|---------------------|----------------------------------------------------|-----------------------| -| prometheus_dir_name | Prometheus 解压目录名称 | 非必填默认prometheus_iotdb | -| host | Prometheus 部署的服务器ip | 必填 | -| prometheus_port | Prometheus 部署机器的端口 | 非必填,默认9090 | -| deploy_dir | Prometheus 部署服务器目录 | 必填 | -| prometheus_tar_dir | Prometheus 压缩包位置 | 必填 | -| storage_tsdb_retention_time | 默认保存数据天数 默认15天 | 非必填 | -| storage_tsdb_retention_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | +| 参数 | 说明 | 是否必填 | +|---------------------|------------------|-----------------------| +| prometheus_dir_name | prometheus 解压目录名称 | 非必填默认prometheus_iotdb | +| host | prometheus 部署的服务器ip | 必填 | +| prometheus_port | prometheus 部署机器的端口 | 非必填,默认9090 | +| deploy_dir | prometheus 部署服务器目录 | 必填 | +| prometheus_tar_dir | prometheus 压缩包位置 | 必填 | +| storage_tsdb_retention_time | 默认保存数据天数 默认15天 | 非必填 | +| storage_tsdb_retention_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | -如果在config/xxx.yaml的`iotdb-datanode.properties`和`iotdb-confignode.properties`中配置了metrics,则会自动把配置放入到Promethues无需手动修改 +如果在config/xxx.yaml的`iotdb-datanode.properties`和`iotdb-confignode.properties`中配置了metrics,则会自动把配置放入到promethues无需手动修改 注意:如何配置yaml key对应的值包含特殊字符如:等建议整个value使用双引号,对应的文件路径中不要使用包含空格的路径,防止出现识别出现异常问题。 @@ -224,6 +237,7 @@ iotd cluster clean default_cluster grafana部署目录和prometheus部署目录。 * 首先执行停止集群命令、然后在执行集群销毁命令。 + ```bash iotd cluster stop default_cluster iotd cluster destroy default_cluster @@ -231,7 +245,8 @@ iotd cluster destroy default_cluster ##### 集群升级场景 -* 集群升级首先需要在config/xxx.yaml中配置`iotdb_lib_dir`为要上传到服务器的jar所在目录路径(例如iotdb/lib)或者jar的zip包路径。 +* 集群升级首先需要在config/xxx.yaml中配置`iotdb_lib_dir`为要上传到服务器的jar所在目录路径(例如iotdb/lib)。 +* 如果使用zip文件上传请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* * 执行上传命令、然后执行重启IoTDB集群命令即可完成集群升级 ```bash @@ -320,13 +335,13 @@ iotd cluster deploy default_cluster |------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------| | check | 检测集群是否可以部署 | 集群名称列表 | | clean | 清理集群 | 集群名称 | -| deploy | 部署集群 | 集群名称 ,-op force(可选) | +| deploy | 部署集群 | 集群名称 ,-N,模块名称(iotdb、grafana、prometheus可选),-op force(可选) | | list | 打印集群及状态列表 | 无 | -| start | 启动集群 | 集群名称,-N,节点名称(可选) | -| stop | 关闭集群 | 集群名称,-N,节点名称(可选) ,-op force(可选) | -| restart | 重启集群 | 集群名称,-op force(可选) | +| start | 启动集群 | 集群名称,-N,节点名称(nodename、grafana、prometheus可选) | +| stop | 关闭集群 | 集群名称,-N,节点名称(nodename、grafana、prometheus可选) ,-op force(nodename、grafana、prometheus可选) | +| restart | 重启集群 | 集群名称,-N,节点名称(nodename、grafana、prometheus可选),-op force(nodename、grafana、prometheus可选) | | show | 查看集群信息,details字段表示展示集群信息细节 | 集群名称, details(可选) | -| destroy | 销毁集群 | 集群名称 | +| destroy | 销毁集群 | 集群名称,-N,模块名称(iotdb、grafana、prometheus可选) | | scaleout | 集群扩容 | 集群名称 | | scalein | 集群缩容 | 集群名称,-N,集群节点名字或集群节点ip+port | | reload | 集群热加载 | 集群名称 | @@ -336,6 +351,7 @@ iotd cluster deploy default_cluster | upgrade | lib 包升级 | 集群名字(升级完后请重启) | | init | 已有集群使用集群部署工具时,初始化集群配置 | 集群名字,初始化集群配置 | | status | 查看进程状态 | 集群名字 | + #### 详细命令执行过程 下面的命令都是以default_cluster.yaml 为示例执行的,用户可以修改成自己的集群文件来执行 @@ -350,14 +366,13 @@ iotd cluster check default_cluster * 验证目标节点是否能够通过 SSH 登录 -* 验证对应节点上的 JDK 版本是否满足IoTDB jdk1.8及以上版本、服务器是否按照unzip、是否安装lsof 或者netstat +* 验证对应节点上的 JDK 版本是否满足IoTDB jdk1.8及以上版本、服务器是否按照unzip、是否安装lsof 或者netstat * 如果看到下面提示`Info:example check successfully!` 证明服务器已经具备安装的要求, 如果输出`Error:example check fail!` 证明有部分条件没有满足需求可以查看上面的输出的Error日志(例如:`Error:Server (ip:172.20.31.76) iotdb port(10713) is listening`)进行修复, 如果检查jdk没有满足要求,我们可以自己在yaml 文件中配置一个jdk1.8 及以上版本的进行部署不影响后面使用, 如果检查lsof、netstat或者unzip 不满足要求需要在服务器上自行安装。 - ##### 部署集群命令 ```bash @@ -372,7 +387,6 @@ iotd cluster deploy default_cluster ```bash iotd cluster deploy default_cluster -op force - ``` 注意:该命令会强制执行部署,具体过程会删除已存在的部署目录重新部署 @@ -402,7 +416,6 @@ iotd cluster start default_cluster *启动单个节点命令* - ```bash #按照IoTDB 节点名称启动 iotd cluster start default_cluster -N datanode_1 @@ -424,6 +437,7 @@ iotd cluster start default_cluster -N prometheus 说明:由于集群部署工具仅是调用了IoTDB集群中的start-confignode.sh和start-datanode.sh 脚本, 在实际输出结果失败时有可能是集群还未正常启动,建议使用status命令进行查看当前集群状态(iotd cluster status xxx) + ##### 查看IoTDB集群状态命令 ```bash @@ -438,6 +452,7 @@ iotd cluster show default_cluster details ##### 停止集群命令 + ```bash iotd cluster stop default_cluster ``` @@ -474,7 +489,11 @@ iotd cluster stop default_cluster -N prometheus * 停止该节点 +说明:由于集群部署工具仅是调用了IoTDB集群中的stop-confignode.sh和stop-datanode.sh 脚本,在某些情况下有可能iotdb集群并未停止。 + + ##### 清理集群数据命令 + ```bash iotd cluster clean default_cluster ``` @@ -488,6 +507,7 @@ iotd cluster clean default_cluster `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`和`ext`目录。 + ##### 重启集群命令 ```bash @@ -498,6 +518,7 @@ iotd cluster restart default_cluster * 执行上述的停止集群命令(stop),然后执行启动集群命令(start) 具体参考上面的start 和stop 命令 *强制重启集群命令* + ```bash iotd cluster restart default_cluster -op force ``` @@ -516,8 +537,6 @@ iotd cluster restart default_cluster -N grafana iotd cluster restart default_cluster -N prometheus ``` - - ##### 集群缩容命令 ```bash @@ -537,6 +556,7 @@ iotd cluster scalein default_cluster -N ip:port 提示:目前一次仅支持一个节点缩容 ##### 集群扩容命令 + ```bash iotd cluster scaleout default_cluster ``` @@ -564,7 +584,7 @@ iotd cluster destroy default_cluster * 删除IoTDB集群中的`data`以及yaml文件配置的`cn_system_dir`、`cn_consensus_dir`、 `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`、`ext`、`IoTDB`部署目录、 - Grafana部署目录和Prometheus部署目录 + grafana部署目录和prometheus部署目录 *销毁单个模块* ```bash @@ -657,7 +677,6 @@ iotd cluster status default_cluster * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 * 展示集群的存活状态 - #### 集群部署工具样例介绍 在集群部署工具安装目录中config/example 下面有3个yaml样例,如果需要可以复制到config 中进行修改即可 @@ -665,7 +684,8 @@ iotd cluster status default_cluster |-------------------|------------------------------------------------| | default_1c1d.yaml | 1个confignode和1个datanode 配置样例 | | default_3c3d.yaml | 3个confignode和3个datanode 配置样例 | -| default_3c3d_grafa_prome | 3个confignode、3个datanode、Grafana、Prometheus配置样例 | +| default_3c3d_grafa_prome | 3个confignode和3个datanode、Grafana、Prometheus配置样例 | + ## 手动部署 diff --git a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md index f94180f9..db964ab3 100644 --- a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -72,19 +72,20 @@ Windows 系统启动命令如下: 注意:目前,要使用单机模式,你需要保证所有的地址设置为 127.0.0.1,如果需要从非 IoTDB 所在的机器访问此IoTDB,请将配置项 `dn_rpc_address` 修改为 IoTDB 所在的机器 IP。副本数设置为1。并且,推荐使用 SimpleConsensus,因为这会带来额外的效率。这些现在都是默认配置。 -## 集群版部署 +### 集群版部署 -### 集群管理工具部署 +#### 集群管理工具部署 -IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB 分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发,极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止 IoTDB 集群实例。 +IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB 分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发, +极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止 IoTDB 集群实例。 #### 部署集群管理工具 ##### 环境依赖 -IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat、unzip功能如果没有请自行安装,可以参考文档最后的一节环境所需安装命令。 +IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof、netstat、unzip功能如果没有请自行安装,可以参考文档最后的一节环境所需安装命令。 -提示:IoTDB集群管理工具需要使用具有root权限的账号 +提示:IoTDB集群管理工具需要使用有root权限的账号 ##### 部署方法 @@ -94,7 +95,7 @@ IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat 注意:由于二进制包仅支持GLIBC2.17 及以上版本,因此最低适配Centos7版本 -* 在在iotd目录内输入以下指令后: +* 在iotd目录内输入以下指令后: ```bash bash install-iotd.sh @@ -106,83 +107,216 @@ bash install-iotd.sh iotd cluster check example ``` -* 也可以不激活iotd直接使用 <iotd absolute path>/sbin/iotd 来执行命令,如检查部署前所需的环境: +* 也可以不激活iotd直接使用 /sbin/iotd 来执行命令,如检查部署前所需的环境: ```bash /sbin/iotd cluster check example ``` +#### 系统结构 + +IoTDB集群管理工具主要由config、logs、doc、sbin目录组成。 + +* `config`存放要部署的集群配置文件如果要使用集群部署工具需要修改里面的yaml文件。 + +* `logs` 存放部署工具日志,如果想要查看部署工具执行日志请查看`logs/iotd_yyyy_mm_dd.log`。 + +* `sbin` 存放集群部署工具所需的二进制包。 + +* `doc` 存放用户手册、开发手册和推荐部署手册。 + #### 集群配置文件介绍 * 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml 文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。 -* yaml 文件配置由`global`、`confignode_servers`、`datanode_servers`、`grafana_servers`(功能待开发)四大部分组成 +* yaml 文件配置由`global`、`confignode_servers`、`datanode_servers`、`grafana_server`、`prometheus_server`四大部分组成 * global 是通用配置主要配置机器用户名密码、IoTDB本地安装文件、Jdk配置等。在`iotd/config`目录中提供了一个`default_cluster.yaml`样例数据, - 用户可以复制修改成自己集群名字并参考里面的说明进行配置iotdb集群,在`default_cluster.yaml`样例中没有注释的均为必填项,已经注释的为非必填项。 + 用户可以复制修改成自己集群名字并参考里面的说明进行配置IoTDB集群,在`default_cluster.yaml`样例中没有注释的均为必填项,已经注释的为非必填项。 例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotd cluster check default_cluster`即可, 更多详细命令请参考下面命令列表。 -| 参数 | 说明 | 是否必填 | -| -------------------------- | ------------------------------------------------------------ | -------- | -| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | -| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | -| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | -| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到目标节点该文件夹下最终部署完成的路径是`/jdk_iotdb` | 非必填 | -| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释 | 非必填 | -| user | ssh登陆部署机器的用户名 | 必填 | -| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | -| pkey | 密钥登陆如果password 有值优先使用password否则使用pkey登陆 | 非必填 | -| ssh_port | ssh登录端口 | 必填 | -| deploy_dir | iotdb 部署目录,会把 iotdb 部署到目标节点该文件夹下最终部署完成的路径是`/iotdb` | 必填 | -| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` | 非必填 | -| confignode-env.sh | 对应`iotdb/config/confignode-env.sh` | 非必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | -| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | - -* confignode_servers 是部署IoTDB Confignodes配置,里面可以配置多个Confignode - 默认将第一个启动的ConfigNode节点node1当作Seed-ConfigNode -| 参数 | 说明 | 是否必填 | -| --------------------------- | ------------------------------------------------------------ | -------- | -| name | Confignode 名称 | 必填 | -| deploy_dir | IoTDB config node 部署目录,注:该目录不能与下面的IoTDB data node部署目录相同 | 必填| | -| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | -| cn_internal_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | -| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| cn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | -| cn_consensus_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | -| cn_data_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode_servers中的值 | 非必填 | +| 参数 | 说明 | 是否必填 | +|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | +| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | +| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | +| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | +| jdk_dir_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | +| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可。如果使用zip文件请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* | 非必填 | +| user | ssh登陆部署机器的用户名 | 必填 | +| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | +| pkey | 密钥登陆如果password有值优先使用password否则使用pkey登陆 | 非必填 | +| ssh_port | ssh登录端口 | 必填 | +| deploy_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | +| iotdb_dir_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | +| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` ,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值 | 非必填 | +| confignode-env.sh | 对应`iotdb/config/confignode-env.sh`,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值 | 非必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | +| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | +| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | + +其中datanode-env.sh 和confignode-env.sh 可以配置额外参数extra_opts,当该参数配置后会在datanode-env.sh 和confignode-env.sh 后面追加对应的值,可参考default_cluster.yaml,配置示例如下: +datanode-env.sh: +extra_opts: | +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+UseG1GC" +IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" +* confignode_servers 是部署IoTDB Confignodes配置,里面可以配置多个Confignode + 默认将第一个启动的ConfigNode节点node1当作Seed-ConfigNode + +| 参数 | 说明 | 是否必填 | +|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| name | Confignode 名称 | 必填 | +| deploy_dir | IoTDB config node 部署目录 | 必填| | +| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | +| cn_internal_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | +| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | +| cn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | +| cn_consensus_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | +| cn_data_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode_servers中的值 | 非必填 | * datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode -| 参数 | 说明 | 是否必填 | -| -------------------------- | ------------------------------------------------------------ | -------- | -| name | Datanode 名称 | 必填 | -| deploy_dir | IoTDB data node 部署目录,注:该目录不能与下面的IoTDB config node部署目录相同 | 必填 | -| iotdb-datanode.properties | 对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明 | 非必填 | -| dn_rpc_address | datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address` | 必填 | -| dn_internal_address | 内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address` | 必填 | -| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | -| dn_rpc_port | datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port` | 必填 | -| dn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port` | 必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值 | 非必填 | - -* grafana_servers 是部署Grafana 相关配置 - 该模块暂不支持 +| 参数 | 说明 |是否必填| +| ---| --- |--- | +|name|Datanode 名称|必填| +|deploy_dir|IoTDB data node 部署目录|必填| +|iotdb-datanode.properties|对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明|非必填| +|dn_rpc_address|datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address`|必填| +|dn_internal_address|内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address`|必填| +|dn_target_config_node_list|集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list`|必填| +|dn_rpc_port|datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port`|必填| +|dn_internal_port|内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port`|必填| +|iotdb-common.properties|对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值|非必填| + +* grafana_server 是部署Grafana 相关配置 + +| 参数 | 说明 | 是否必填 | +|------------------|------------------|-------------------| +| grafana_dir_name | grafana 解压目录名称 | 非必填默认grafana_iotdb | +| host | grafana 部署的服务器ip | 必填 | +| grafana_port | grafana 部署机器的端口 | 非必填,默认3000 | +| deploy_dir | grafana 部署服务器目录 | 必填 | +| grafana_tar_dir | grafana 压缩包位置 | 必填 | +| dashboards | dashboards 所在的位置 | 非必填,多个用逗号隔开 | + +* prometheus_server 是部署Prometheus 相关配置 + +| 参数 | 说明 | 是否必填 | +|---------------------|------------------|-----------------------| +| prometheus_dir_name | prometheus 解压目录名称 | 非必填默认prometheus_iotdb | +| host | prometheus 部署的服务器ip | 必填 | +| prometheus_port | prometheus 部署机器的端口 | 非必填,默认9090 | +| deploy_dir | prometheus 部署服务器目录 | 必填 | +| prometheus_tar_dir | prometheus 压缩包位置 | 必填 | +| storage_tsdb_retention_time | 默认保存数据天数 默认15天 | 非必填 | +| storage_tsdb_retention_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | + +如果在config/xxx.yaml的`iotdb-datanode.properties`和`iotdb-confignode.properties`中配置了metrics,则会自动把配置放入到promethues无需手动修改 注意:如何配置yaml key对应的值包含特殊字符如:等建议整个value使用双引号,对应的文件路径中不要使用包含空格的路径,防止出现识别出现异常问题。 +#### 使用场景 + +##### 清理数据场景 + +* 清理集群数据场景会删除IoTDB集群中的data目录以及yaml文件中配置的`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`和`ext`目录。 +* 首先执行停止集群命令、然后在执行集群清理命令。 +```bash +iotd cluster stop default_cluster +iotd cluster clean default_cluster +``` + +##### 集群销毁场景 + +* 集群销毁场景会删除IoTDB集群中的`data`、`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`、`ext`、`IoTDB`部署目录、 + grafana部署目录和prometheus部署目录。 +* 首先执行停止集群命令、然后在执行集群销毁命令。 + + +```bash +iotd cluster stop default_cluster +iotd cluster destroy default_cluster +``` + +##### 集群升级场景 + +* 集群升级首先需要在config/xxx.yaml中配置`iotdb_lib_dir`为要上传到服务器的jar所在目录路径(例如iotdb/lib)。 +* 如果使用zip文件上传请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* +* 执行上传命令、然后执行重启IoTDB集群命令即可完成集群升级 + +```bash +iotd cluster upgrade default_cluster +iotd cluster restart default_cluster +``` + +##### 集群配置文件的热部署场景 + +* 首先修改在config/xxx.yaml中配置。 +* 执行分发命令、然后执行热部署命令即可完成集群配置的热部署 + +```bash +iotd cluster distribute default_cluster +iotd cluster reload default_cluster +``` + +##### 集群扩容场景 + +* 首先修改在config/xxx.yaml中添加一个datanode 或者confignode 节点。 +* 执行集群扩容命令 +```bash +iotd cluster scaleout default_cluster +``` + +##### 集群缩容场景 + +* 首先在config/xxx.yaml中找到要缩容的节点名字或者ip+port(其中confignode port 是cn_internal_port、datanode port 是rpc_port) +* 执行集群缩容命令 +```bash +iotd cluster scalein default_cluster +``` + +##### 已有IoTDB集群,使用集群部署工具场景 + +* 配置服务器的`user`、`passwod`或`pkey`、`ssh_port` +* 修改config/xxx.yaml中IoTDB 部署路径,`deploy_dir`(IoTDB 部署目录)、`iotdb_dir_name`(IoTDB解压目录名称,默认是iotdb) + 例如IoTDB 部署完整路径是`/home/data/apache-iotdb-1.1.1`则需要修改yaml文件`deploy_dir:/home/data/`、`iotdb_dir_name:apache-iotdb-1.1.1` +* 如果服务器不是使用的java_home则修改`jdk_deploy_dir`(jdk 部署目录)、`jdk_dir_name`(jdk解压后的目录名称,默认是jdk_iotdb),如果使用的是java_home 则不需要修改配置 + 例如jdk部署完整路径是`/home/data/jdk_1.8.2`则需要修改yaml文件`jdk_deploy_dir:/home/data/`、`jdk_dir_name:jdk_1.8.2` +* 配置`cn_target_config_node_list`、`dn_target_config_node_list` +* 配置`confignode_servers`中`iotdb-confignode.properties`里面的`cn_internal_address`、`cn_internal_port`、`cn_consensus_port`、`cn_system_dir`、 + `cn_consensus_dir`和`iotdb-common.properties`里面的值不是IoTDB默认的则需要配置否则可不必配置 +* 配置`datanode_servers`中`iotdb-datanode.properties`里面的`dn_rpc_address`、`dn_internal_address`、`dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`和`iotdb-common.properties`等 +* 执行初始化命令 + +```bash +iotd cluster init default_cluster +``` + +##### 一键部署IoTDB、Grafana和Prometheus 场景 + +* 配置`iotdb-datanode.properties` 、`iotdb-confignode.properties` 打开metrics接口 +* 配置Grafana 配置,如果`dashboards` 有多个就用逗号隔开,名字不能重复否则会被覆盖。 +* 配置Prometheus配置,IoTDB 集群配置了metrics 则无需手动修改Prometheus 配置会根据哪个节点配置了metrics,自动修改Prometheus 配置。 +* 启动集群 + +```bash +iotd cluster start default_cluster +``` + +更加详细参数请参考上方的 集群配置文件介绍 + + #### 命令格式 本工具的基本用法为: - ```bash iotd cluster [params (Optional)] ``` - * key 表示了具体的命令。 * cluster name 表示集群名称(即`iotd/config` 文件中yaml文件名字)。 @@ -197,24 +331,26 @@ iotd cluster deploy default_cluster * 集群的功能及参数列表如下: -| 命令 | 功能 | 参数 | -| ---------- | --------------------------------------------- | ------------------------------------------------------------ | -| check | 检测集群是否可以部署 | 集群名称列表 | -| clean | 清理集群 | 集群名称 | -| deploy | 部署集群 | 集群名称 | -| list | 打印集群及状态列表 | 无 | -| start | 启动集群 | 集群名称,-N,节点名称(可选) | -| stop | 关闭集群 | 集群名称,-N,节点名称(可选) | -| restart | 重启集群 | 集群名称 | -| show | 查看集群信息,details字段表示展示集群信息细节 | 集群名称, details(可选) | -| destroy | 销毁集群 | 集群名称 | -| scaleout | 集群扩容 | 集群名称 | -| scalein | 集群缩容 | 集群名称,-N,集群节点名字或集群节点ip+port | -| reload | 集群热加载 | 集群名称 | -| distribute | 集群配置文件分发 | 集群名称 | -| dumplog | 备份指定集群日志 | 集群名称,-N,集群节点名字 -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -loglevel 日志类型 -l 传输速度 | -| dumpdata | 备份指定集群数据 | 集群名称, -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -l 传输速度 | -| upgrade | lib 包升级 | 集群名字(升级完后请重启) | +| 命令 | 功能 | 参数 | +|------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------| +| check | 检测集群是否可以部署 | 集群名称列表 | +| clean | 清理集群 | 集群名称 | +| deploy | 部署集群 | 集群名称 ,-N,模块名称(iotdb、grafana、prometheus可选),-op force(可选) | +| list | 打印集群及状态列表 | 无 | +| start | 启动集群 | 集群名称,-N,节点名称(nodename、grafana、prometheus可选) | +| stop | 关闭集群 | 集群名称,-N,节点名称(nodename、grafana、prometheus可选) ,-op force(nodename、grafana、prometheus可选) | +| restart | 重启集群 | 集群名称,-N,节点名称(nodename、grafana、prometheus可选),-op force(nodename、grafana、prometheus可选) | +| show | 查看集群信息,details字段表示展示集群信息细节 | 集群名称, details(可选) | +| destroy | 销毁集群 | 集群名称,-N,模块名称(iotdb、grafana、prometheus可选) | +| scaleout | 集群扩容 | 集群名称 | +| scalein | 集群缩容 | 集群名称,-N,集群节点名字或集群节点ip+port | +| reload | 集群热加载 | 集群名称 | +| distribute | 集群配置文件分发 | 集群名称 | +| dumplog | 备份指定集群日志 | 集群名称,-N,集群节点名字 -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -loglevel 日志类型 -l 传输速度 | +| dumpdata | 备份指定集群数据 | 集群名称, -h 备份至目标机器ip -pw 备份至目标机器密码 -p 备份至目标机器端口 -path 备份的目录 -startdate 起始时间 -enddate 结束时间 -l 传输速度 | +| upgrade | lib 包升级 | 集群名字(升级完后请重启) | +| init | 已有集群使用集群部署工具时,初始化集群配置 | 集群名字,初始化集群配置 | +| status | 查看进程状态 | 集群名字 | #### 详细命令执行过程 @@ -230,11 +366,12 @@ iotd cluster check default_cluster * 验证目标节点是否能够通过 SSH 登录 -* 验证对应节点上的 JDK 版本是否满足IoTDB jdk1.8及以上版本、服务器是否按照unzip、是否安装lsof 或者netstat +* 验证对应节点上的 JDK 版本是否满足IoTDB jdk1.8及以上版本、服务器是否按照unzip、是否安装lsof 或者netstat * 如果看到下面提示`Info:example check successfully!` 证明服务器已经具备安装的要求, - 如果输出`Warn:example check fail!` 证明有部分条件没有满足需求可以查看上面的Warn日志进行修复,假如jdk没有满足要求,我们可以自己在yaml 文件中配置一个jdk1.8 及以上版本的进行部署不影响后面使用,如果检查lsof、netstat或者unzip 不满足要求需要在服务器上自行安装 - + 如果输出`Error:example check fail!` 证明有部分条件没有满足需求可以查看上面的输出的Error日志(例如:`Error:Server (ip:172.20.31.76) iotdb port(10713) is listening`)进行修复, + 如果检查jdk没有满足要求,我们可以自己在yaml 文件中配置一个jdk1.8 及以上版本的进行部署不影响后面使用, + 如果检查lsof、netstat或者unzip 不满足要求需要在服务器上自行安装。 ##### 部署集群命令 @@ -244,17 +381,29 @@ iotd cluster deploy default_cluster * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 -* 根据`confignode_servers` 和`datanode_servers`中的节点信息上传iotdb压缩包和jdk压缩包(如果yaml中配置`jdk_tar_dir`和`jdk_deploy_dir`值) +* 根据`confignode_servers` 和`datanode_servers`中的节点信息上传IoTDB压缩包和jdk压缩包(如果yaml中配置`jdk_tar_dir`和`jdk_deploy_dir`值) * 根据yaml文件节点配置信息生成并上传`iotdb-common.properties`、`iotdb-confignode.properties`、`iotdb-datanode.properties` -提示:这里的confignode 和datanode部署到同一台机器上时目录不能为相同,否则会被后部署的节点文件覆盖 +```bash +iotd cluster deploy default_cluster -op force +``` +注意:该命令会强制执行部署,具体过程会删除已存在的部署目录重新部署 +*部署单个模块* +```bash +# 部署grafana模块 +iotd cluster deploy default_cluster -N grafana +# 部署prometheus模块 +iotd cluster deploy default_cluster -N prometheus +# 部署iotdb模块 +iotd cluster deploy default_cluster -N iotdb +``` ##### 启动集群命令 ```bash -iotd cluster check default_cluster +iotd cluster start default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -267,36 +416,35 @@ iotd cluster check default_cluster *启动单个节点命令* - ```bash +#按照IoTDB 节点名称启动 iotd cluster start default_cluster -N datanode_1 -``` - -or - -```bash +#按照IoTDB 集群ip+port启动,其中port对应confignode的cn_internal_port、datanode的rpc_port iotd cluster start default_cluster -N 192.168.1.5:6667 +#启动grafana +iotd cluster start default_cluster -N grafana +#启动prometheus +iotd cluster start default_cluster -N prometheus ``` * 根据 cluster-name 找到默认位置的 yaml 文件 * 根据提供的节点名称或者ip:port找到对于节点位置信息,如果启动的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 - 如果启动的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` + 如果启动的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` * 启动该节点 -##### 查看集群状态命令 +说明:由于集群部署工具仅是调用了IoTDB集群中的start-confignode.sh和start-datanode.sh 脚本, +在实际输出结果失败时有可能是集群还未正常启动,建议使用status命令进行查看当前集群状态(iotd cluster status xxx) -```bash -iotd cluster show default_cluster -``` -or +##### 查看IoTDB集群状态命令 ```bash +iotd cluster show default_cluster +#查看IoTDB集群详细信息 iotd cluster show default_cluster details ``` - * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 * 依次在datanode通过cli执行`show cluster details` 如果有一个节点执行成功则不会在后续节点继续执行cli直接返回结果 @@ -304,35 +452,240 @@ iotd cluster show default_cluster details ##### 停止集群命令 + ```bash iotd cluster stop default_cluster ``` - * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 * 根据`datanode_servers`中datanode节点信息,按照配置先后顺序依次停止datanode节点 * 根据`confignode_servers`中confignode节点信息,按照配置依次停止confignode节点 +*强制停止集群命令* + +```bash +iotd cluster stop default_cluster -op force +``` +会直接执行kill -9 pid 命令强制停止集群 *停止单个节点命令* ```bash +#按照IoTDB 节点名称停止 iotd cluster stop default_cluster -N datanode_1 +#按照IoTDB 集群ip+port停止(ip+port是按照datanode中的ip+dn_rpc_port获取唯一节点或confignode中的ip+cn_internal_port获取唯一节点) +iotd cluster stop default_cluster -N 192.168.1.5:6667 +#停止grafana +iotd cluster stop default_cluster -N grafana +#停止prometheus +iotd cluster stop default_cluster -N prometheus +``` + +* 根据 cluster-name 找到默认位置的 yaml 文件 + +* 根据提供的节点名称或者ip:port找到对应节点位置信息,如果停止的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 + 如果停止的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` + +* 停止该节点 + +说明:由于集群部署工具仅是调用了IoTDB集群中的stop-confignode.sh和stop-datanode.sh 脚本,在某些情况下有可能iotdb集群并未停止。 + + +##### 清理集群数据命令 + +```bash +iotd cluster clean default_cluster +``` + +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`配置信息 + +* 根据`confignode_servers`、`datanode_servers`中的信息,检查是否还有服务正在运行, + 如果有任何一个服务正在运行则不会执行清理命令 + +* 删除IoTDB集群中的data目录以及yaml文件中配置的`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`和`ext`目录。 + + + +##### 重启集群命令 + +```bash +iotd cluster restart default_cluster ``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 + +* 执行上述的停止集群命令(stop),然后执行启动集群命令(start) 具体参考上面的start 和stop 命令 -or +*强制重启集群命令* ```bash -iotd cluster stop default_cluster -N 192.168.1.5:6667 +iotd cluster restart default_cluster -op force +``` +会直接执行kill -9 pid 命令强制停止集群,然后启动集群 + +*重启单个节点命令* + +```bash +#按照IoTDB 节点名称重启datanode_1 +iotd cluster restart default_cluster -N datanode_1 +#按照IoTDB 节点名称重启confignode_1 +iotd cluster restart default_cluster -N confignode_1 +#重启grafana +iotd cluster restart default_cluster -N grafana +#重启prometheus +iotd cluster restart default_cluster -N prometheus +``` + +##### 集群缩容命令 + +```bash +#按照节点名称缩容 +iotd cluster scalein default_cluster -N nodename +#按照ip+port缩容(ip+port按照datanode中的ip+dn_rpc_port获取唯一节点,confignode中的ip+cn_internal_port获取唯一节点) +iotd cluster scalein default_cluster -N ip:port +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 判断要缩容的confignode节点和datanode是否只剩一个,如果只剩一个则不能执行缩容 + +* 然后根据ip:port或者nodename 获取要缩容的节点信息,执行缩容命令,然后销毁该节点目录,如果缩容的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 + 如果缩容的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` + + +提示:目前一次仅支持一个节点缩容 + +##### 集群扩容命令 + +```bash +iotd cluster scaleout default_cluster ``` +* 修改config/xxx.yaml 文件添加一个datanode 节点或者confignode节点 + +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 找到要扩容的节点,执行上传IoTDB压缩包和jdb包(如果yaml中配置`jdk_tar_dir`和`jdk_deploy_dir`值)并解压 + +* 根据yaml文件节点配置信息生成并上传`iotdb-common.properties`、`iotdb-confignode.properties`或`iotdb-datanode.properties` +* 执行启动该节点命令并校验节点是否启动成功 + +提示:目前一次仅支持一个节点扩容 + +##### 销毁集群命令 +```bash +iotd cluster destroy default_cluster +``` + +* cluster-name 找到默认位置的 yaml 文件 + +* 根据`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`中node节点信息,检查是否节点还在运行, + 如果有任何一个节点正在运行则停止销毁命令 + +* 删除IoTDB集群中的`data`以及yaml文件配置的`cn_system_dir`、`cn_consensus_dir`、 + `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`、`ext`、`IoTDB`部署目录、 + grafana部署目录和prometheus部署目录 + +*销毁单个模块* +```bash +# 销毁grafana模块 +iotd cluster destroy default_cluster -N grafana +# 销毁prometheus模块 +iotd cluster destroy default_cluster -N prometheus +# 销毁iotdb模块 +iotd cluster destroy default_cluster -N iotdb +``` + +##### 分发集群配置命令 +```bash +iotd cluster distribute default_cluster +``` + +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 + +* 根据yaml文件节点配置信息生成并依次上传`iotdb-common.properties`、`iotdb-confignode.properties`、`iotdb-datanode.properties`、到指定节点 + +##### 热加载集群配置命令 +```bash +iotd cluster reload default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 根据yaml文件节点配置信息依次在cli中执行`load configuration` + +##### 集群节点日志备份 +```bash +iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' +``` * 根据 cluster-name 找到默认位置的 yaml 文件 -* 根据提供的节点名称或者ip:port找到对于节点位置信息,如果停止的节点是`data_node`则ip使用yaml 文件中的`dn_rpc_address`、port 使用的是yaml文件中datanode_servers 中的`dn_rpc_port`。 - 如果停止的节点是`config_node`则ip使用的是yaml文件中confignode_servers 中的`cn_internal_address` 、port 使用的是`cn_internal_port` +* 该命令会根据yaml文件校验datanode_1,confignode_1 是否存在,然后根据配置的起止日期(startdate<=logtime<=enddate)备份指定节点datanode_1,confignode_1 的日志数据到指定服务`192.168.9.48` 端口`36000` 数据备份路径是 `/iotdb/logs` ,IoTDB日志存储路径在`/root/data/db/iotdb/logs`(非必填,如果不填写-logs xxx 默认从IoTDB安装路径/logs下面备份日志) + +| 命令 | 功能 | 是否必填 | +|------------|------------------------------------| ---| +| -h | 存放备份数据机器ip |否| +| -u | 存放备份数据机器用户名 |否| +| -pw | 存放备份数据机器密码 |否| +| -p | 存放备份数据机器端口(默认22) |否| +| -path | 存放备份数据的路径(默认当前路径) |否| +| -loglevel | 日志基本有all、info、error、warn(默认是全部) |否| +| -l | 限速(默认不限速范围0到104857601 单位Kbit/s) |否| +| -N | 配置文件集群名称多个用逗号隔开 |是| +| -startdate | 起始时间(包含默认1970-01-01) |否| +| -enddate | 截止时间(包含) |否| +| -logs | IoTDB 日志存放路径,默认是({iotdb}/logs) |否| + +##### 集群节点数据备份 +```bash +iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' +``` +* 该命令会根据yaml文件获取leader 节点,然后根据起止日期(startdate<=logtime<=enddate)备份数据到192.168.9.48 服务上的/iotdb/datas 目录下 + +| 命令 | 功能 | 是否必填 | +| ---|---------------------------------| ---| +|-h| 存放备份数据机器ip |否| +|-u| 存放备份数据机器用户名 |否| +|-pw| 存放备份数据机器密码 |否| +|-p| 存放备份数据机器端口(默认22) |否| +|-path| 存放备份数据的路径(默认当前路径) |否| +|-granularity| 类型partition |是| +|-l| 限速(默认不限速范围0到104857601 单位Kbit/s) |否| +|-startdate| 起始时间(包含) |是| +|-enddate| 截止时间(包含) |是| + +##### 集群升级 +```bash +iotd cluster upgrade default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 + +* 上传lib包 + +注意执行完升级后请重启IoTDB 才能生效 + +##### 集群初始化 +```bash +iotd cluster init default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 +* 初始化集群配置 + +##### 查看集群进程状态 +```bash +iotd cluster status default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 +* 展示集群的存活状态 + +#### 集群部署工具样例介绍 +在集群部署工具安装目录中config/example 下面有3个yaml样例,如果需要可以复制到config 中进行修改即可 + +| 名称 | 说明 | +|-------------------|------------------------------------------------| +| default_1c1d.yaml | 1个confignode和1个datanode 配置样例 | +| default_3c3d.yaml | 3个confignode和3个datanode 配置样例 | +| default_3c3d_grafa_prome | 3个confignode和3个datanode、Grafana、Prometheus配置样例 | -* 停止该节点 ## 手动部署 From f9f8190ead6cb38dc06e9de197ce830f7c394311 Mon Sep 17 00:00:00 2001 From: Cloudwise_Luke <282583553@qq.com> Date: Wed, 13 Sep 2023 17:22:13 +0800 Subject: [PATCH 4/5] fixed cli failure issue --- .../Deployment-Guide_timecho.md | 74 +++++++++-------- .../Deployment-Guide_timecho.md | 74 +++++++++-------- .../Deployment-Guide_timecho.md | 80 +++++++++---------- .../Deployment-Guide_timecho.md | 2 +- 4 files changed, 111 insertions(+), 119 deletions(-) diff --git a/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index 8e3d2088..ee788d79 100644 --- a/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -79,26 +79,24 @@ Users can start IoTDB standalone mode by the start-standalone script under the s Note: Currently, To run standalone mode, you need to ensure that all addresses are set to 127.0.0.1, If you need to access the IoTDB from a machine different from the one where the IoTDB is located, please change the configuration item `dn_rpc_address` to the IP of the machine where the IoTDB lives. And replication factors set to 1, which is by now the default setting. Besides, it's recommended to use SimpleConsensus in this mode, since it brings additional efficiency. -### Cluster deployment - -#### Cluster management tool +## Cluster deployment(Cluster management tool) The IoTDB cluster management tool is an easy-to-use operation and maintenance tool (enterprise version tool). It is designed to solve the operation and maintenance problems of multiple nodes in the IoTDB distributed system. It mainly includes cluster deployment, cluster start and stop, elastic expansion, configuration update, data export and other functions, thereby realizing one-click command issuance for complex database clusters, which greatly Reduce management difficulty. This document will explain how to remotely deploy, configure, start and stop IoTDB cluster instances with cluster management tools. -#### Deploy cluster management tools +### Environment dependence -##### Environment dependence +This tool is a supporting tool for IoTDB Enterprise Edition. You can contact your sales representative to obtain the tool download method. The machine where IoTDB is to be deployed needs to rely on jdk 8 and above, lsof, netstat, and unzip functions. If not, please install them yourself. You can refer to the installation commands required for the environment in the last section of the document. Tip: The IoTDB cluster management tool requires an account with root privileges -##### Deployment method +### Deployment method -###### Download and install +#### Download and install This tool is a supporting tool for IoTDB Enterprise Edition. You can contact your salesperson to obtain the tool download method. @@ -116,13 +114,13 @@ The iotd keyword can be activated in the subsequent shell, such as checking the iotd cluster check example ``` -* You can also directly use /sbin/iotd without activating iotd to execute commands, such as checking the environment required before deployment: +* You can also directly use <iotd absolute path>/sbin/iotd without activating iotd to execute commands, such as checking the environment required before deployment: ```bash /sbin/iotd cluster check example ``` -#### Introduction to cluster configuration files +### Introduction to cluster configuration files * There is a cluster configuration yaml file in the `iotd/config` directory. The yaml file name is the cluster name. There can be multiple yaml files. In order to facilitate users to configure yaml files, a `default_cluster.yaml` example is provided under the iotd/config directory. * The yaml file configuration consists of five major parts: `global`, `confignode_servers`, `datanode_servers`, `grafana_server`, and `prometheus_server` @@ -215,9 +213,9 @@ If metrics are configured in `iotdb-datanode.properties` and `iotdb-confignode.p Note: How to configure the value corresponding to the yaml key to contain special characters such as: etc. It is recommended to use double quotes for the entire value, and do not use paths containing spaces in the corresponding file paths to prevent abnormal recognition problems. -#### scenes to be used +### scenes to be used -##### Clean data +#### Clean data * Cleaning up the cluster data scenario will delete the data directory in the IoTDB cluster and `cn_system_dir`, `cn_consensus_dir`, `cn_consensus_dir` configured in the yaml file `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs` and `ext` directories. @@ -228,7 +226,7 @@ iotd cluster stop default_cluster iotd cluster clean default_cluster ``` -##### Cluster destruction +#### Cluster destruction * The cluster destruction scenario will delete `data`, `cn_system_dir`, `cn_consensus_dir`, in the IoTDB cluster `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs`, `ext`, `IoTDB` deployment directory, @@ -241,7 +239,7 @@ iotd cluster stop default_cluster iotd cluster destroy default_cluster ``` -##### Cluster upgrade +#### Cluster upgrade * To upgrade the cluster, you first need to configure `iotdb_lib_dir` in config/xxx.yaml as the directory path where the jar to be uploaded to the server is located (for example, iotdb/lib). * If you use zip files to upload, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* @@ -252,7 +250,7 @@ iotd cluster upgrade default_cluster iotd cluster restart default_cluster ``` -##### hot deployment +#### hot deployment * First modify the configuration in config/xxx.yaml. * Execute the distribution command, and then execute the hot deployment command to complete the hot deployment of the cluster configuration @@ -262,7 +260,7 @@ iotd cluster distribute default_cluster iotd cluster reload default_cluster ``` -##### Cluster expansion +#### Cluster expansion * First modify and add a datanode or confignode node in config/xxx.yaml. * Execute the cluster expansion command @@ -271,7 +269,7 @@ iotd cluster reload default_cluster iotd cluster scaleout default_cluster ``` -##### Cluster scaling +#### Cluster scaling * First find the node name or ip+port to shrink in config/xxx.yaml (where confignode port is cn_internal_port, datanode port is rpc_port) * Execute cluster shrink command @@ -280,7 +278,7 @@ iotd cluster scaleout default_cluster iotd cluster scalein default_cluster ``` -##### Using cluster management tools to manipulate existing IoTDB clusters +#### Using cluster management tools to manipulate existing IoTDB clusters * Configure the server's `user`, `passwod` or `pkey`, `ssh_port` * Modify the IoTDB deployment path in config/xxx.yaml, `deploy_dir` (IoTDB deployment directory), `iotdb_dir_name` (IoTDB decompression directory name, the default is iotdb) @@ -297,7 +295,7 @@ iotd cluster scalein default_cluster iotd cluster init default_cluster ``` -##### Deploy IoTDB, Grafana and Prometheus +#### Deploy IoTDB, Grafana and Prometheus * Configure `iotdb-datanode.properties`, `iotdb-confignode.properties` to open the metrics interface * Configure the Grafana configuration. If there are multiple `dashboards`, separate them with commas. The names cannot be repeated or they will be overwritten. @@ -310,7 +308,7 @@ iotd cluster start default_cluster For more detailed parameters, please refer to the cluster configuration file introduction above -#### Command +### Command The basic usage of this tool is: ```bash @@ -351,11 +349,11 @@ iotd cluster deploy default_cluster | init | When an existing cluster uses the cluster deployment tool, initialize the cluster configuration | Cluster name | | status | View process status | Cluster name | -#### Detailed command execution process +### Detailed command execution process The following commands are executed using default_cluster.yaml as an example, and users can modify them to their own cluster files to execute -##### Check cluster deployment environment commands +#### Check cluster deployment environment commands ```bash iotd cluster check default_cluster @@ -372,7 +370,7 @@ iotd cluster check default_cluster If the jdk check does not meet the requirements, we can configure a jdk1.8 or above version in the yaml file ourselves for deployment without affecting subsequent use. If checking lsof, netstat or unzip does not meet the requirements, you need to install it on the server yourself. -##### Deploy cluster command +#### Deploy cluster command ```bash iotd cluster deploy default_cluster @@ -400,7 +398,7 @@ iotd cluster deploy default_cluster -N prometheus iotd cluster deploy default_cluster -N iotdb ``` -##### Start cluster command +#### Start cluster command ```bash iotd cluster start default_cluster @@ -439,7 +437,7 @@ Note: Since the cluster deployment tool only calls the start-confignode.sh and s When the actual output result fails, it may be that the cluster has not started normally. It is recommended to use the status command to check the current cluster status (iotd cluster status xxx) -##### View IoTDB cluster status command +#### View IoTDB cluster status command ```bash iotd cluster show default_cluster @@ -450,7 +448,7 @@ iotd cluster show default_cluster details * Execute `show cluster details` through cli on datanode in turn. If one node is executed successfully, it will not continue to execute cli on subsequent nodes and return the result directly. -##### Stop cluster command +#### Stop cluster command ```bash @@ -492,7 +490,7 @@ iotd cluster stop default_cluster -N prometheus Note: Since the cluster deployment tool only calls the stop-confignode.sh and stop-datanode.sh scripts in the IoTDB cluster, in some cases the iotdb cluster may not be stopped. -##### Clean cluster data command +#### Clean cluster data command ```bash iotd cluster clean default_cluster @@ -508,7 +506,7 @@ iotd cluster clean default_cluster -##### Restart cluster command +#### Restart cluster command ```bash iotd cluster restart default_cluster @@ -538,7 +536,7 @@ iotd cluster restart default_cluster -N grafana iotd cluster restart default_cluster -N prometheus ``` -##### Cluster shrink command +#### Cluster shrink command ```bash #Scale down by node name @@ -556,7 +554,7 @@ iotd cluster scalein default_cluster -N ip:port Tip: Currently, only one node scaling is supported at a time -##### Cluster expansion command +#### Cluster expansion command ```bash iotd cluster scaleout default_cluster @@ -573,7 +571,7 @@ iotd cluster scaleout default_cluster Tip: Currently, only one node expansion is supported at a time -##### destroy cluster command +#### destroy cluster command ```bash iotd cluster destroy default_cluster ``` @@ -598,7 +596,7 @@ iotd cluster destroy default_cluster -N prometheus iotd cluster destroy default_cluster -N iotdb ``` -##### Distribute cluster configuration commands +#### Distribute cluster configuration commands ```bash iotd cluster distribute default_cluster @@ -608,7 +606,7 @@ iotd cluster distribute default_cluster * Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties`, `iotdb-datanode.properties` to the specified node according to the node configuration information of the yaml file -##### Hot load cluster configuration command +#### Hot load cluster configuration command ```bash iotd cluster reload default_cluster @@ -617,7 +615,7 @@ iotd cluster reload default_cluster * Execute `load configuration` in the cli according to the node configuration information of the yaml file. -##### Cluster node log backup +#### Cluster node log backup ```bash iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' ``` @@ -640,7 +638,7 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 | -enddate | end time (included) | NO | | -logs | IoTDB log storage path, the default is ({iotdb}/logs)) | NO | -##### Cluster data backup +#### Cluster data backup ```bash iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' ``` @@ -658,7 +656,7 @@ iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-0 | -startdate | start time (including default 1970-01-01) | YES | | -enddate | end time (included) | YES | -##### Cluster upgrade +#### Cluster upgrade ```bash iotd cluster upgrade default_cluster ``` @@ -668,14 +666,14 @@ iotd cluster upgrade default_cluster Note that after performing the upgrade, please restart IoTDB for it to take effect. -##### Cluster initialization +#### Cluster initialization ```bash iotd cluster init default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` * Initialize cluster configuration -##### View cluster process status +#### View cluster process status ```bash iotd cluster status default_cluster ``` @@ -683,7 +681,7 @@ iotd cluster status default_cluster * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` * Display the survival status of each node in the cluster -#### Introduction to Cluster Deployment Tool Samples +### Introduction to Cluster Deployment Tool Samples In the cluster deployment tool installation directory config/example, there are three yaml examples. If necessary, you can copy them to config and modify them. diff --git a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md index fd583819..33a64f7c 100644 --- a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -79,26 +79,24 @@ Users can start IoTDB standalone mode by the start-standalone script under the s Note: Currently, To run standalone mode, you need to ensure that all addresses are set to 127.0.0.1, If you need to access the IoTDB from a machine different from the one where the IoTDB is located, please change the configuration item `dn_rpc_address` to the IP of the machine where the IoTDB lives. And replication factors set to 1, which is by now the default setting. Besides, it's recommended to use SimpleConsensus in this mode, since it brings additional efficiency. -### Cluster deployment - -#### Cluster management tool +## Cluster deployment(Cluster management tool) The IoTDB cluster management tool is an easy-to-use operation and maintenance tool (enterprise version tool). It is designed to solve the operation and maintenance problems of multiple nodes in the IoTDB distributed system. It mainly includes cluster deployment, cluster start and stop, elastic expansion, configuration update, data export and other functions, thereby realizing one-click command issuance for complex database clusters, which greatly Reduce management difficulty. This document will explain how to remotely deploy, configure, start and stop IoTDB cluster instances with cluster management tools. -#### Deploy cluster management tools +### Environment dependence -##### Environment dependence +This tool is a supporting tool for IoTDB Enterprise Edition. You can contact your sales representative to obtain the tool download method. The machine where IoTDB is to be deployed needs to rely on jdk 8 and above, lsof, netstat, and unzip functions. If not, please install them yourself. You can refer to the installation commands required for the environment in the last section of the document. Tip: The IoTDB cluster management tool requires an account with root privileges -##### Deployment method +### Deployment method -###### Download and install +#### Download and install This tool is a supporting tool for IoTDB Enterprise Edition. You can contact your salesperson to obtain the tool download method. @@ -116,13 +114,13 @@ The iotd keyword can be activated in the subsequent shell, such as checking the iotd cluster check example ``` -* You can also directly use /sbin/iotd without activating iotd to execute commands, such as checking the environment required before deployment: +* You can also directly use <iotd absolute path>/sbin/iotd without activating iotd to execute commands, such as checking the environment required before deployment: ```bash /sbin/iotd cluster check example ``` -#### Introduction to cluster configuration files +### Introduction to cluster configuration files * There is a cluster configuration yaml file in the `iotd/config` directory. The yaml file name is the cluster name. There can be multiple yaml files. In order to facilitate users to configure yaml files, a `default_cluster.yaml` example is provided under the iotd/config directory. * The yaml file configuration consists of five major parts: `global`, `confignode_servers`, `datanode_servers`, `grafana_server`, and `prometheus_server` @@ -215,9 +213,9 @@ If metrics are configured in `iotdb-datanode.properties` and `iotdb-confignode.p Note: How to configure the value corresponding to the yaml key to contain special characters such as: etc. It is recommended to use double quotes for the entire value, and do not use paths containing spaces in the corresponding file paths to prevent abnormal recognition problems. -#### scenes to be used +### scenes to be used -##### Clean data +#### Clean data * Cleaning up the cluster data scenario will delete the data directory in the IoTDB cluster and `cn_system_dir`, `cn_consensus_dir`, `cn_consensus_dir` configured in the yaml file `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs` and `ext` directories. @@ -228,7 +226,7 @@ iotd cluster stop default_cluster iotd cluster clean default_cluster ``` -##### Cluster destruction +#### Cluster destruction * The cluster destruction scenario will delete `data`, `cn_system_dir`, `cn_consensus_dir`, in the IoTDB cluster `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir`, `logs`, `ext`, `IoTDB` deployment directory, @@ -241,7 +239,7 @@ iotd cluster stop default_cluster iotd cluster destroy default_cluster ``` -##### Cluster upgrade +#### Cluster upgrade * To upgrade the cluster, you first need to configure `iotdb_lib_dir` in config/xxx.yaml as the directory path where the jar to be uploaded to the server is located (for example, iotdb/lib). * If you use zip files to upload, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* @@ -252,7 +250,7 @@ iotd cluster upgrade default_cluster iotd cluster restart default_cluster ``` -##### hot deployment +#### hot deployment * First modify the configuration in config/xxx.yaml. * Execute the distribution command, and then execute the hot deployment command to complete the hot deployment of the cluster configuration @@ -262,7 +260,7 @@ iotd cluster distribute default_cluster iotd cluster reload default_cluster ``` -##### Cluster expansion +#### Cluster expansion * First modify and add a datanode or confignode node in config/xxx.yaml. * Execute the cluster expansion command @@ -271,7 +269,7 @@ iotd cluster reload default_cluster iotd cluster scaleout default_cluster ``` -##### Cluster scaling +#### Cluster scaling * First find the node name or ip+port to shrink in config/xxx.yaml (where confignode port is cn_internal_port, datanode port is rpc_port) * Execute cluster shrink command @@ -280,7 +278,7 @@ iotd cluster scaleout default_cluster iotd cluster scalein default_cluster ``` -##### Using cluster management tools to manipulate existing IoTDB clusters +#### Using cluster management tools to manipulate existing IoTDB clusters * Configure the server's `user`, `passwod` or `pkey`, `ssh_port` * Modify the IoTDB deployment path in config/xxx.yaml, `deploy_dir` (IoTDB deployment directory), `iotdb_dir_name` (IoTDB decompression directory name, the default is iotdb) @@ -297,7 +295,7 @@ iotd cluster scalein default_cluster iotd cluster init default_cluster ``` -##### Deploy IoTDB, Grafana and Prometheus +#### Deploy IoTDB, Grafana and Prometheus * Configure `iotdb-datanode.properties`, `iotdb-confignode.properties` to open the metrics interface * Configure the Grafana configuration. If there are multiple `dashboards`, separate them with commas. The names cannot be repeated or they will be overwritten. @@ -310,7 +308,7 @@ iotd cluster start default_cluster For more detailed parameters, please refer to the cluster configuration file introduction above -#### Command +### Command The basic usage of this tool is: ```bash @@ -351,11 +349,11 @@ iotd cluster deploy default_cluster | init | When an existing cluster uses the cluster deployment tool, initialize the cluster configuration | Cluster name | | status | View process status | Cluster name | -#### Detailed command execution process +### Detailed command execution process The following commands are executed using default_cluster.yaml as an example, and users can modify them to their own cluster files to execute -##### Check cluster deployment environment commands +#### Check cluster deployment environment commands ```bash iotd cluster check default_cluster @@ -372,7 +370,7 @@ iotd cluster check default_cluster If the jdk check does not meet the requirements, we can configure a jdk1.8 or above version in the yaml file ourselves for deployment without affecting subsequent use. If checking lsof, netstat or unzip does not meet the requirements, you need to install it on the server yourself. -##### Deploy cluster command +#### Deploy cluster command ```bash iotd cluster deploy default_cluster @@ -400,7 +398,7 @@ iotd cluster deploy default_cluster -N prometheus iotd cluster deploy default_cluster -N iotdb ``` -##### Start cluster command +#### Start cluster command ```bash iotd cluster start default_cluster @@ -439,7 +437,7 @@ Note: Since the cluster deployment tool only calls the start-confignode.sh and s When the actual output result fails, it may be that the cluster has not started normally. It is recommended to use the status command to check the current cluster status (iotd cluster status xxx) -##### View IoTDB cluster status command +#### View IoTDB cluster status command ```bash iotd cluster show default_cluster @@ -450,7 +448,7 @@ iotd cluster show default_cluster details * Execute `show cluster details` through cli on datanode in turn. If one node is executed successfully, it will not continue to execute cli on subsequent nodes and return the result directly. -##### Stop cluster command +#### Stop cluster command ```bash @@ -492,7 +490,7 @@ iotd cluster stop default_cluster -N prometheus Note: Since the cluster deployment tool only calls the stop-confignode.sh and stop-datanode.sh scripts in the IoTDB cluster, in some cases the iotdb cluster may not be stopped. -##### Clean cluster data command +#### Clean cluster data command ```bash iotd cluster clean default_cluster @@ -508,7 +506,7 @@ iotd cluster clean default_cluster -##### Restart cluster command +#### Restart cluster command ```bash iotd cluster restart default_cluster @@ -538,7 +536,7 @@ iotd cluster restart default_cluster -N grafana iotd cluster restart default_cluster -N prometheus ``` -##### Cluster shrink command +#### Cluster shrink command ```bash #Scale down by node name @@ -556,7 +554,7 @@ iotd cluster scalein default_cluster -N ip:port Tip: Currently, only one node scaling is supported at a time -##### Cluster expansion command +#### Cluster expansion command ```bash iotd cluster scaleout default_cluster @@ -573,7 +571,7 @@ iotd cluster scaleout default_cluster Tip: Currently, only one node expansion is supported at a time -##### destroy cluster command +#### destroy cluster command ```bash iotd cluster destroy default_cluster ``` @@ -598,7 +596,7 @@ iotd cluster destroy default_cluster -N prometheus iotd cluster destroy default_cluster -N iotdb ``` -##### Distribute cluster configuration commands +#### Distribute cluster configuration commands ```bash iotd cluster distribute default_cluster @@ -608,7 +606,7 @@ iotd cluster distribute default_cluster * Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties`, `iotdb-datanode.properties` to the specified node according to the node configuration information of the yaml file -##### Hot load cluster configuration command +#### Hot load cluster configuration command ```bash iotd cluster reload default_cluster @@ -617,7 +615,7 @@ iotd cluster reload default_cluster * Execute `load configuration` in the cli according to the node configuration information of the yaml file. -##### Cluster node log backup +#### Cluster node log backup ```bash iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' ``` @@ -640,7 +638,7 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 | -enddate | end time (included) | NO | | -logs | IoTDB log storage path, the default is ({iotdb}/logs)) | NO | -##### Cluster data backup +#### Cluster data backup ```bash iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' ``` @@ -658,7 +656,7 @@ iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-0 | -startdate | start time (including default 1970-01-01) | YES | | -enddate | end time (included) | YES | -##### Cluster upgrade +#### Cluster upgrade ```bash iotd cluster upgrade default_cluster ``` @@ -668,14 +666,14 @@ iotd cluster upgrade default_cluster Note that after performing the upgrade, please restart IoTDB for it to take effect. -##### Cluster initialization +#### Cluster initialization ```bash iotd cluster init default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` * Initialize cluster configuration -##### View cluster process status +#### View cluster process status ```bash iotd cluster status default_cluster ``` @@ -683,7 +681,7 @@ iotd cluster status default_cluster * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` * Display the survival status of each node in the cluster -#### Introduction to Cluster Deployment Tool Samples +### Introduction to Cluster Deployment Tool Samples In the cluster deployment tool installation directory config/example, there are three yaml examples. If necessary, you can copy them to config and modify them. diff --git a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index 1aa7663d..f7637155 100644 --- a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -72,24 +72,22 @@ Windows 系统启动命令如下: 注意:目前,要使用单机模式,你需要保证所有的地址设置为 127.0.0.1,如果需要从非 IoTDB 所在的机器访问此IoTDB,请将配置项 `dn_rpc_address` 修改为 IoTDB 所在的机器 IP。副本数设置为1。并且,推荐使用 SimpleConsensus,因为这会带来额外的效率。这些现在都是默认配置。 -### 集群版部署 - -#### 集群管理工具部署 +## 集群版部署(使用集群管理工具) IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB 分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发, 极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止 IoTDB 集群实例。 -#### 部署集群管理工具 +### Environmental preparation -##### 环境依赖 +本工具为 IoTDB 企业版配套工具,您可以联系您的销售获取工具下载方式。 IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof、netstat、unzip功能如果没有请自行安装,可以参考文档最后的一节环境所需安装命令。 提示:IoTDB集群管理工具需要使用有root权限的账号 -##### 部署方法 +### 部署方法 -###### 下载安装 +#### 下载安装 本工具为IoTDB企业版配套工具,您可以联系您的销售获取工具下载方式。 @@ -107,13 +105,13 @@ bash install-iotd.sh iotd cluster check example ``` -* 也可以不激活iotd直接使用 /sbin/iotd 来执行命令,如检查部署前所需的环境: +* 也可以不激活iotd直接使用 <iotd absolute path>/sbin/iotd 来执行命令,如检查部署前所需的环境: ```bash /sbin/iotd cluster check example ``` -#### 系统结构 +### 系统结构 IoTDB集群管理工具主要由config、logs、doc、sbin目录组成。 @@ -125,10 +123,10 @@ IoTDB集群管理工具主要由config、logs、doc、sbin目录组成。 * `doc` 存放用户手册、开发手册和推荐部署手册。 -#### 集群配置文件介绍 +### 集群配置文件介绍 * 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml 文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。 -* yaml 文件配置由`global`、`confignode_servers`、`datanode_servers`、`grafana_server`、`prometheus_server`五大部分组成 +* yaml 文件配置由`global`、`confignode_servers`、`datanode_servers`、`grafana_server`、`prometheus_server`四大部分组成 * global 是通用配置主要配置机器用户名密码、IoTDB本地安装文件、Jdk配置等。在`iotd/config`目录中提供了一个`default_cluster.yaml`样例数据, 用户可以复制修改成自己集群名字并参考里面的说明进行配置IoTDB集群,在`default_cluster.yaml`样例中没有注释的均为必填项,已经注释的为非必填项。 @@ -218,9 +216,9 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" 注意:如何配置yaml key对应的值包含特殊字符如:等建议整个value使用双引号,对应的文件路径中不要使用包含空格的路径,防止出现识别出现异常问题。 -#### 使用场景 +### 使用场景 -##### 清理数据场景 +#### 清理数据场景 * 清理集群数据场景会删除IoTDB集群中的data目录以及yaml文件中配置的`cn_system_dir`、`cn_consensus_dir`、 `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`和`ext`目录。 @@ -230,7 +228,7 @@ iotd cluster stop default_cluster iotd cluster clean default_cluster ``` -##### 集群销毁场景 +#### 集群销毁场景 * 集群销毁场景会删除IoTDB集群中的`data`、`cn_system_dir`、`cn_consensus_dir`、 `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`、`ext`、`IoTDB`部署目录、 @@ -243,7 +241,7 @@ iotd cluster stop default_cluster iotd cluster destroy default_cluster ``` -##### 集群升级场景 +#### 集群升级场景 * 集群升级首先需要在config/xxx.yaml中配置`iotdb_lib_dir`为要上传到服务器的jar所在目录路径(例如iotdb/lib)。 * 如果使用zip文件上传请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* @@ -254,7 +252,7 @@ iotd cluster upgrade default_cluster iotd cluster restart default_cluster ``` -##### 集群配置文件的热部署场景 +#### 集群配置文件的热部署场景 * 首先修改在config/xxx.yaml中配置。 * 执行分发命令、然后执行热部署命令即可完成集群配置的热部署 @@ -264,7 +262,7 @@ iotd cluster distribute default_cluster iotd cluster reload default_cluster ``` -##### 集群扩容场景 +#### 集群扩容场景 * 首先修改在config/xxx.yaml中添加一个datanode 或者confignode 节点。 * 执行集群扩容命令 @@ -272,7 +270,7 @@ iotd cluster reload default_cluster iotd cluster scaleout default_cluster ``` -##### 集群缩容场景 +#### 集群缩容场景 * 首先在config/xxx.yaml中找到要缩容的节点名字或者ip+port(其中confignode port 是cn_internal_port、datanode port 是rpc_port) * 执行集群缩容命令 @@ -280,7 +278,7 @@ iotd cluster scaleout default_cluster iotd cluster scalein default_cluster ``` -##### 已有IoTDB集群,使用集群部署工具场景 +#### 已有IoTDB集群,使用集群部署工具场景 * 配置服务器的`user`、`passwod`或`pkey`、`ssh_port` * 修改config/xxx.yaml中IoTDB 部署路径,`deploy_dir`(IoTDB 部署目录)、`iotdb_dir_name`(IoTDB解压目录名称,默认是iotdb) @@ -297,7 +295,7 @@ iotd cluster scalein default_cluster iotd cluster init default_cluster ``` -##### 一键部署IoTDB、Grafana和Prometheus 场景 +#### 一键部署IoTDB、Grafana和Prometheus 场景 * 配置`iotdb-datanode.properties` 、`iotdb-confignode.properties` 打开metrics接口 * 配置Grafana 配置,如果`dashboards` 有多个就用逗号隔开,名字不能重复否则会被覆盖。 @@ -311,7 +309,7 @@ iotd cluster start default_cluster 更加详细参数请参考上方的 集群配置文件介绍 -#### 命令格式 +### 命令格式 本工具的基本用法为: ```bash @@ -352,11 +350,11 @@ iotd cluster deploy default_cluster | init | 已有集群使用集群部署工具时,初始化集群配置 | 集群名字,初始化集群配置 | | status | 查看进程状态 | 集群名字 | -#### 详细命令执行过程 +### 详细命令执行过程 下面的命令都是以default_cluster.yaml 为示例执行的,用户可以修改成自己的集群文件来执行 -##### 检查集群部署环境命令 +#### 检查集群部署环境命令 ```bash iotd cluster check default_cluster @@ -373,7 +371,7 @@ iotd cluster check default_cluster 如果检查jdk没有满足要求,我们可以自己在yaml 文件中配置一个jdk1.8 及以上版本的进行部署不影响后面使用, 如果检查lsof、netstat或者unzip 不满足要求需要在服务器上自行安装。 -##### 部署集群命令 +#### 部署集群命令 ```bash iotd cluster deploy default_cluster @@ -400,7 +398,7 @@ iotd cluster deploy default_cluster -N prometheus iotd cluster deploy default_cluster -N iotdb ``` -##### 启动集群命令 +#### 启动集群命令 ```bash iotd cluster start default_cluster @@ -438,7 +436,7 @@ iotd cluster start default_cluster -N prometheus 在实际输出结果失败时有可能是集群还未正常启动,建议使用status命令进行查看当前集群状态(iotd cluster status xxx) -##### 查看IoTDB集群状态命令 +#### 查看IoTDB集群状态命令 ```bash iotd cluster show default_cluster @@ -450,7 +448,7 @@ iotd cluster show default_cluster details * 依次在datanode通过cli执行`show cluster details` 如果有一个节点执行成功则不会在后续节点继续执行cli直接返回结果 -##### 停止集群命令 +#### 停止集群命令 ```bash @@ -492,7 +490,7 @@ iotd cluster stop default_cluster -N prometheus 说明:由于集群部署工具仅是调用了IoTDB集群中的stop-confignode.sh和stop-datanode.sh 脚本,在某些情况下有可能iotdb集群并未停止。 -##### 清理集群数据命令 +#### 清理集群数据命令 ```bash iotd cluster clean default_cluster @@ -508,7 +506,7 @@ iotd cluster clean default_cluster -##### 重启集群命令 +#### 重启集群命令 ```bash iotd cluster restart default_cluster @@ -537,7 +535,7 @@ iotd cluster restart default_cluster -N grafana iotd cluster restart default_cluster -N prometheus ``` -##### 集群缩容命令 +#### 集群缩容命令 ```bash #按照节点名称缩容 @@ -555,7 +553,7 @@ iotd cluster scalein default_cluster -N ip:port 提示:目前一次仅支持一个节点缩容 -##### 集群扩容命令 +#### 集群扩容命令 ```bash iotd cluster scaleout default_cluster @@ -572,7 +570,7 @@ iotd cluster scaleout default_cluster 提示:目前一次仅支持一个节点扩容 -##### 销毁集群命令 +#### 销毁集群命令 ```bash iotd cluster destroy default_cluster ``` @@ -596,7 +594,7 @@ iotd cluster destroy default_cluster -N prometheus iotd cluster destroy default_cluster -N iotdb ``` -##### 分发集群配置命令 +#### 分发集群配置命令 ```bash iotd cluster distribute default_cluster ``` @@ -605,7 +603,7 @@ iotd cluster distribute default_cluster * 根据yaml文件节点配置信息生成并依次上传`iotdb-common.properties`、`iotdb-confignode.properties`、`iotdb-datanode.properties`、到指定节点 -##### 热加载集群配置命令 +#### 热加载集群配置命令 ```bash iotd cluster reload default_cluster ``` @@ -613,7 +611,7 @@ iotd cluster reload default_cluster * 根据yaml文件节点配置信息依次在cli中执行`load configuration` -##### 集群节点日志备份 +#### 集群节点日志备份 ```bash iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' ``` @@ -635,7 +633,7 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 | -enddate | 截止时间(包含) |否| | -logs | IoTDB 日志存放路径,默认是({iotdb}/logs) |否| -##### 集群节点数据备份 +#### 集群节点数据备份 ```bash iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' ``` @@ -653,7 +651,7 @@ iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-0 |-startdate| 起始时间(包含) |是| |-enddate| 截止时间(包含) |是| -##### 集群升级 +#### 集群升级 ```bash iotd cluster upgrade default_cluster ``` @@ -663,21 +661,21 @@ iotd cluster upgrade default_cluster 注意执行完升级后请重启IoTDB 才能生效 -##### 集群初始化 +#### 集群初始化 ```bash iotd cluster init default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 * 初始化集群配置 -##### 查看集群进程状态 +#### 查看集群进程状态 ```bash iotd cluster status default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 * 展示集群的存活状态 -#### 集群部署工具样例介绍 +### 集群部署工具样例介绍 在集群部署工具安装目录中config/example 下面有3个yaml样例,如果需要可以复制到config 中进行修改即可 | 名称 | 说明 | @@ -686,8 +684,6 @@ iotd cluster status default_cluster | default_3c3d.yaml | 3个confignode和3个datanode 配置样例 | | default_3c3d_grafa_prome | 3个confignode和3个datanode、Grafana、Prometheus配置样例 | - - ## 手动部署 ### 前置检查 diff --git a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md index 469a0fa0..ed62e5b7 100644 --- a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -198,7 +198,7 @@ bash install-iotd.sh iotd cluster check example ``` -* 也可以不激活iotd直接使用 /sbin/iotd 来执行命令,如检查部署前所需的环境: +* 也可以不激活iotd直接使用 <iotd absolute path>/sbin/iotd 来执行命令,如检查部署前所需的环境: ```bash /sbin/iotd cluster check example From b390002ed5e709430afb070037796b501d52c63a Mon Sep 17 00:00:00 2001 From: "luke.miao" <282583553@qq.com> Date: Mon, 20 Nov 2023 15:44:33 +0800 Subject: [PATCH 5/5] update iotdb-opskit doc --- .../Deployment-Guide_timecho.md | 356 ++++++++++-------- .../Deployment-Guide_timecho.md | 128 +++---- .../Deployment-Guide_timecho.md | 334 +++++++++------- .../Deployment-Guide_timecho.md | 110 +++--- 4 files changed, 514 insertions(+), 414 deletions(-) diff --git a/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index ee788d79..2050728e 100644 --- a/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -102,54 +102,54 @@ This tool is a supporting tool for IoTDB Enterprise Edition. You can contact you Note: Since the binary package only supports GLIBC2.17 and above, the minimum version is Centos7. -* After entering the following commands in the iotd directory: +* After entering the following commands in the iotdb-opskit directory: ```bash -bash install-iotd.sh +bash install-iotdbctl.sh ``` -The iotd keyword can be activated in the subsequent shell, such as checking the environment instructions required before deployment as follows: +The iotdbctl keyword can be activated in the subsequent shell, such as checking the environment instructions required before deployment as follows: ```bash -iotd cluster check example +iotdbctl cluster check example ``` -* You can also directly use <iotd absolute path>/sbin/iotd without activating iotd to execute commands, such as checking the environment required before deployment: +* You can also directly use <iotdbctl absolute path>/sbin/iotdbctl without activating iotdbctl to execute commands, such as checking the environment required before deployment: ```bash -/sbin/iotd cluster check example +/sbin/iotdbctl cluster check example ``` ### Introduction to cluster configuration files -* There is a cluster configuration yaml file in the `iotd/config` directory. The yaml file name is the cluster name. There can be multiple yaml files. In order to facilitate users to configure yaml files, a `default_cluster.yaml` example is provided under the iotd/config directory. +* There is a cluster configuration yaml file in the `iotdbctl/config` directory. The yaml file name is the cluster name. There can be multiple yaml files. In order to facilitate users to configure yaml files, a `default_cluster.yaml` example is provided under the iotdbctl/config directory. * The yaml file configuration consists of five major parts: `global`, `confignode_servers`, `datanode_servers`, `grafana_server`, and `prometheus_server` -* `global` is a general configuration that mainly configures machine username and password, IoTDB local installation files, Jdk configuration, etc. A `default_cluster.yaml` sample data is provided in the `iotd/config` directory, +* `global` is a general configuration that mainly configures machine username and password, IoTDB local installation files, Jdk configuration, etc. A `default_cluster.yaml` sample data is provided in the `iotdbctl/config` directory, Users can copy and modify it to their own cluster name and refer to the instructions inside to configure the IoTDB cluster. In the `default_cluster.yaml` sample, all uncommented items are required, and those that have been commented are non-required. -例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotd cluster check default_cluster`即可, +例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotdbctl cluster check default_cluster`即可, 更多详细命令请参考下面命令列表。 -| parameter name | parameter describe | required | -|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| -| iotdb_zip_dir | IoTDB deployment distribution directory, if the value is empty, it will be downloaded from the address specified by `iotdb_download_url` | NO | -| iotdb_download_url | IoTDB download address, if `iotdb_zip_dir` has no value, download from the specified address | NO | -| jdk_tar_dir | jdk local directory, you can use this jdk path to upload and deploy to the target node. | NO | -| jdk_deploy_dir | jdk remote machine deployment directory, jdk will be deployed to this directory, and the following `jdk_dir_name` parameter forms a complete jdk deployment directory, that is, `/` | NO | -| jdk_dir_name | The directory name after jdk decompression defaults to jdk_iotdb | NO | -| iotdb_lib_dir | The IoTDB lib directory or the IoTDB lib compressed package only supports .zip format and is only used for IoTDB upgrade. It is in the comment state by default. If you need to upgrade, please open the comment and modify the path. If you use a zip file, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* d | NO | -| user | User name for ssh login deployment machine | YES | -| password | The password for ssh login. If the password does not specify the use of pkey to log in, please ensure that the ssh login between nodes has been configured without a key. | NO | -| pkey | Key login: If password has a value, password is used first, otherwise pkey is used to log in. | NO | -| ssh_port | ssh port | YES | -| deploy_dir | IoTDB deployment directory, IoTDB will be deployed to this directory and the following `iotdb_dir_name` parameter will form a complete IoTDB deployment directory, that is, `/` | YES | -| iotdb_dir_name | The directory name after decompression of IoTDB is iotdb by default. | NO | -| datanode-env.sh | Corresponding to `iotdb/config/datanode-env.sh`, when `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first | NO | -| confignode-env.sh | Corresponding to `iotdb/config/confignode-env.sh`, the value in `datanode_servers` is used first when `global` and `datanode_servers` are configured at the same time | NO | -| iotdb-common.properties | Corresponds to `/config/iotdb-common.properties` | NO | -| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | -| dn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties` | YES | +| parameter name | parameter describe | required | +|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| iotdb\_zip\_dir | IoTDB deployment distribution directory, if the value is empty, it will be downloaded from the address specified by `iotdb_download_url` | NO | +| iotdb\_download\_url | IoTDB download address, if `iotdb_zip_dir` has no value, download from the specified address | NO | +| jdk\_tar\_dir | jdk local directory, you can use this jdk path to upload and deploy to the target node. | NO | +| jdk\_deploy\_dir | jdk remote machine deployment directory, jdk will be deployed to this directory, and the following `jdk_dir_name` parameter forms a complete jdk deployment directory, that is, `/` | NO | +| jdk\_dir\_name | The directory name after jdk decompression defaults to jdk_iotdb | NO | +| iotdb\_lib\_dir | The IoTDB lib directory or the IoTDB lib compressed package only supports .zip format and is only used for IoTDB upgrade. It is in the comment state by default. If you need to upgrade, please open the comment and modify the path. If you use a zip file, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* d | NO | +| user | User name for ssh login deployment machine | YES | +| password | The password for ssh login. If the password does not specify the use of pkey to log in, please ensure that the ssh login between nodes has been configured without a key. | NO | +| pkey | Key login: If password has a value, password is used first, otherwise pkey is used to log in. | NO | +| ssh\_port | ssh port | YES | +| deploy\_dir | IoTDB deployment directory, IoTDB will be deployed to this directory and the following `iotdb_dir_name` parameter will form a complete IoTDB deployment directory, that is, `/` | YES | +| iotdb\_dir\_name | The directory name after decompression of IoTDB is iotdb by default. | NO | +| datanode-env.sh | Corresponding to `iotdb/config/datanode-env.sh`, when `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first | NO | +| confignode-env.sh | Corresponding to `iotdb/config/confignode-env.sh`, the value in `datanode_servers` is used first when `global` and `datanode_servers` are configured at the same time | NO | +| iotdb-common.properties | Corresponds to `/config/iotdb-common.properties` | NO | +| cn\_internal\_address | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | +| dn\_internal\_address | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_internal_address` in `iotdb/config/iotdb-datanode.properties` | YES | Among them, datanode-env.sh and confignode-env.sh can be configured with extra parameters extra_opts. When this parameter is configured, corresponding values will be appended after datanode-env.sh and confignode-env.sh. Refer to default_cluster.yaml for configuration examples as follows: datanode-env.sh: @@ -160,54 +160,54 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" * `confignode_servers` is the configuration for deploying IoTDB Confignodes, in which multiple Confignodes can be configured By default, the first started ConfigNode node node1 is regarded as the Seed-ConfigNode -|parameter name | parameter describe | required | -|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| -| name | Confignode name | YES | -| deploy_dir | IoTDB config node deployment directory | YES| | +| parameter name | parameter describe | required | +|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| name | Confignode name | YES | +| deploy\_dir | IoTDB config node deployment directory | YES| | | iotdb-confignode.properties | Corresponding to `iotdb/config/iotdb-confignode.properties`, please refer to the `iotdb-confignode.properties` file description for more details. | NO | -| cn_internal_address | Corresponds to iotdb/internal communication address, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | -| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | -| cn_internal_port | Internal communication port, corresponding to `cn_internal_port` in `iotdb/config/iotdb-confignode.properties` | YES | -| cn_consensus_port | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` | NO | -| cn_data_dir | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` Corresponds to `cn_data_dir` in `iotdb/config/iotdb-confignode.properties` | YES | -| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `confignode_servers` at the same time, the value in confignode_servers will be used first. | NO | +| cn\_internal\_address | Corresponds to iotdb/internal communication address, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn_\internal\_address | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn\_internal\_port | Internal communication port, corresponding to `cn_internal_port` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn\_consensus\_port | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` | NO | +| cn\_data\_dir | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` Corresponds to `cn_data_dir` in `iotdb/config/iotdb-confignode.properties` | YES | +| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `confignode_servers` at the same time, the value in confignode_servers will be used first. | NO | * datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode -|parameter name | parameter describe | required | -| ---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| -|name| Datanode name | YES | -|deploy_dir| IoTDB data node deployment directory | YES | -|iotdb-datanode.properties| Corresponding to `iotdb/config/iotdb-datanode.properties`, please refer to the `iotdb-datanode.properties` file description for more details. | NO | -|dn_rpc_address| The datanode rpc address corresponds to `dn_rpc_address` in `iotdb/config/iotdb-datanode.properties` | YES | -|dn_internal_address| Internal communication address, corresponding to `dn_internal_address` in `iotdb/config/iotdb-datanode.properties` | YES | -|dn_target_config_node_list| The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties`. | YES | -|dn_rpc_port| Datanode rpc port address, corresponding to `dn_rpc_port` in `iotdb/config/iotdb-datanode.properties` | YES | -|dn_internal_port| Internal communication port, corresponding to `dn_internal_port` in `iotdb/config/iotdb-datanode.properties` | YES | -|iotdb-common.properties| Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `datanode_servers` at the same time, the value in `datanode_servers` will be used first. | NO | +| parameter name | parameter describe | required | +|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| name | Datanode name | YES | +| deploy\_dir | IoTDB data node deployment directory | YES | +| iotdb-datanode.properties | Corresponding to `iotdb/config/iotdb-datanode.properties`, please refer to the `iotdb-datanode.properties` file description for more details. | NO | +| dn\_rpc\_address | The datanode rpc address corresponds to `dn_rpc_address` in `iotdb/config/iotdb-datanode.properties` | YES | +| dn\_internal\_address | Internal communication address, corresponding to `dn_internal_address` in `iotdb/config/iotdb-datanode.properties` | YES | +| dn\_seed\_config\_node | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_seed_config_node` in `iotdb/config/iotdb-datanode.properties`. | YES | +| dn\_rpc\_port | Datanode rpc port address, corresponding to `dn_rpc_port` in `iotdb/config/iotdb-datanode.properties` | YES | +| dn\_internal\_port | Internal communication port, corresponding to `dn_internal_port` in `iotdb/config/iotdb-datanode.properties` | YES | +| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `datanode_servers` at the same time, the value in `datanode_servers` will be used first. | NO | * grafana_server is the configuration related to deploying Grafana -|parameter name | parameter describe | required | -|------------------|-------------------------------------------------------------|-----------| -| grafana_dir_name | Grafana decompression directory name(default grafana_iotdb) | NO | -| host | Server ip deployed by grafana | YES | -| grafana_port | The port of grafana deployment machine, default 3000 | NO | -| deploy_dir | grafana deployment server directory | YES | -| grafana_tar_dir | Grafana compressed package location | YES | -| dashboards | dashboards directory | NO | +| parameter name | parameter describe | required | +|--------------------|-------------------------------------------------------------|-----------| +| grafana\_dir\_name | Grafana decompression directory name(default grafana_iotdb) | NO | +| host | Server ip deployed by grafana | YES | +| grafana\_port | The port of grafana deployment machine, default 3000 | NO | +| deploy\_dir | grafana deployment server directory | YES | +| grafana\_tar\_dir | Grafana compressed package location | YES | +| dashboards | dashboards directory | NO | * prometheus_server 是部署Prometheus 相关配置 -|parameter name | parameter describe | required | -|---------------------|----------------------------------------------------|----------| -| prometheus_dir_name | prometheus decompression directory name, default prometheus_iotdb | NO | -| host | Server IP deployed by prometheus | YES | -| prometheus_port | The port of prometheus deployment machine, default 9090 | NO | -| deploy_dir | prometheus deployment server directory | YES | -| prometheus_tar_dir | prometheus compressed package path | YES | -| storage_tsdb_retention_time | The number of days to save data is 15 days by default | NO | -| storage_tsdb_retention_size | The data size that can be saved by the specified block defaults to 512M. Please note the units are KB, MB, GB, TB, PB, and EB. | NO | +| parameter name | parameter describe | required | +|--------------------------------|----------------------------------------------------|----------| +| prometheus\_dir\_name | prometheus decompression directory name, default prometheus_iotdb | NO | +| host | Server IP deployed by prometheus | YES | +| prometheus\_port | The port of prometheus deployment machine, default 9090 | NO | +| deploy\_dir | prometheus deployment server directory | YES | +| prometheus\_tar\_dir | prometheus compressed package path | YES | +| storage\_tsdb\_retention\_time | The number of days to save data is 15 days by default | NO | +| storage\_tsdb\_retention\_size | The data size that can be saved by the specified block defaults to 512M. Please note the units are KB, MB, GB, TB, PB, and EB. | NO | If metrics are configured in `iotdb-datanode.properties` and `iotdb-confignode.properties` of config/xxx.yaml, the configuration will be automatically put into promethues without manual modification. @@ -222,8 +222,8 @@ Note: How to configure the value corresponding to the yaml key to contain specia * First execute the stop cluster command, and then execute the cluster cleanup command. ```bash -iotd cluster stop default_cluster -iotd cluster clean default_cluster +iotdbctl cluster stop default_cluster +iotdbctl cluster clean default_cluster ``` #### Cluster destruction @@ -235,8 +235,8 @@ iotd cluster clean default_cluster ```bash -iotd cluster stop default_cluster -iotd cluster destroy default_cluster +iotdbctl cluster stop default_cluster +iotdbctl cluster destroy default_cluster ``` #### Cluster upgrade @@ -246,8 +246,8 @@ iotd cluster destroy default_cluster * Execute the upload command and then execute the restart IoTDB cluster command to complete the cluster upgrade. ```bash -iotd cluster upgrade default_cluster -iotd cluster restart default_cluster +iotdbctl cluster upgrade default_cluster +iotdbctl cluster restart default_cluster ``` #### hot deployment @@ -256,8 +256,8 @@ iotd cluster restart default_cluster * Execute the distribution command, and then execute the hot deployment command to complete the hot deployment of the cluster configuration ```bash -iotd cluster distribute default_cluster -iotd cluster reload default_cluster +iotdbctl cluster distribute default_cluster +iotdbctl cluster reload default_cluster ``` #### Cluster expansion @@ -266,7 +266,7 @@ iotd cluster reload default_cluster * Execute the cluster expansion command ```bash -iotd cluster scaleout default_cluster +iotdbctl cluster scaleout default_cluster ``` #### Cluster scaling @@ -275,7 +275,7 @@ iotd cluster scaleout default_cluster * Execute cluster shrink command ```bash -iotd cluster scalein default_cluster +iotdbctl cluster scalein default_cluster ``` #### Using cluster management tools to manipulate existing IoTDB clusters @@ -285,14 +285,14 @@ iotd cluster scalein default_cluster For example, if the full path of IoTDB deployment is `/home/data/apache-iotdb-1.1.1`, you need to modify the yaml files `deploy_dir:/home/data/` and `iotdb_dir_name:apache-iotdb-1.1.1` * If the server is not using java_home, modify `jdk_deploy_dir` (jdk deployment directory) and `jdk_dir_name` (the directory name after jdk decompression, the default is jdk_iotdb). If java_home is used, there is no need to modify the configuration. For example, the full path of jdk deployment is `/home/data/jdk_1.8.2`, you need to modify the yaml files `jdk_deploy_dir:/home/data/`, `jdk_dir_name:jdk_1.8.2` -* Configure `cn_target_config_node_list`, `dn_target_config_node_list` +* Configure `cn_internal_address`, `dn_internal_address` * Configure `cn_internal_address`, `cn_internal_port`, `cn_consensus_port`, `cn_system_dir`, in `iotdb-confignode.properties` in `confignode_servers` If the values in `cn_consensus_dir` and `iotdb-common.properties` are not the default for IoTDB, they need to be configured, otherwise there is no need to configure them. * Configure `dn_rpc_address`, `dn_internal_address`, `dn_data_dirs`, `dn_consensus_dir`, `dn_system_dir` and `iotdb-common.properties` in `iotdb-datanode.properties` in `datanode_servers` * Execute initialization command ```bash -iotd cluster init default_cluster +iotdbctl cluster init default_cluster ``` #### Deploy IoTDB, Grafana and Prometheus @@ -303,7 +303,7 @@ iotd cluster init default_cluster * Start the cluster ```bash -iotd cluster start default_cluster +iotdbctl cluster start default_cluster ``` For more detailed parameters, please refer to the cluster configuration file introduction above @@ -312,18 +312,18 @@ For more detailed parameters, please refer to the cluster configuration file int The basic usage of this tool is: ```bash -iotd cluster [params (Optional)] +iotdbctl cluster [params (Optional)] ``` * key indicates a specific command. -* cluster name indicates the cluster name (that is, the name of the yaml file in the `iotd/config` file). +* cluster name indicates the cluster name (that is, the name of the yaml file in the `iotdbctl/config` file). * params indicates the required parameters of the command (optional). * For example, the command format to deploy the default_cluster cluster is: ```bash -iotd cluster deploy default_cluster +iotdbctl cluster deploy default_cluster ``` * The functions and parameters of the cluster are listed as follows: @@ -348,7 +348,7 @@ iotd cluster deploy default_cluster | upgrade | lib package upgrade | Cluster name | | init | When an existing cluster uses the cluster deployment tool, initialize the cluster configuration | Cluster name | | status | View process status | Cluster name | - +| activate | Activate cluster | Cluster name | ### Detailed command execution process The following commands are executed using default_cluster.yaml as an example, and users can modify them to their own cluster files to execute @@ -356,7 +356,7 @@ The following commands are executed using default_cluster.yaml as an example, an #### Check cluster deployment environment commands ```bash -iotd cluster check default_cluster +iotdbctl cluster check default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -373,7 +373,7 @@ iotd cluster check default_cluster #### Deploy cluster command ```bash -iotd cluster deploy default_cluster +iotdbctl cluster deploy default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -383,7 +383,7 @@ iotd cluster deploy default_cluster * Generate and upload `iotdb-common.properties`, `iotdb-confignode.properties`, `iotdb-datanode.properties` according to the yaml file node configuration information ```bash -iotd cluster deploy default_cluster -op force +iotdbctl cluster deploy default_cluster -op force ``` Note: This command will force the deployment, and the specific process will delete the existing deployment directory and redeploy @@ -391,17 +391,17 @@ Note: This command will force the deployment, and the specific process will dele *deploy a single module* ```bash # Deploy grafana module -iotd cluster deploy default_cluster -N grafana +iotdbctl cluster deploy default_cluster -N grafana # Deploy the prometheus module -iotd cluster deploy default_cluster -N prometheus +iotdbctl cluster deploy default_cluster -N prometheus # Deploy the iotdb module -iotd cluster deploy default_cluster -N iotdb +iotdbctl cluster deploy default_cluster -N iotdb ``` #### Start cluster command ```bash -iotd cluster start default_cluster +iotdbctl cluster start default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -417,13 +417,13 @@ iotd cluster start default_cluster Start a single node command* ```bash #Start according to the IoTDB node name -iotd cluster start default_cluster -N datanode_1 +iotdbctl cluster start default_cluster -N datanode_1 #Start according to IoTDB cluster ip+port, where port corresponds to cn_internal_port of confignode and rpc_port of datanode. -iotd cluster start default_cluster -N 192.168.1.5:6667 +iotdbctl cluster start default_cluster -N 192.168.1.5:6667 #Start grafana -iotd cluster start default_cluster -N grafana +iotdbctl cluster start default_cluster -N grafana #Start prometheus -iotd cluster start default_cluster -N prometheus +iotdbctl cluster start default_cluster -N prometheus ``` * Find the yaml file in the default location based on cluster-name @@ -434,15 +434,15 @@ iotd cluster start default_cluster -N prometheus * start the node Note: Since the cluster deployment tool only calls the start-confignode.sh and start-datanode.sh scripts in the IoTDB cluster, -When the actual output result fails, it may be that the cluster has not started normally. It is recommended to use the status command to check the current cluster status (iotd cluster status xxx) +When the actual output result fails, it may be that the cluster has not started normally. It is recommended to use the status command to check the current cluster status (iotdbctl cluster status xxx) #### View IoTDB cluster status command ```bash -iotd cluster show default_cluster +iotdbctl cluster show default_cluster #View IoTDB cluster details -iotd cluster show default_cluster details +iotdbctl cluster show default_cluster details ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -452,7 +452,7 @@ iotd cluster show default_cluster details ```bash -iotd cluster stop default_cluster +iotdbctl cluster stop default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -463,7 +463,7 @@ iotd cluster stop default_cluster *force stop cluster command* ```bash -iotd cluster stop default_cluster -op force +iotdbctl cluster stop default_cluster -op force ``` Will directly execute the kill -9 pid command to forcibly stop the cluster @@ -471,13 +471,13 @@ Will directly execute the kill -9 pid command to forcibly stop the cluster ```bash #Stop by IoTDB node name -iotd cluster stop default_cluster -N datanode_1 +iotdbctl cluster stop default_cluster -N datanode_1 #Stop according to IoTDB cluster ip+port (ip+port is to get the only node according to ip+dn_rpc_port in datanode or ip+cn_internal_port in confignode to get the only node) -iotd cluster stop default_cluster -N 192.168.1.5:6667 +iotdbctl cluster stop default_cluster -N 192.168.1.5:6667 #Stop grafana -iotd cluster stop default_cluster -N grafana +iotdbctl cluster stop default_cluster -N grafana #Stop prometheus -iotd cluster stop default_cluster -N prometheus +iotdbctl cluster stop default_cluster -N prometheus ``` * Find the yaml file in the default location based on cluster-name @@ -493,7 +493,7 @@ Note: Since the cluster deployment tool only calls the stop-confignode.sh and st #### Clean cluster data command ```bash -iotd cluster clean default_cluster +iotdbctl cluster clean default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -509,7 +509,7 @@ iotd cluster clean default_cluster #### Restart cluster command ```bash -iotd cluster restart default_cluster +iotdbctl cluster restart default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` @@ -518,7 +518,7 @@ iotd cluster restart default_cluster *Force restart cluster command* ```bash -iotd cluster restart default_cluster -op force +iotdbctl cluster restart default_cluster -op force ``` Will directly execute the kill -9 pid command to force stop the cluster, and then start the cluster @@ -527,22 +527,22 @@ Will directly execute the kill -9 pid command to force stop the cluster, and the ```bash #Restart datanode_1 according to the IoTDB node name -iotd cluster restart default_cluster -N datanode_1 +iotdbctl cluster restart default_cluster -N datanode_1 #Restart confignode_1 according to the IoTDB node name -iotd cluster restart default_cluster -N confignode_1 +iotdbctl cluster restart default_cluster -N confignode_1 #Restart grafana -iotd cluster restart default_cluster -N grafana +iotdbctl cluster restart default_cluster -N grafana #Restart prometheus -iotd cluster restart default_cluster -N prometheus +iotdbctl cluster restart default_cluster -N prometheus ``` #### Cluster shrink command ```bash #Scale down by node name -iotd cluster scalein default_cluster -N nodename +iotdbctl cluster scalein default_cluster -N nodename #Scale down according to ip+port (ip+port obtains the only node according to ip+dn_rpc_port in datanode, and obtains the only node according to ip+cn_internal_port in confignode) -iotd cluster scalein default_cluster -N ip:port +iotdbctl cluster scalein default_cluster -N ip:port ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -557,7 +557,7 @@ Tip: Currently, only one node scaling is supported at a time #### Cluster expansion command ```bash -iotd cluster scaleout default_cluster +iotdbctl cluster scaleout default_cluster ``` * Modify the config/xxx.yaml file to add a datanode node or confignode node @@ -573,7 +573,7 @@ Tip: Currently, only one node expansion is supported at a time #### destroy cluster command ```bash -iotd cluster destroy default_cluster +iotdbctl cluster destroy default_cluster ``` * cluster-name finds the yaml file in the default location @@ -589,17 +589,17 @@ iotd cluster destroy default_cluster ```bash # Destroy grafana module -iotd cluster destroy default_cluster -N grafana +iotdbctl cluster destroy default_cluster -N grafana # Destroy prometheus module -iotd cluster destroy default_cluster -N prometheus +iotdbctl cluster destroy default_cluster -N prometheus # Destroy iotdb module -iotd cluster destroy default_cluster -N iotdb +iotdbctl cluster destroy default_cluster -N iotdb ``` #### Distribute cluster configuration commands ```bash -iotd cluster distribute default_cluster +iotdbctl cluster distribute default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` @@ -609,7 +609,7 @@ iotd cluster distribute default_cluster #### Hot load cluster configuration command ```bash -iotd cluster reload default_cluster +iotdbctl cluster reload default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -617,12 +617,12 @@ iotd cluster reload default_cluster #### Cluster node log backup ```bash -iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' +iotdbctl cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' ``` * Find the yaml file in the default location based on cluster-name -* This command will verify the existence of datanode_1 and confignode_1 according to the yaml file, and then back up the log data of the specified node datanode_1 and confignode_1 to the specified service `192.168.9.48` port `36000 according to the configured start and end dates (startdate<=logtime<=enddate) ` The data backup path is `/iotdb/logs`, and the IoTDB log storage path is `/root/data/db/iotdb/logs` (not required, if you do not fill in -logs xxx, the default is to backup logs from the IoTDB installation path /logs ) +* This command will verify the existence of datanode_1 and confignode_1 according to the yaml file, and then back up the log data of the specified node datanode_1 and confignode_1 to the specified service `192.168.9.48` port 36000 according to the configured start and end dates (startdate<=logtime<=enddate) The data backup path is `/iotdb/logs`, and the IoTDB log storage path is `/root/data/db/iotdb/logs` (not required, if you do not fill in -logs xxx, the default is to backup logs from the IoTDB installation path /logs ) | command | description | required | |------------|-------------------------------------------------------------------------|----------| @@ -640,9 +640,9 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 #### Cluster data backup ```bash -iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' +iotdbctl cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' ``` -* This command will obtain the leader node based on the yaml file, and then back up the data to the /iotdb/datas directory on the 192.168.9.48 service based on the start and end dates (startdate<=logtime<=enddate) +* This command will obtain the leader node based on the yaml file, and then back up the data to the /iotdb/datas directory on the 192.168.9.48 service based on the start and end dates (startdate<=logtime<=enddate) | command | description | required | |--------------|-------------------------------------------------------------------------|----------| @@ -658,7 +658,7 @@ iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-0 #### Cluster upgrade ```bash -iotd cluster upgrade default_cluster +iotdbctl cluster upgrade default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers` and `datanode_servers` @@ -668,28 +668,78 @@ Note that after performing the upgrade, please restart IoTDB for it to take effe #### Cluster initialization ```bash -iotd cluster init default_cluster +iotdbctl cluster init default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` * Initialize cluster configuration #### View cluster process status ```bash -iotd cluster status default_cluster +iotdbctl cluster status default_cluster ``` * Find the yaml file in the default location according to cluster-name and obtain the configuration information of `confignode_servers`, `datanode_servers`, `grafana` and `prometheus` * Display the survival status of each node in the cluster +#### Cluster authorization activation + +Cluster activation is activated by entering the activation code by default, or by using the - op license_path activated through license path + +* Default activation method +```bash +iotdbctl cluster activate default_cluster +``` +* Find the yaml file in the default location based on `cluster-name` and obtain the `confignode_servers` configuration information +* Obtain the machine code inside +* Waiting for activation code input + +```bash +Machine code: +Kt8NfGP73FbM8g4Vty+V9qU5lgLvwqHEF3KbLN/SGWYCJ61eFRKtqy7RS/jw03lHXt4MwdidrZJ== +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKgGXEGzMms25+u== +Please enter the activation code: +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKg=,lTF1Dur1AElXIi/5jPV9h0XCm8ziPd9/R+tMYLsze1oAPxE87+Nwws= +Activation successful +``` +* Activate a node + +```bash +iotdbctl cluster activate default_cluster -N confignode1 +``` + +* Activate through license path + +```bash +iotdbctl cluster activate default_cluster -op license_path +``` +* Find the yaml file in the default location based on `cluster-name` and obtain the `confignode_servers` configuration information +* Obtain the machine code inside +* Waiting for activation code input + +```bash +Machine code: +Kt8NfGP73FbM8g4Vty+V9qU5lgLvwqHEF3KbLN/SGWYCJ61eFRKtqy7RS/jw03lHXt4MwdidrZJ== +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKgGXEGzMms25+u== +Please enter the activation code: +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKg=,lTF1Dur1AElXIi/5jPV9h0XCm8ziPd9/R+tMYLsze1oAPxE87+Nwws= +Activation successful +``` +* Activate a node + +```bash +iotdbctl cluster activate default_cluster -N confignode1 -op license_path +``` + + ### Introduction to Cluster Deployment Tool Samples In the cluster deployment tool installation directory config/example, there are three yaml examples. If necessary, you can copy them to config and modify them. -| name | description | -|--------------------------|------------------------------------------------| -| default_1c1d.yaml | 1 confignode and 1 datanode configuration example | -| default_3c3d.yaml | 3 confignode and 3 datanode configuration samples | -| default_3c3d_grafa_prome | 3 confignode and 3 datanode, Grafana, Prometheus configuration examples | +| name | description | +|-----------------------------|------------------------------------------------| +| default\_1c1d.yaml | 1 confignode and 1 datanode configuration example | +| default\_3c3d.yaml | 3 confignode and 3 datanode configuration samples | +| default\_3c3d\_grafa\_prome | 3 confignode and 3 datanode, Grafana, Prometheus configuration examples | ## Manual Deployment @@ -801,12 +851,12 @@ and set the following parameters base on the Open the ConfigNode configuration file ./conf/iotdb-confignode.properties, and set the following parameters based on the IP address and available port of the server or VM: -| **Configuration** | **Description** | **Default** | **Usage** | -| ------------------------------ | ------------------------------------------------------------ | --------------- | ------------------------------------------------------------ | -| cn\_internal\_address | Internal rpc service address of ConfigNode | 127.0.0.1 | Set to the IPV4 address or domain name of the server | -| cn\_internal\_port | Internal rpc service port of ConfigNode | 10710 | Set to any unoccupied port | -| cn\_consensus\_port | ConfigNode replication consensus protocol communication port | 10720 | Set to any unoccupied port | -| cn\_target\_config\_node\_list | ConfigNode address to which the node is connected when it is registered to the cluster. Note that Only one ConfigNode can be configured. | 127.0.0.1:10710 | For Seed-ConfigNode, set to its own cn\_internal\_address:cn\_internal\_port; For other ConfigNodes, set to other one running ConfigNode's cn\_internal\_address:cn\_internal\_port | +| **Configuration** | **Description** | **Default** | **Usage** | +|------------------------| ------------------------------------------------------------ | --------------- | ------------------------------------------------------------ | +| cn\_internal\_address | Internal rpc service address of ConfigNode | 127.0.0.1 | Set to the IPV4 address or domain name of the server | +| cn\_internal\_port | Internal rpc service port of ConfigNode | 10710 | Set to any unoccupied port | +| cn\_consensus\_port | ConfigNode replication consensus protocol communication port | 10720 | Set to any unoccupied port | +| cn\_seed\_config\_node | ConfigNode address to which the node is connected when it is registered to the cluster. Note that Only one ConfigNode can be configured. | 127.0.0.1:10710 | For Seed-ConfigNode, set to its own cn\_internal\_address:cn\_internal\_port; For other ConfigNodes, set to other one running ConfigNode's cn\_internal\_address:cn\_internal\_port | **Notice: The preceding configuration parameters cannot be changed after the node is started. Ensure that all ports are not occupied. Otherwise, the Node cannot be started.** @@ -816,7 +866,7 @@ Open the DataNode configuration file ./conf/iotdb-datanode.properties, and set the following parameters based on the IP address and available port of the server or VM: | **Configuration** | **Description** | **Default** | **Usage** | -| ----------------------------------- | ------------------------------------------------ | --------------- | ------------------------------------------------------------ | +|-------------------------------------| ------------------------------------------------ | --------------- | ------------------------------------------------------------ | | dn\_rpc\_address | Client RPC Service address | 127.0.0.1 | Set to the IPV4 address or domain name of the server | | dn\_rpc\_port | Client RPC Service port | 6667 | Set to any unoccupied port | | dn\_internal\_address | Control flow address of DataNode inside cluster | 127.0.0.1 | Set to the IPV4 address or domain name of the server | @@ -824,7 +874,7 @@ and set the following parameters based on the IP address and available port of t | dn\_mpp\_data\_exchange\_port | Data flow port of DataNode inside cluster | 10740 | Set to any unoccupied port | | dn\_data\_region\_consensus\_port | Data replicas communication port for consensus | 10750 | Set to any unoccupied port | | dn\_schema\_region\_consensus\_port | Schema replicas communication port for consensus | 10760 | Set to any unoccupied port | -| dn\_target\_config\_node\_list | Running ConfigNode of the Cluster | 127.0.0.1:10710 | Set to any running ConfigNode's cn\_internal\_address:cn\_internal\_port. You can set multiple values, separate them with commas(",") | +| dn\_seed\_config\_node | Running ConfigNode of the Cluster | 127.0.0.1:10710 | Set to any running ConfigNode's cn\_internal\_address:cn\_internal\_port. You can set multiple values, separate them with commas(",") | **Notice: The preceding configuration parameters cannot be changed after the node is started. Ensure that all ports are not occupied. Otherwise, the Node cannot be started.** @@ -863,12 +913,12 @@ These parameters are not modifiable after the Node first startup. Then open its configuration file ./conf/iotdb-confignode.properties and check the following parameters: -| **Configuration** | **Check** | -| ------------------------------ | ------------------------------------------------------------ | -| cn\_internal\_address | Is set to the IPV4 address or domain name of the server | -| cn\_internal\_port | The port isn't occupied | -| cn\_consensus\_port | The port isn't occupied | -| cn\_target\_config\_node\_list | Is set to its own internal communication address, which is cn\_internal\_address:cn\_internal\_port | +| **Configuration** | **Check** | +|------------------------| ------------------------------------------------------------ | +| cn\_internal\_address | Is set to the IPV4 address or domain name of the server | +| cn\_internal\_port | The port isn't occupied | +| cn\_consensus\_port | The port isn't occupied | +| cn\_seed\_config\_node | Is set to its own internal communication address, which is cn\_internal\_address:cn\_internal\_port | After checking, you can run the startup script on the server: @@ -908,12 +958,12 @@ Therefore, please check the following parameters in common configuration file: Then, please open its configuration file ./conf/iotdb-confignode.properties and check the following parameters: -| **Configuration** | **Check** | -| ------------------------------ | ------------------------------------------------------------ | -| cn\_internal\_address | Is set to the IPV4 address or domain name of the server | -| cn\_internal\_port | The port isn't occupied | -| cn\_consensus\_port | The port isn't occupied | -| cn\_target\_config\_node\_list | Is set to the internal communication address of an other running ConfigNode. The internal communication address of the seed ConfigNode is recommended. | +| **Configuration** | **Check** | +|------------------------| ------------------------------------------------------------ | +| cn\_internal\_address | Is set to the IPV4 address or domain name of the server | +| cn\_internal\_port | The port isn't occupied | +| cn\_consensus\_port | The port isn't occupied | +| cn\_seed\_config\_node | Is set to the internal communication address of an other running ConfigNode. The internal communication address of the seed ConfigNode is recommended. | After checking, you can run the startup script on the server: @@ -947,7 +997,7 @@ please open its common configuration file ./conf/iotdb-common.properties and che Then open its configuration file ./conf/iotdb-datanode.properties and check the following parameters: | **Configuration** | **Check** | -| ----------------------------------- | ------------------------------------------------------------ | +|-------------------------------------| ------------------------------------------------------------ | | dn\_rpc\_address | Is set to the IPV4 address or domain name of the server | | dn\_rpc\_port | The port isn't occupied | | dn\_internal\_address | Is set to the IPV4 address or domain name of the server | @@ -955,7 +1005,7 @@ Then open its configuration file ./conf/iotdb-datanode.properties and check the | dn\_mpp\_data\_exchange\_port | The port isn't occupied | | dn\_data\_region\_consensus\_port | The port isn't occupied | | dn\_schema\_region\_consensus\_port | The port isn't occupied | -| dn\_target\_config\_node\_list | Is set to the internal communication address of other running ConfigNodes. The internal communication address of the seed ConfigNode is recommended. | +| dn\_seed\_config\_node | Is set to the internal communication address of other running ConfigNodes. The internal communication address of the seed ConfigNode is recommended. | After checking, you can run the startup script on the server: diff --git a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md index 33a64f7c..459b81b9 100644 --- a/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -131,25 +131,25 @@ iotd cluster check example 更多详细命令请参考下面命令列表。 -| parameter name | parameter describe | required | -|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| -| iotdb_zip_dir | IoTDB deployment distribution directory, if the value is empty, it will be downloaded from the address specified by `iotdb_download_url` | NO | -| iotdb_download_url | IoTDB download address, if `iotdb_zip_dir` has no value, download from the specified address | NO | -| jdk_tar_dir | jdk local directory, you can use this jdk path to upload and deploy to the target node. | NO | -| jdk_deploy_dir | jdk remote machine deployment directory, jdk will be deployed to this directory, and the following `jdk_dir_name` parameter forms a complete jdk deployment directory, that is, `/` | NO | -| jdk_dir_name | The directory name after jdk decompression defaults to jdk_iotdb | NO | -| iotdb_lib_dir | The IoTDB lib directory or the IoTDB lib compressed package only supports .zip format and is only used for IoTDB upgrade. It is in the comment state by default. If you need to upgrade, please open the comment and modify the path. If you use a zip file, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* d | NO | -| user | User name for ssh login deployment machine | YES | -| password | The password for ssh login. If the password does not specify the use of pkey to log in, please ensure that the ssh login between nodes has been configured without a key. | NO | -| pkey | Key login: If password has a value, password is used first, otherwise pkey is used to log in. | NO | -| ssh_port | ssh port | YES | -| deploy_dir | IoTDB deployment directory, IoTDB will be deployed to this directory and the following `iotdb_dir_name` parameter will form a complete IoTDB deployment directory, that is, `/` | YES | -| iotdb_dir_name | The directory name after decompression of IoTDB is iotdb by default. | NO | -| datanode-env.sh | Corresponding to `iotdb/config/datanode-env.sh`, when `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first | NO | -| confignode-env.sh | Corresponding to `iotdb/config/confignode-env.sh`, the value in `datanode_servers` is used first when `global` and `datanode_servers` are configured at the same time | NO | -| iotdb-common.properties | Corresponds to `/config/iotdb-common.properties` | NO | -| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | -| dn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties` | YES | +| parameter name | parameter describe | required | +|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| iotdb\_zip\_dir | IoTDB deployment distribution directory, if the value is empty, it will be downloaded from the address specified by `iotdb_download_url` | NO | +| iotdb\_download\_url | IoTDB download address, if `iotdb_zip_dir` has no value, download from the specified address | NO | +| jdk\_tar\_dir | jdk local directory, you can use this jdk path to upload and deploy to the target node. | NO | +| jdk\_deploy\_dir | jdk remote machine deployment directory, jdk will be deployed to this directory, and the following `jdk_dir_name` parameter forms a complete jdk deployment directory, that is, `/` | NO | +| jdk\_dir\_name | The directory name after jdk decompression defaults to jdk_iotdb | NO | +| iotdb\_lib\_dir | The IoTDB lib directory or the IoTDB lib compressed package only supports .zip format and is only used for IoTDB upgrade. It is in the comment state by default. If you need to upgrade, please open the comment and modify the path. If you use a zip file, please use the zip command to compress the iotdb/lib directory, such as zip -r lib.zip apache-iotdb-1.2.0/lib/* d | NO | +| user | User name for ssh login deployment machine | YES | +| password | The password for ssh login. If the password does not specify the use of pkey to log in, please ensure that the ssh login between nodes has been configured without a key. | NO | +| pkey | Key login: If password has a value, password is used first, otherwise pkey is used to log in. | NO | +| ssh\_port | ssh port | YES | +| deploy\_dir | IoTDB deployment directory, IoTDB will be deployed to this directory and the following `iotdb_dir_name` parameter will form a complete IoTDB deployment directory, that is, `/` | YES | +| iotdb\_dir\_name | The directory name after decompression of IoTDB is iotdb by default. | NO | +| datanode-env.sh | Corresponding to `iotdb/config/datanode-env.sh`, when `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first | NO | +| confignode-env.sh | Corresponding to `iotdb/config/confignode-env.sh`, the value in `datanode_servers` is used first when `global` and `datanode_servers` are configured at the same time | NO | +| iotdb-common.properties | Corresponds to `/config/iotdb-common.properties` | NO | +| cn\_target\_config\_node\_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | +| dn\_target\_config\_node\_list | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties` | YES | Among them, datanode-env.sh and confignode-env.sh can be configured with extra parameters extra_opts. When this parameter is configured, corresponding values will be appended after datanode-env.sh and confignode-env.sh. Refer to default_cluster.yaml for configuration examples as follows: datanode-env.sh: @@ -160,54 +160,54 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" * `confignode_servers` is the configuration for deploying IoTDB Confignodes, in which multiple Confignodes can be configured By default, the first started ConfigNode node node1 is regarded as the Seed-ConfigNode -|parameter name | parameter describe | required | -|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| -| name | Confignode name | YES | -| deploy_dir | IoTDB config node deployment directory | YES| | -| iotdb-confignode.properties | Corresponding to `iotdb/config/iotdb-confignode.properties`, please refer to the `iotdb-confignode.properties` file description for more details. | NO | -| cn_internal_address | Corresponds to iotdb/internal communication address, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | -| cn_target_config_node_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | -| cn_internal_port | Internal communication port, corresponding to `cn_internal_port` in `iotdb/config/iotdb-confignode.properties` | YES | -| cn_consensus_port | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` | NO | -| cn_data_dir | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` Corresponds to `cn_data_dir` in `iotdb/config/iotdb-confignode.properties` | YES | -| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `confignode_servers` at the same time, the value in confignode_servers will be used first. | NO | +| parameter name | parameter describe | required | +|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| name | Confignode name | YES | +| deploy\_dir | IoTDB config node deployment directory | YES| | +| iotdb-confignode.properties | Corresponding to `iotdb/config/iotdb-confignode.properties`, please refer to the `iotdb-confignode.properties` file description for more details. | NO | +| cn\_internal\_address | Corresponds to iotdb/internal communication address, corresponding to `cn_internal_address` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn\_target\_config\_node\_list | The cluster configuration address points to the surviving ConfigNode, and it points to confignode_x by default. When `global` and `confignode_servers` are configured at the same time, the value in `confignode_servers` is used first, corresponding to `cn_target_config_node_list` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn\_internal\_port | Internal communication port, corresponding to `cn_internal_port` in `iotdb/config/iotdb-confignode.properties` | YES | +| cn\_consensus\_port | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` | NO | +| cn\_data\_dir | Corresponds to `cn_consensus_port` in `iotdb/config/iotdb-confignode.properties` Corresponds to `cn_data_dir` in `iotdb/config/iotdb-confignode.properties` | YES | +| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `confignode_servers` at the same time, the value in confignode_servers will be used first. | NO | * datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode -|parameter name | parameter describe | required | -| ---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| -|name| Datanode name | YES | -|deploy_dir| IoTDB data node deployment directory | YES | -|iotdb-datanode.properties| Corresponding to `iotdb/config/iotdb-datanode.properties`, please refer to the `iotdb-datanode.properties` file description for more details. | NO | -|dn_rpc_address| The datanode rpc address corresponds to `dn_rpc_address` in `iotdb/config/iotdb-datanode.properties` | YES | -|dn_internal_address| Internal communication address, corresponding to `dn_internal_address` in `iotdb/config/iotdb-datanode.properties` | YES | -|dn_target_config_node_list| The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties`. | YES | -|dn_rpc_port| Datanode rpc port address, corresponding to `dn_rpc_port` in `iotdb/config/iotdb-datanode.properties` | YES | -|dn_internal_port| Internal communication port, corresponding to `dn_internal_port` in `iotdb/config/iotdb-datanode.properties` | YES | -|iotdb-common.properties| Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `datanode_servers` at the same time, the value in `datanode_servers` will be used first. | NO | +| parameter name | parameter describe | required | +|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| name | Datanode name | YES | +| deploy\_dir | IoTDB data node deployment directory | YES | +| iotdb-datanode.properties | Corresponding to `iotdb/config/iotdb-datanode.properties`, please refer to the `iotdb-datanode.properties` file description for more details. | NO | +| dn\_rpc\_address | The datanode rpc address corresponds to `dn_rpc_address` in `iotdb/config/iotdb-datanode.properties` | YES | +| dn\_internal\_address | Internal communication address, corresponding to `dn_internal_address` in `iotdb/config/iotdb-datanode.properties` | YES | +| dn\_target\_config\_node\_list | The cluster configuration address points to the surviving ConfigNode, and points to confignode_x by default. When configuring values for `global` and `datanode_servers` at the same time, the value in `datanode_servers` is used first, corresponding to `dn_target_config_node_list` in `iotdb/config/iotdb-datanode.properties`. | YES | +| dn\_rpc\_port | Datanode rpc port address, corresponding to `dn_rpc_port` in `iotdb/config/iotdb-datanode.properties` | YES | +| dn\_internal\_port | Internal communication port, corresponding to `dn_internal_port` in `iotdb/config/iotdb-datanode.properties` | YES | +| iotdb-common.properties | Corresponding to `iotdb/config/iotdb-common.properties`, when configuring values in `global` and `datanode_servers` at the same time, the value in `datanode_servers` will be used first. | NO | * grafana_server is the configuration related to deploying Grafana -|parameter name | parameter describe | required | -|------------------|-------------------------------------------------------------|-----------| -| grafana_dir_name | Grafana decompression directory name(default grafana_iotdb) | NO | -| host | Server ip deployed by grafana | YES | -| grafana_port | The port of grafana deployment machine, default 3000 | NO | -| deploy_dir | grafana deployment server directory | YES | -| grafana_tar_dir | Grafana compressed package location | YES | -| dashboards | dashboards directory | NO | +| parameter name | parameter describe | required | +|--------------------|-------------------------------------------------------------|-----------| +| grafana\_dir\_name | Grafana decompression directory name(default grafana_iotdb) | NO | +| host | Server ip deployed by grafana | YES | +| grafana\_port | The port of grafana deployment machine, default 3000 | NO | +| deploy\_dir | grafana deployment server directory | YES | +| grafana\_tar\_dir | Grafana compressed package location | YES | +| dashboards | dashboards directory | NO | * prometheus_server 是部署Prometheus 相关配置 -|parameter name | parameter describe | required | -|---------------------|----------------------------------------------------|----------| -| prometheus_dir_name | prometheus decompression directory name, default prometheus_iotdb | NO | -| host | Server IP deployed by prometheus | YES | -| prometheus_port | The port of prometheus deployment machine, default 9090 | NO | -| deploy_dir | prometheus deployment server directory | YES | -| prometheus_tar_dir | prometheus compressed package path | YES | -| storage_tsdb_retention_time | The number of days to save data is 15 days by default | NO | -| storage_tsdb_retention_size | The data size that can be saved by the specified block defaults to 512M. Please note the units are KB, MB, GB, TB, PB, and EB. | NO | +| parameter name | parameter describe | required | +|--------------------------------|----------------------------------------------------|----------| +| prometheus\_dir\_name | prometheus decompression directory name, default prometheus_iotdb | NO | +| host | Server IP deployed by prometheus | YES | +| prometheus\_port | The port of prometheus deployment machine, default 9090 | NO | +| deploy\_dir | prometheus deployment server directory | YES | +| prometheus\_tar\_dir | prometheus compressed package path | YES | +| storage\_tsdb\_retention\_time | The number of days to save data is 15 days by default | NO | +| storage\_tsdb\_retention\_size | The data size that can be saved by the specified block defaults to 512M. Please note the units are KB, MB, GB, TB, PB, and EB. | NO | If metrics are configured in `iotdb-datanode.properties` and `iotdb-confignode.properties` of config/xxx.yaml, the configuration will be automatically put into promethues without manual modification. @@ -642,7 +642,7 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 ```bash iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' ``` -* This command will obtain the leader node based on the yaml file, and then back up the data to the /iotdb/datas directory on the 192.168.9.48 service based on the start and end dates (startdate<=logtime<=enddate) +* This command will obtain the leader node based on the yaml file, and then back up the data to the /iotdb/datas directory on the 192.168.9.48 service based on the start and end dates (startdate<=logtime<=enddate) | command | description | required | |--------------|-------------------------------------------------------------------------|----------| @@ -685,11 +685,11 @@ iotd cluster status default_cluster In the cluster deployment tool installation directory config/example, there are three yaml examples. If necessary, you can copy them to config and modify them. -| name | description | -|--------------------------|------------------------------------------------| -| default_1c1d.yaml | 1 confignode and 1 datanode configuration example | -| default_3c3d.yaml | 3 confignode and 3 datanode configuration samples | -| default_3c3d_grafa_prome | 3 confignode and 3 datanode, Grafana, Prometheus configuration examples | +| name | description | +|-----------------------------|------------------------------------------------| +| default\_1c1d.yaml | 1 confignode and 1 datanode configuration example | +| default\_3c3d.yaml | 3 confignode and 3 datanode configuration samples | +| default\_3c3d\_grafa\_prome | 3 confignode and 3 datanode, Grafana, Prometheus configuration examples | ## Manual Deployment diff --git a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md index f7637155..168e381b 100644 --- a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -96,19 +96,19 @@ IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof、netstat、unzi * 在iotd目录内输入以下指令后: ```bash -bash install-iotd.sh +bash install-iotdbctl.sh ``` -即可在之后的 shell 内激活 iotd 关键词,如检查部署前所需的环境指令如下所示: +即可在之后的 shell 内激活 iotdbctl 关键词,如检查部署前所需的环境指令如下所示: ```bash -iotd cluster check example +iotdbctl cluster check example ``` -* 也可以不激活iotd直接使用 <iotd absolute path>/sbin/iotd 来执行命令,如检查部署前所需的环境: +* 也可以不激活iotd直接使用 <iotdbctl absolute path>/sbin/iotdbctl 来执行命令,如检查部署前所需的环境: ```bash -/sbin/iotd cluster check example +/sbin/iotdbctl cluster check example ``` ### 系统结构 @@ -125,36 +125,36 @@ IoTDB集群管理工具主要由config、logs、doc、sbin目录组成。 ### 集群配置文件介绍 -* 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml 文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。 +* 在`iotdbctl/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml 文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。 * yaml 文件配置由`global`、`confignode_servers`、`datanode_servers`、`grafana_server`、`prometheus_server`四大部分组成 -* global 是通用配置主要配置机器用户名密码、IoTDB本地安装文件、Jdk配置等。在`iotd/config`目录中提供了一个`default_cluster.yaml`样例数据, +* global 是通用配置主要配置机器用户名密码、IoTDB本地安装文件、Jdk配置等。在`iotdbctl/config`目录中提供了一个`default_cluster.yaml`样例数据, 用户可以复制修改成自己集群名字并参考里面的说明进行配置IoTDB集群,在`default_cluster.yaml`样例中没有注释的均为必填项,已经注释的为非必填项。 -例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotd cluster check default_cluster`即可, +例如要执行`default_cluster.yaml`检查命令则需要执行命令`iotdbctl cluster check default_cluster`即可, 更多详细命令请参考下面命令列表。 -| 参数 | 说明 | 是否必填 | -|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| -| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | -| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | -| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | -| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | -| jdk_dir_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | -| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可。如果使用zip文件请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* | 非必填 | -| user | ssh登陆部署机器的用户名 | 必填 | -| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | -| pkey | 密钥登陆如果password有值优先使用password否则使用pkey登陆 | 非必填 | -| ssh_port | ssh登录端口 | 必填 | -| deploy_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | -| iotdb_dir_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | -| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` ,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值 | 非必填 | -| confignode-env.sh | 对应`iotdb/config/confignode-env.sh`,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值 | 非必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | -| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| dn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list` | 必填 | - -其中datanode-env.sh 和confignode-env.sh 可以配置额外参数extra_opts,当该参数配置后会在datanode-env.sh 和confignode-env.sh 后面追加对应的值,可参考default_cluster.yaml,配置示例如下: +| 参数 | 说明 | 是否必填 | +|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| iotdb\_zip\_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | +| iotdb\_download\_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | +| jdk\_tar\_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | +| jdk\_deploy\_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | +| jdk\_dir\_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | +| iotdb\_lib\_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可。如果使用zip文件请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache\-iotdb\-1.2.0/lib/* | 非必填 | +| user | ssh登陆部署机器的用户名 | 必填 | +| password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | +| pkey | 密钥登陆如果password有值优先使用password否则使用pkey登陆 | 非必填 | +| ssh\_port | ssh登录端口 | 必填 | +| deploy\_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | +| iotdb\_dir\_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | +| datanode-env.sh | 对应`iotdb/config/datanode-env.sh` ,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值 | 非必填 | +| confignode-env.sh | 对应`iotdb/config/confignode-env.sh`,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值 | 非必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | +| cn\_seed\_config\_node | 集群配置地址指向存活的ConfigNode,默认指向confignode\_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_seed_config_node` | 必填 | +| dn\_seed\_config\_node | 集群配置地址指向存活的ConfigNode,默认指向confignode\_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_seed_config_node` | 必填 | + +其中datanode-env.sh 和confignode-env.sh 可以配置额外参数extra_opts,当该参数配置后会在datanode-env.sh 和confignode-env.sh 后面追加对应的值,可参考default\_cluster.yaml,配置示例如下: datanode-env.sh: extra_opts: | IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+UseG1GC" @@ -163,54 +163,54 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" * confignode_servers 是部署IoTDB Confignodes配置,里面可以配置多个Confignode 默认将第一个启动的ConfigNode节点node1当作Seed-ConfigNode -| 参数 | 说明 | 是否必填 | -|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| -| name | Confignode 名称 | 必填 | -| deploy_dir | IoTDB config node 部署目录 | 必填| | -| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | -| cn_internal_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | -| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| cn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | -| cn_consensus_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | -| cn_data_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode_servers中的值 | 非必填 | +| 参数 | 说明 | 是否必填 | +|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| name | Confignode 名称 | 必填 | +| deploy\_dir | IoTDB config node 部署目录 | 必填| | +| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | +| cn\_internal\_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | +| cn\_seed\_config\_node | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_seed_config_node` | 必填 | +| cn\_internal\_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | +| cn\_consensus\_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | +| cn\_data\_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode\_servers中的值 | 非必填 | * datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode -| 参数 | 说明 |是否必填| -| ---| --- |--- | -|name|Datanode 名称|必填| -|deploy_dir|IoTDB data node 部署目录|必填| -|iotdb-datanode.properties|对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明|非必填| -|dn_rpc_address|datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address`|必填| -|dn_internal_address|内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address`|必填| -|dn_target_config_node_list|集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list`|必填| -|dn_rpc_port|datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port`|必填| -|dn_internal_port|内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port`|必填| -|iotdb-common.properties|对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值|非必填| +| 参数 | 说明 |是否必填| +|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--- | +| name | Datanode 名称 |必填| +| deploy\_dir | IoTDB data node 部署目录 |必填| +| iotdb-datanode.properties | 对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明 |非必填| +| dn\_rpc\_address | datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address` |必填| +| dn\_internal\_address | 内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address` |必填| +| dn\_seed\_config\_node | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_seed_config_node` |必填| +| dn\_rpc\_port | datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port` |必填| +| dn\_internal\_port | 内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port` |必填| +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值 |非必填| * grafana_server 是部署Grafana 相关配置 -| 参数 | 说明 | 是否必填 | -|------------------|------------------|-------------------| -| grafana_dir_name | grafana 解压目录名称 | 非必填默认grafana_iotdb | -| host | grafana 部署的服务器ip | 必填 | -| grafana_port | grafana 部署机器的端口 | 非必填,默认3000 | -| deploy_dir | grafana 部署服务器目录 | 必填 | -| grafana_tar_dir | grafana 压缩包位置 | 必填 | -| dashboards | dashboards 所在的位置 | 非必填,多个用逗号隔开 | +| 参数 | 说明 | 是否必填 | +|--------------------|------------------|-------------------| +| grafana\_dir\_name | grafana 解压目录名称 | 非必填默认grafana_iotdb | +| host | grafana 部署的服务器ip | 必填 | +| grafana\_port | grafana 部署机器的端口 | 非必填,默认3000 | +| deploy\_dir | grafana 部署服务器目录 | 必填 | +| grafana\_tar\_dir | grafana 压缩包位置 | 必填 | +| dashboards | dashboards 所在的位置 | 非必填,多个用逗号隔开 | * prometheus_server 是部署Prometheus 相关配置 -| 参数 | 说明 | 是否必填 | -|---------------------|------------------|-----------------------| -| prometheus_dir_name | prometheus 解压目录名称 | 非必填默认prometheus_iotdb | -| host | prometheus 部署的服务器ip | 必填 | -| prometheus_port | prometheus 部署机器的端口 | 非必填,默认9090 | -| deploy_dir | prometheus 部署服务器目录 | 必填 | -| prometheus_tar_dir | prometheus 压缩包位置 | 必填 | -| storage_tsdb_retention_time | 默认保存数据天数 默认15天 | 非必填 | -| storage_tsdb_retention_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | +| 参数 | 说明 | 是否必填 | +|--------------------------------|------------------|-----------------------| +| prometheus_dir\_name | prometheus 解压目录名称 | 非必填默认prometheus_iotdb | +| host | prometheus 部署的服务器ip | 必填 | +| prometheus\_port | prometheus 部署机器的端口 | 非必填,默认9090 | +| deploy\_dir | prometheus 部署服务器目录 | 必填 | +| prometheus\_tar\_dir | prometheus 压缩包位置 | 必填 | +| storage\_tsdb\_retention\_time | 默认保存数据天数 默认15天 | 非必填 | +| storage\_tsdb\_retention\_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | 如果在config/xxx.yaml的`iotdb-datanode.properties`和`iotdb-confignode.properties`中配置了metrics,则会自动把配置放入到promethues无需手动修改 @@ -224,8 +224,8 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" `dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`、`logs`和`ext`目录。 * 首先执行停止集群命令、然后在执行集群清理命令。 ```bash -iotd cluster stop default_cluster -iotd cluster clean default_cluster +iotdbctl cluster stop default_cluster +iotdbctl cluster clean default_cluster ``` #### 集群销毁场景 @@ -237,8 +237,8 @@ iotd cluster clean default_cluster ```bash -iotd cluster stop default_cluster -iotd cluster destroy default_cluster +iotdbctl cluster stop default_cluster +iotdbctl cluster destroy default_cluster ``` #### 集群升级场景 @@ -248,8 +248,8 @@ iotd cluster destroy default_cluster * 执行上传命令、然后执行重启IoTDB集群命令即可完成集群升级 ```bash -iotd cluster upgrade default_cluster -iotd cluster restart default_cluster +iotdbctl cluster upgrade default_cluster +iotdbctl cluster restart default_cluster ``` #### 集群配置文件的热部署场景 @@ -258,8 +258,8 @@ iotd cluster restart default_cluster * 执行分发命令、然后执行热部署命令即可完成集群配置的热部署 ```bash -iotd cluster distribute default_cluster -iotd cluster reload default_cluster +iotdbctl cluster distribute default_cluster +iotdbctl cluster reload default_cluster ``` #### 集群扩容场景 @@ -267,7 +267,7 @@ iotd cluster reload default_cluster * 首先修改在config/xxx.yaml中添加一个datanode 或者confignode 节点。 * 执行集群扩容命令 ```bash -iotd cluster scaleout default_cluster +iotdbctl cluster scaleout default_cluster ``` #### 集群缩容场景 @@ -275,7 +275,7 @@ iotd cluster scaleout default_cluster * 首先在config/xxx.yaml中找到要缩容的节点名字或者ip+port(其中confignode port 是cn_internal_port、datanode port 是rpc_port) * 执行集群缩容命令 ```bash -iotd cluster scalein default_cluster +iotdbctl cluster scalein default_cluster ``` #### 已有IoTDB集群,使用集群部署工具场景 @@ -285,14 +285,14 @@ iotd cluster scalein default_cluster 例如IoTDB 部署完整路径是`/home/data/apache-iotdb-1.1.1`则需要修改yaml文件`deploy_dir:/home/data/`、`iotdb_dir_name:apache-iotdb-1.1.1` * 如果服务器不是使用的java_home则修改`jdk_deploy_dir`(jdk 部署目录)、`jdk_dir_name`(jdk解压后的目录名称,默认是jdk_iotdb),如果使用的是java_home 则不需要修改配置 例如jdk部署完整路径是`/home/data/jdk_1.8.2`则需要修改yaml文件`jdk_deploy_dir:/home/data/`、`jdk_dir_name:jdk_1.8.2` -* 配置`cn_target_config_node_list`、`dn_target_config_node_list` +* 配置`cn_seed_config_node`、`dn_seed_config_node` * 配置`confignode_servers`中`iotdb-confignode.properties`里面的`cn_internal_address`、`cn_internal_port`、`cn_consensus_port`、`cn_system_dir`、 `cn_consensus_dir`和`iotdb-common.properties`里面的值不是IoTDB默认的则需要配置否则可不必配置 * 配置`datanode_servers`中`iotdb-datanode.properties`里面的`dn_rpc_address`、`dn_internal_address`、`dn_data_dirs`、`dn_consensus_dir`、`dn_system_dir`和`iotdb-common.properties`等 * 执行初始化命令 ```bash -iotd cluster init default_cluster +iotdbctl cluster init default_cluster ``` #### 一键部署IoTDB、Grafana和Prometheus 场景 @@ -303,7 +303,7 @@ iotd cluster init default_cluster * 启动集群 ```bash -iotd cluster start default_cluster +iotdbctl cluster start default_cluster ``` 更加详细参数请参考上方的 集群配置文件介绍 @@ -313,18 +313,18 @@ iotd cluster start default_cluster 本工具的基本用法为: ```bash -iotd cluster [params (Optional)] +iotdbctl cluster [params (Optional)] ``` * key 表示了具体的命令。 -* cluster name 表示集群名称(即`iotd/config` 文件中yaml文件名字)。 +* cluster name 表示集群名称(即`iotdbctl/config` 文件中yaml文件名字)。 * params 表示了命令的所需参数(选填)。 * 例如部署default_cluster集群的命令格式为: ```bash -iotd cluster deploy default_cluster +iotdbctl cluster deploy default_cluster ``` * 集群的功能及参数列表如下: @@ -349,7 +349,7 @@ iotd cluster deploy default_cluster | upgrade | lib 包升级 | 集群名字(升级完后请重启) | | init | 已有集群使用集群部署工具时,初始化集群配置 | 集群名字,初始化集群配置 | | status | 查看进程状态 | 集群名字 | - +| acitvate | 激活集群 | 集群名字 | ### 详细命令执行过程 下面的命令都是以default_cluster.yaml 为示例执行的,用户可以修改成自己的集群文件来执行 @@ -357,7 +357,7 @@ iotd cluster deploy default_cluster #### 检查集群部署环境命令 ```bash -iotd cluster check default_cluster +iotdbctl cluster check default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -374,7 +374,7 @@ iotd cluster check default_cluster #### 部署集群命令 ```bash -iotd cluster deploy default_cluster +iotdbctl cluster deploy default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -384,24 +384,24 @@ iotd cluster deploy default_cluster * 根据yaml文件节点配置信息生成并上传`iotdb-common.properties`、`iotdb-confignode.properties`、`iotdb-datanode.properties` ```bash -iotd cluster deploy default_cluster -op force +iotdbctl cluster deploy default_cluster -op force ``` 注意:该命令会强制执行部署,具体过程会删除已存在的部署目录重新部署 *部署单个模块* ```bash # 部署grafana模块 -iotd cluster deploy default_cluster -N grafana +iotdbctl cluster deploy default_cluster -N grafana # 部署prometheus模块 -iotd cluster deploy default_cluster -N prometheus +iotdbctl cluster deploy default_cluster -N prometheus # 部署iotdb模块 -iotd cluster deploy default_cluster -N iotdb +iotdbctl cluster deploy default_cluster -N iotdb ``` #### 启动集群命令 ```bash -iotd cluster start default_cluster +iotdbctl cluster start default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -416,13 +416,13 @@ iotd cluster start default_cluster *启动单个节点命令* ```bash #按照IoTDB 节点名称启动 -iotd cluster start default_cluster -N datanode_1 +iotdbctl cluster start default_cluster -N datanode_1 #按照IoTDB 集群ip+port启动,其中port对应confignode的cn_internal_port、datanode的rpc_port -iotd cluster start default_cluster -N 192.168.1.5:6667 +iotdbctl cluster start default_cluster -N 192.168.1.5:6667 #启动grafana -iotd cluster start default_cluster -N grafana +iotdbctl cluster start default_cluster -N grafana #启动prometheus -iotd cluster start default_cluster -N prometheus +iotdbctl cluster start default_cluster -N prometheus ``` * 根据 cluster-name 找到默认位置的 yaml 文件 @@ -433,15 +433,15 @@ iotd cluster start default_cluster -N prometheus * 启动该节点 说明:由于集群部署工具仅是调用了IoTDB集群中的start-confignode.sh和start-datanode.sh 脚本, -在实际输出结果失败时有可能是集群还未正常启动,建议使用status命令进行查看当前集群状态(iotd cluster status xxx) +在实际输出结果失败时有可能是集群还未正常启动,建议使用status命令进行查看当前集群状态(iotdbctl cluster status xxx) #### 查看IoTDB集群状态命令 ```bash -iotd cluster show default_cluster +iotdbctl cluster show default_cluster #查看IoTDB集群详细信息 -iotd cluster show default_cluster details +iotdbctl cluster show default_cluster details ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -452,7 +452,7 @@ iotd cluster show default_cluster details ```bash -iotd cluster stop default_cluster +iotdbctl cluster stop default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -463,7 +463,7 @@ iotd cluster stop default_cluster *强制停止集群命令* ```bash -iotd cluster stop default_cluster -op force +iotdbctl cluster stop default_cluster -op force ``` 会直接执行kill -9 pid 命令强制停止集群 @@ -471,13 +471,13 @@ iotd cluster stop default_cluster -op force ```bash #按照IoTDB 节点名称停止 -iotd cluster stop default_cluster -N datanode_1 +iotdbctl cluster stop default_cluster -N datanode_1 #按照IoTDB 集群ip+port停止(ip+port是按照datanode中的ip+dn_rpc_port获取唯一节点或confignode中的ip+cn_internal_port获取唯一节点) -iotd cluster stop default_cluster -N 192.168.1.5:6667 +iotdbctl cluster stop default_cluster -N 192.168.1.5:6667 #停止grafana -iotd cluster stop default_cluster -N grafana +iotdbctl cluster stop default_cluster -N grafana #停止prometheus -iotd cluster stop default_cluster -N prometheus +iotdbctl cluster stop default_cluster -N prometheus ``` * 根据 cluster-name 找到默认位置的 yaml 文件 @@ -493,7 +493,7 @@ iotd cluster stop default_cluster -N prometheus #### 清理集群数据命令 ```bash -iotd cluster clean default_cluster +iotdbctl cluster clean default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`配置信息 @@ -509,7 +509,7 @@ iotd cluster clean default_cluster #### 重启集群命令 ```bash -iotd cluster restart default_cluster +iotdbctl cluster restart default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 @@ -518,7 +518,7 @@ iotd cluster restart default_cluster *强制重启集群命令* ```bash -iotd cluster restart default_cluster -op force +iotdbctl cluster restart default_cluster -op force ``` 会直接执行kill -9 pid 命令强制停止集群,然后启动集群 @@ -526,22 +526,22 @@ iotd cluster restart default_cluster -op force ```bash #按照IoTDB 节点名称重启datanode_1 -iotd cluster restart default_cluster -N datanode_1 +iotdbctl cluster restart default_cluster -N datanode_1 #按照IoTDB 节点名称重启confignode_1 -iotd cluster restart default_cluster -N confignode_1 +iotdbctl cluster restart default_cluster -N confignode_1 #重启grafana -iotd cluster restart default_cluster -N grafana +iotdbctl cluster restart default_cluster -N grafana #重启prometheus -iotd cluster restart default_cluster -N prometheus +iotdbctl cluster restart default_cluster -N prometheus ``` #### 集群缩容命令 ```bash #按照节点名称缩容 -iotd cluster scalein default_cluster -N nodename +iotdbctl cluster scalein default_cluster -N nodename #按照ip+port缩容(ip+port按照datanode中的ip+dn_rpc_port获取唯一节点,confignode中的ip+cn_internal_port获取唯一节点) -iotd cluster scalein default_cluster -N ip:port +iotdbctl cluster scalein default_cluster -N ip:port ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -556,7 +556,7 @@ iotd cluster scalein default_cluster -N ip:port #### 集群扩容命令 ```bash -iotd cluster scaleout default_cluster +iotdbctl cluster scaleout default_cluster ``` * 修改config/xxx.yaml 文件添加一个datanode 节点或者confignode节点 @@ -572,7 +572,7 @@ iotd cluster scaleout default_cluster #### 销毁集群命令 ```bash -iotd cluster destroy default_cluster +iotdbctl cluster destroy default_cluster ``` * cluster-name 找到默认位置的 yaml 文件 @@ -587,16 +587,16 @@ iotd cluster destroy default_cluster *销毁单个模块* ```bash # 销毁grafana模块 -iotd cluster destroy default_cluster -N grafana +iotdbctl cluster destroy default_cluster -N grafana # 销毁prometheus模块 -iotd cluster destroy default_cluster -N prometheus +iotdbctl cluster destroy default_cluster -N prometheus # 销毁iotdb模块 -iotd cluster destroy default_cluster -N iotdb +iotdbctl cluster destroy default_cluster -N iotdb ``` #### 分发集群配置命令 ```bash -iotd cluster distribute default_cluster +iotdbctl cluster distribute default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 @@ -605,7 +605,7 @@ iotd cluster distribute default_cluster #### 热加载集群配置命令 ```bash -iotd cluster reload default_cluster +iotdbctl cluster reload default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -613,11 +613,11 @@ iotd cluster reload default_cluster #### 集群节点日志备份 ```bash -iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' +iotdbctl cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/logs' -logs '/root/data/db/iotdb/logs' ``` * 根据 cluster-name 找到默认位置的 yaml 文件 -* 该命令会根据yaml文件校验datanode_1,confignode_1 是否存在,然后根据配置的起止日期(startdate<=logtime<=enddate)备份指定节点datanode_1,confignode_1 的日志数据到指定服务`192.168.9.48` 端口`36000` 数据备份路径是 `/iotdb/logs` ,IoTDB日志存储路径在`/root/data/db/iotdb/logs`(非必填,如果不填写-logs xxx 默认从IoTDB安装路径/logs下面备份日志) +* 该命令会根据yaml文件校验datanode_1,confignode_1 是否存在,然后根据配置的起止日期(startdate<=logtime<=enddate)备份指定节点datanode_1,confignode_1 的日志数据到指定服务`192.168.9.48` 端口`36000` 数据备份路径是 `/iotdb/logs` ,IoTDB日志存储路径在`/root/data/db/iotdb/logs`(非必填,如果不填写-logs xxx 默认从IoTDB安装路径/logs下面备份日志) | 命令 | 功能 | 是否必填 | |------------|------------------------------------| ---| @@ -635,9 +635,9 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 #### 集群节点数据备份 ```bash -iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' +iotdbctl cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' ``` -* 该命令会根据yaml文件获取leader 节点,然后根据起止日期(startdate<=logtime<=enddate)备份数据到192.168.9.48 服务上的/iotdb/datas 目录下 +* 该命令会根据yaml文件获取leader 节点,然后根据起止日期(startdate<=logtime<=enddate)备份数据到192.168.9.48 服务上的/iotdb/datas 目录下 | 命令 | 功能 | 是否必填 | | ---|---------------------------------| ---| @@ -653,7 +653,7 @@ iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-0 #### 集群升级 ```bash -iotd cluster upgrade default_cluster +iotdbctl cluster upgrade default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`和`datanode_servers`配置信息 @@ -663,26 +663,76 @@ iotd cluster upgrade default_cluster #### 集群初始化 ```bash -iotd cluster init default_cluster +iotdbctl cluster init default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 * 初始化集群配置 #### 查看集群进程状态 ```bash -iotd cluster status default_cluster +iotdbctl cluster status default_cluster ``` * 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`、`datanode_servers`、`grafana`、`prometheus`配置信息 * 展示集群的存活状态 +#### 集群授权激活 + +集群激活默认是通过输入激活码激活,也可以通过-op license_path 通过license路径激活 + +* 默认激活方式 +```bash +iotdbctl cluster activate default_cluster +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`配置信息 +* 读取里面的机器码 +* 等待输入激活码 + +```bash +Machine code: +Kt8NfGP73FbM8g4Vty+V9qU5lgLvwqHEF3KbLN/SGWYCJ61eFRKtqy7RS/jw03lHXt4MwdidrZJ== +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKgGXEGzMms25+u== +Please enter the activation code: +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKg=,lTF1Dur1AElXIi/5jPV9h0XCm8ziPd9/R+tMYLsze1oAPxE87+Nwws= +Activation successful +``` +* 激活单个节点 + +```bash +iotdbctl cluster activate default_cluster -N confignode1 +``` + +* 通过license路径方式激活 + +```bash +iotdbctl cluster activate default_cluster -op license_path +``` +* 根据 cluster-name 找到默认位置的 yaml 文件,获取`confignode_servers`配置信息 +* 读取里面的机器码 +* 等待输入激活码 + +```bash +Machine code: +Kt8NfGP73FbM8g4Vty+V9qU5lgLvwqHEF3KbLN/SGWYCJ61eFRKtqy7RS/jw03lHXt4MwdidrZJ== +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKgGXEGzMms25+u== +Please enter the activation code: +JHQpXu97IKwv3rzbaDwoPLUuzNCm5aEeC9ZEBW8ndKg=,lTF1Dur1AElXIi/5jPV9h0XCm8ziPd9/R+tMYLsze1oAPxE87+Nwws= +Activation successful +``` +* 激活单个节点 + +```bash +iotdbctl cluster activate default_cluster -N confignode1 -op license_path +``` + + ### 集群部署工具样例介绍 在集群部署工具安装目录中config/example 下面有3个yaml样例,如果需要可以复制到config 中进行修改即可 -| 名称 | 说明 | -|-------------------|------------------------------------------------| -| default_1c1d.yaml | 1个confignode和1个datanode 配置样例 | -| default_3c3d.yaml | 3个confignode和3个datanode 配置样例 | -| default_3c3d_grafa_prome | 3个confignode和3个datanode、Grafana、Prometheus配置样例 | +| 名称 | 说明 | +|-----------------------------|------------------------------------------------| +| default\_1c1d.yaml | 1个confignode和1个datanode 配置样例 | +| default\_3c3d.yaml | 3个confignode和3个datanode 配置样例 | +| default\_3c3d\_grafa\_prome | 3个confignode和3个datanode、Grafana、Prometheus配置样例 | ## 手动部署 @@ -795,7 +845,7 @@ mvn clean package -pl distribution -am -DskipTests | cn\_internal\_address | ConfigNode 在集群内部通讯使用的地址 | 127.0.0.1 | 设置为服务器的 IPV4 地址或域名 | | cn\_internal\_port | ConfigNode 在集群内部通讯使用的端口 | 10710 | 设置为任意未占用端口 | | cn\_consensus\_port | ConfigNode 副本组共识协议通信使用的端口 | 10720 | 设置为任意未占用端口 | -| cn\_target\_config\_node\_list | 节点注册加入集群时连接的 ConfigNode 的地址。注:只能配置一个 | 127.0.0.1:10710 | 对于 Seed-ConfigNode,设置为自己的 cn\_internal\_address:cn\_internal\_port;对于其它 ConfigNode,设置为另一个正在运行的 ConfigNode 的 cn\_internal\_address:cn\_internal\_port | +| cn\_seed\_config\_node | 节点注册加入集群时连接的 ConfigNode 的地址。注:只能配置一个 | 127.0.0.1:10710 | 对于 Seed-ConfigNode,设置为自己的 cn\_internal\_address:cn\_internal\_port;对于其它 ConfigNode,设置为另一个正在运行的 ConfigNode 的 cn\_internal\_address:cn\_internal\_port | **注意:上述配置项在节点启动后即不可更改,且务必保证所有端口均未被占用,否则节点无法启动。** @@ -803,8 +853,8 @@ mvn clean package -pl distribution -am -DskipTests 打开 DataNode 配置文件 ./conf/iotdb-datanode.properties,根据服务器/虚拟机的 IP 地址和可用端口,设置以下参数: -| **配置项** | **说明** | **默认** | **用法** | -| ----------------------------------- | ----------------------------------------- | --------------- | ------------------------------------------------------------ | +| **配置项** | **说明** | **默认** | **用法** | +|-------------------------------------| ----------------------------------------- | --------------- | ------------------------------------------------------------ | | dn\_rpc\_address | 客户端 RPC 服务的地址 | 127.0.0.1 | 设置为服务器的 IPV4 地址或域名 | | dn\_rpc\_port | 客户端 RPC 服务的端口 | 6667 | 设置为任意未占用端口 | | dn\_internal\_address | DataNode 在集群内部接收控制流使用的地址 | 127.0.0.1 | 设置为服务器的 IPV4 地址或域名 | @@ -812,7 +862,7 @@ mvn clean package -pl distribution -am -DskipTests | dn\_mpp\_data\_exchange\_port | DataNode 在集群内部接收数据流使用的端口 | 10740 | 设置为任意未占用端口 | | dn\_data\_region\_consensus\_port | DataNode 的数据副本间共识协议通信的端口 | 10750 | 设置为任意未占用端口 | | dn\_schema\_region\_consensus\_port | DataNode 的元数据副本间共识协议通信的端口 | 10760 | 设置为任意未占用端口 | -| dn\_target\_config\_node\_list | 集群中正在运行的 ConfigNode 地址 | 127.0.0.1:10710 | 设置为任意正在运行的 ConfigNode 的 cn\_internal\_address:cn\_internal\_port,可设置多个,用逗号(",")隔开 | +| dn\_seed\_config\_node | 集群中正在运行的 ConfigNode 地址 | 127.0.0.1:10710 | 设置为任意正在运行的 ConfigNode 的 cn\_internal\_address:cn\_internal\_port,可设置多个,用逗号(",")隔开 | **注意:上述配置项在节点启动后即不可更改,且务必保证所有端口均未被占用,否则节点无法启动。** @@ -854,7 +904,7 @@ mvn clean package -pl distribution -am -DskipTests | cn\_internal\_address | 已设置为服务器的 IPV4 地址或域名 | | cn\_internal\_port | 该端口未被占用 | | cn\_consensus\_port | 该端口未被占用 | -| cn\_target\_config\_node\_list | 已设置为自己的内部通讯地址,即 cn\_internal\_address:cn\_internal\_port | +| cn\_seed\_config\_node | 已设置为自己的内部通讯地址,即 cn\_internal\_address:cn\_internal\_port | 检查完毕后,即可在服务器上运行启动脚本: @@ -897,7 +947,7 @@ ConfigNode 的其它配置参数可参考 | cn\_internal\_address | 已设置为服务器的 IPV4 地址或域名 | | cn\_internal\_port | 该端口未被占用 | | cn\_consensus\_port | 该端口未被占用 | -| cn\_target\_config\_node\_list | 已设置为另一个正在运行的 ConfigNode 的内部通讯地址,推荐使用 Seed-ConfigNode 的内部通讯地址 | +| cn\_seed\_config\_node | 已设置为另一个正在运行的 ConfigNode 的内部通讯地址,推荐使用 Seed-ConfigNode 的内部通讯地址 | 检查完毕后,即可在服务器上运行启动脚本: @@ -928,8 +978,8 @@ ConfigNode 的其它配置参数可参考 接着打开它的配置文件 ./conf/iotdb-datanode.properties 并检查以下参数: -| **配置项** | **检查** | -| ----------------------------------- | ------------------------------------------------------------ | +| **配置项** | **检查** | +|-------------------------------------| ------------------------------------------------------------ | | dn\_rpc\_address | 已设置为服务器的 IPV4 地址或域名 | | dn\_rpc\_port | 该端口未被占用 | | dn\_internal\_address | 已设置为服务器的 IPV4 地址或域名 | @@ -937,7 +987,7 @@ ConfigNode 的其它配置参数可参考 | dn\_mpp\_data\_exchange\_port | 该端口未被占用 | | dn\_data\_region\_consensus\_port | 该端口未被占用 | | dn\_schema\_region\_consensus\_port | 该端口未被占用 | -| dn\_target\_config\_node\_list | 已设置为正在运行的 ConfigNode 的内部通讯地址,推荐使用 Seed-ConfigNode 的内部通讯地址 | +| dn\_seed\_config\_node | 已设置为正在运行的 ConfigNode 的内部通讯地址,推荐使用 Seed-ConfigNode 的内部通讯地址 | 检查完毕后,即可在服务器上运行启动脚本: diff --git a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md index ed62e5b7..cccf0b95 100644 --- a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md +++ b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md @@ -229,18 +229,18 @@ IoTDB集群管理工具主要由config、logs、doc、sbin目录组成。 | 参数 | 说明 | 是否必填 | |----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| -| iotdb_zip_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | -| iotdb_download_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | -| jdk_tar_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | -| jdk_deploy_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | -| jdk_dir_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | -| iotdb_lib_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可。如果使用zip文件请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* | 非必填 | +| iotdb\_zip\_dir | IoTDB 部署分发目录,如果值为空则从`iotdb_download_url`指定地址下载 | 非必填 | +| iotdb\_download\_url | IoTDB 下载地址,如果`iotdb_zip_dir` 没有值则从指定地址下载 | 非必填 | +| jdk\_tar\_dir | jdk 本地目录,可使用该 jdk 路径进行上传部署至目标节点。 | 非必填 | +| jdk\_deploy\_dir | jdk 远程机器部署目录,会将 jdk 部署到该目录下面,与下面的`jdk_dir_name`参数构成完整的jdk部署目录即 `/` | 非必填 | +| jdk\_dir\_name | jdk 解压后的目录名称默认是jdk_iotdb | 非必填 | +| iotdb\_lib\_dir | IoTDB lib 目录或者IoTDB 的lib 压缩包仅支持.zip格式 ,仅用于IoTDB升级,默认处于注释状态,如需升级请打开注释修改路径即可。如果使用zip文件请使用zip 命令压缩iotdb/lib目录例如 zip -r lib.zip apache-iotdb-1.2.0/lib/* | 非必填 | | user | ssh登陆部署机器的用户名 | 必填 | | password | ssh登录的密码, 如果password未指定使用pkey登陆, 请确保已配置节点之间ssh登录免密钥 | 非必填 | | pkey | 密钥登陆如果password有值优先使用password否则使用pkey登陆 | 非必填 | -| ssh_port | ssh登录端口 | 必填 | -| deploy_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | -| iotdb_dir_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | +| ssh\_port | ssh登录端口 | 必填 | +| deploy\_dir | IoTDB 部署目录,会把 IoTDB 部署到该目录下面与下面的`iotdb_dir_name`参数构成完整的IoTDB 部署目录即 `/` | 必填 | +| iotdb\_dir\_name | IoTDB 解压后的目录名称默认是iotdb | 非必填 | | datanode-env.sh | 对应`iotdb/config/datanode-env.sh` ,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值 | 非必填 | | confignode-env.sh | 对应`iotdb/config/confignode-env.sh`,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值 | 非必填 | | iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties` | 非必填 | @@ -256,54 +256,54 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:MaxGCPauseMillis=200" * confignode_servers 是部署IoTDB Confignodes配置,里面可以配置多个Confignode 默认将第一个启动的ConfigNode节点node1当作Seed-ConfigNode -| 参数 | 说明 | 是否必填 | -|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| -| name | Confignode 名称 | 必填 | -| deploy_dir | IoTDB config node 部署目录 | 必填| | -| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | -| cn_internal_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | -| cn_target_config_node_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | -| cn_internal_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | -| cn_consensus_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | -| cn_data_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | -| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode_servers中的值 | 非必填 | +| 参数 | 说明 | 是否必填 | +|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------| +| name | Confignode 名称 | 必填 | +| deploy_dir | IoTDB config node 部署目录 | 必填| | +| iotdb-confignode.properties | 对应`iotdb/config/iotdb-confignode.properties`更加详细请参看`iotdb-confignode.properties`文件说明 | 非必填 | +| cn\_internal\_address | 对应iotdb/内部通信地址,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_address` | 必填 | +| cn\_target\_config\_node\_list | 集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`confignode_servers`同时配置值时优先使用`confignode_servers`中的值,对应`iotdb/config/iotdb-confignode.properties`中的`cn_target_config_node_list` | 必填 | +| cn\_internal\_port | 内部通信端口,对应`iotdb/config/iotdb-confignode.properties`中的`cn_internal_port` | 必填 | +| cn\_consensus\_port | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_consensus_port` | 非必填 | +| cn\_data\_dir | 对应`iotdb/config/iotdb-confignode.properties`中的`cn_data_dir` | 必填 | +| iotdb-common.properties | 对应`iotdb/config/iotdb-common.properties`在`global`与`confignode_servers`同时配置值优先使用confignode_servers中的值 | 非必填 | * datanode_servers 是部署IoTDB Datanodes配置,里面可以配置多个Datanode -| 参数 | 说明 |是否必填| -| ---| --- |--- | -|name|Datanode 名称|必填| -|deploy_dir|IoTDB data node 部署目录|必填| -|iotdb-datanode.properties|对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明|非必填| -|dn_rpc_address|datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address`|必填| -|dn_internal_address|内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address`|必填| -|dn_target_config_node_list|集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list`|必填| -|dn_rpc_port|datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port`|必填| -|dn_internal_port|内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port`|必填| -|iotdb-common.properties|对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值|非必填| +| 参数 | 说明 |是否必填| +|--------------------------------| --- |--- | +| name |Datanode 名称|必填| +| deploy\_dir |IoTDB data node 部署目录|必填| +| iotdb-datanode.properties |对应`iotdb/config/iotdb-datanode.properties`更加详细请参看`iotdb-datanode.properties`文件说明|非必填| +| dn\_rpc\_address |datanode rpc 地址对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_address`|必填| +| dn\_internal\_address |内部通信地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_address`|必填| +| dn\_target\_config\_node\_list |集群配置地址指向存活的ConfigNode,默认指向confignode_x,在`global`与`datanode_servers`同时配置值时优先使用`datanode_servers`中的值,对应`iotdb/config/iotdb-datanode.properties`中的`dn_target_config_node_list`|必填| +| dn\_rpc\_port |datanode rpc端口地址,对应`iotdb/config/iotdb-datanode.properties`中的`dn_rpc_port`|必填| +| dn\_internal\_port |内部通信端口,对应`iotdb/config/iotdb-datanode.properties`中的`dn_internal_port`|必填| +| iotdb-common.properties |对应`iotdb/config/iotdb-common.properties`在`global`与`datanode_servers`同时配置值优先使用`datanode_servers`中的值|非必填| * grafana_server 是部署Grafana 相关配置 -| 参数 | 说明 | 是否必填 | -|------------------|------------------|-------------------| -| grafana_dir_name | grafana 解压目录名称 | 非必填默认grafana_iotdb | -| host | grafana 部署的服务器ip | 必填 | -| grafana_port | grafana 部署机器的端口 | 非必填,默认3000 | -| deploy_dir | grafana 部署服务器目录 | 必填 | -| grafana_tar_dir | grafana 压缩包位置 | 必填 | -| dashboards | dashboards 所在的位置 | 非必填,多个用逗号隔开 | +| 参数 | 说明 | 是否必填 | +|--------------------|------------------|-------------------| +| grafana\_dir\_name | grafana 解压目录名称 | 非必填默认grafana_iotdb | +| host | grafana 部署的服务器ip | 必填 | +| grafana\_port | grafana 部署机器的端口 | 非必填,默认3000 | +| deploy\_dir | grafana 部署服务器目录 | 必填 | +| grafana\_tar\_dir | grafana 压缩包位置 | 必填 | +| dashboards | dashboards 所在的位置 | 非必填,多个用逗号隔开 | * prometheus_server 是部署Prometheus 相关配置 -| 参数 | 说明 | 是否必填 | -|---------------------|------------------|-----------------------| -| prometheus_dir_name | prometheus 解压目录名称 | 非必填默认prometheus_iotdb | -| host | prometheus 部署的服务器ip | 必填 | -| prometheus_port | prometheus 部署机器的端口 | 非必填,默认9090 | -| deploy_dir | prometheus 部署服务器目录 | 必填 | -| prometheus_tar_dir | prometheus 压缩包位置 | 必填 | -| storage_tsdb_retention_time | 默认保存数据天数 默认15天 | 非必填 | -| storage_tsdb_retention_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | +| 参数 | 说明 | 是否必填 | +|--------------------------------|------------------|-----------------------| +| prometheus\_dir\_name | prometheus 解压目录名称 | 非必填默认prometheus_iotdb | +| host | prometheus 部署的服务器ip | 必填 | +| prometheus\_port | prometheus 部署机器的端口 | 非必填,默认9090 | +| deploy\_dir | prometheus 部署服务器目录 | 必填 | +| prometheus\_tar\_dir | prometheus 压缩包位置 | 必填 | +| storage\_tsdb\_retention\_time | 默认保存数据天数 默认15天 | 非必填 | +| storage\_tsdb\_retention\_size | 指定block可以保存的数据大小默认512M ,注意单位KB, MB, GB, TB, PB, EB | 非必填 | 如果在config/xxx.yaml的`iotdb-datanode.properties`和`iotdb-confignode.properties`中配置了metrics,则会自动把配置放入到promethues无需手动修改 @@ -710,7 +710,7 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 ``` * 根据 cluster-name 找到默认位置的 yaml 文件 -* 该命令会根据yaml文件校验datanode_1,confignode_1 是否存在,然后根据配置的起止日期(startdate<=logtime<=enddate)备份指定节点datanode_1,confignode_1 的日志数据到指定服务`192.168.9.48` 端口`36000` 数据备份路径是 `/iotdb/logs` ,IoTDB日志存储路径在`/root/data/db/iotdb/logs`(非必填,如果不填写-logs xxx 默认从IoTDB安装路径/logs下面备份日志) +* 该命令会根据yaml文件校验datanode_1,confignode_1 是否存在,然后根据配置的起止日期(startdate<=logtime<=enddate)备份指定节点datanode_1,confignode_1 的日志数据到指定服务`192.168.9.48` 端口`36000` 数据备份路径是 `/iotdb/logs` ,IoTDB日志存储路径在`/root/data/db/iotdb/logs`(非必填,如果不填写-logs xxx 默认从IoTDB安装路径/logs下面备份日志) | 命令 | 功能 | 是否必填 | |------------|------------------------------------| ---| @@ -730,7 +730,7 @@ iotd cluster dumplog default_cluster -N datanode_1,confignode_1 -startdate '202 ```bash iotd cluster dumpdata default_cluster -granularity partition -startdate '2023-04-11' -enddate '2023-04-26' -h 192.168.9.48 -p 36000 -u root -pw root -path '/iotdb/datas' ``` -* 该命令会根据yaml文件获取leader 节点,然后根据起止日期(startdate<=logtime<=enddate)备份数据到192.168.9.48 服务上的/iotdb/datas 目录下 +* 该命令会根据yaml文件获取leader 节点,然后根据起止日期(startdate<=logtime<=enddate)备份数据到192.168.9.48 服务上的/iotdb/datas 目录下 | 命令 | 功能 | 是否必填 | | ---|---------------------------------| ---| @@ -771,11 +771,11 @@ iotd cluster status default_cluster ### 集群部署工具样例介绍 在集群部署工具安装目录中config/example 下面有3个yaml样例,如果需要可以复制到config 中进行修改即可 -| 名称 | 说明 | -|-------------------|------------------------------------------------| -| default_1c1d.yaml | 1个confignode和1个datanode 配置样例 | -| default_3c3d.yaml | 3个confignode和3个datanode 配置样例 | -| default_3c3d_grafa_prome | 3个confignode和3个datanode、Grafana、Prometheus配置样例 | +| 名称 | 说明 | +|-----------------------------|------------------------------------------------| +| default\_1c1d.yaml | 1个confignode和1个datanode 配置样例 | +| default\_3c3d.yaml | 3个confignode和3个datanode 配置样例 | +| default\_3c3d\_grafa\_prome | 3个confignode和3个datanode、Grafana、Prometheus配置样例 | ## 集群版部署(手工部署)