提交 a0e76416 编写于 作者: D dingbo

Merge branch 'develop' into docs/dingbo/index-page-en

...@@ -19,7 +19,23 @@ CREATE DATABASE [IF NOT EXISTS] db_name [KEEP keep] [DAYS days] [UPDATE 1]; ...@@ -19,7 +19,23 @@ CREATE DATABASE [IF NOT EXISTS] db_name [KEEP keep] [DAYS days] [UPDATE 1];
4. 更多关于 UPDATE 参数的用法,请参考[FAQ](/train-faq/faq) 4. 更多关于 UPDATE 参数的用法,请参考[FAQ](/train-faq/faq)
3. 数据库名最大长度为 33; 3. 数据库名最大长度为 33;
4. 一条 SQL 语句的最大长度为 65480 个字符; 4. 一条 SQL 语句的最大长度为 65480 个字符;
5. 数据库还有更多与数据库相关的配置参数,如 cache, blocks, days, keep, minRows, maxRows, wal, fsync, update, cacheLast, replica, quorum, maxVgroupsPerDb, ctime, comp, prec, 具体细节请参见 [配置参数](/reference/config/) 章节。 5. 创建数据库时可用的参数有:
- cache: [Description](/reference/config/#cache)
- blocks: [Description](/reference/config/#blocks)
- days: [Description](/reference/config/#days)
- keep: [Description](/reference/config/#keep)
- minRows: [Description](/reference/config/#minrows)
- maxRows: [Description](/reference/config/#maxrows)
- wal: [Description](/reference/config/#wallevel)
- fsync: [Description](/reference/config/#fsync)
- update: [Description](/reference/config/#update)
- cacheLast: [Description](/reference/config/#cachelast)
- replica: [Description](/reference/config/#replica)
- quorum: [Description](/reference/config/#quorum)
- maxVgroupsPerDb: [Description](/reference/config/#maxvgroupsperdb)
- comp: [Description](/reference/config/#comp)
- precision: [Description](reference/config/#precision)
6. 请注意上面列出的所有参数都可以配置在配置文件 `taosd.cfg` 中作为创建数据库时使用的默认配置, `create database` 的参数中明确指定的会覆盖配置文件中的设置。
::: :::
......
...@@ -361,7 +361,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) ...@@ -361,7 +361,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
### 查询场景配置参数 ### 查询场景配置参数
查询场景下 `filetype` 必须设置为 `qeury`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) 查询场景下 `filetype` 必须设置为 `query`,该参数及其它通用参数详见[通用配置参数](#通用配置参数)
#### 执行指定查询语句的配置参数 #### 执行指定查询语句的配置参数
...@@ -400,7 +400,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) ...@@ -400,7 +400,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
- **threads** : 执行 SQL 的线程数,默认为 1。 - **threads** : 执行 SQL 的线程数,默认为 1。
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0。 - **interval** : 执行订阅的时间间隔,单位为秒,默认为 0。
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"。 - **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"。
...@@ -420,7 +420,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) ...@@ -420,7 +420,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
- **threads** : 执行 SQL 的线程数,默认为 1。 - **threads** : 执行 SQL 的线程数,默认为 1。
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0。 - **interval** : 执行订阅的时间间隔,单位为秒,默认为 0。
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"。 - **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"。
......
...@@ -12,7 +12,7 @@ TDengine 命令行程序(以下简称 TDengine CLI)是用户操作 TDengine ...@@ -12,7 +12,7 @@ TDengine 命令行程序(以下简称 TDengine CLI)是用户操作 TDengine
## 执行 ## 执行
要进入 TDengine CLI,您只要在 Linux 终端或Windos 终端执行 `taos` 即可。 要进入 TDengine CLI,您只要在 Linux 终端或Windows 终端执行 `taos` 即可。
```bash ```bash
taos taos
......
...@@ -38,7 +38,6 @@ taos --dump-config ...@@ -38,7 +38,6 @@ taos --dump-config
::: :::
:::note :::note
配置文件参数修改后,需要重启*taosd*服务,或客户端应用才能生效。 配置文件参数修改后,需要重启*taosd*服务,或客户端应用才能生效。
...@@ -49,7 +48,7 @@ taos --dump-config ...@@ -49,7 +48,7 @@ taos --dump-config
### firstEp ### firstEp
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ----------------------------------------------------- | | -------- | --------------------------------------------------------------- |
| 适用范围 | 服务端和客户端均适用 | | 适用范围 | 服务端和客户端均适用 |
| 含义 | taosd 或者 taos 启动时,主动连接的集群中首个 dnode 的 end point | | 含义 | taosd 或者 taos 启动时,主动连接的集群中首个 dnode 的 end point |
| 缺省值 | localhost:6030 | | 缺省值 | localhost:6030 |
...@@ -57,7 +56,7 @@ taos --dump-config ...@@ -57,7 +56,7 @@ taos --dump-config
### secondEp ### secondEp
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ---------------------------------------------------------------------------- | | -------- | -------------------------------------------------------------------------------------- |
| 适用范围 | 服务端和客户端均适用 | | 适用范围 | 服务端和客户端均适用 |
| 含义 | taosd 或者 taos 启动时,如果 firstEp 连接不上,尝试连接集群中第二个 dnode 的 end point | | 含义 | taosd 或者 taos 启动时,如果 firstEp 连接不上,尝试连接集群中第二个 dnode 的 end point |
| 缺省值 | 无 | | 缺省值 | 无 |
...@@ -74,11 +73,11 @@ taos --dump-config ...@@ -74,11 +73,11 @@ taos --dump-config
### serverPort ### serverPort
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------- | | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | taosd 启动后,对外服务的端口号 | | 含义 | taosd 启动后,对外服务的端口号 |
| 缺省值 | 6030 | | 缺省值 | 6030 |
| 补充说明 | RESTful 服务在2.4.0.0之前(不含)由taosd提供,默认端口为 6041; 在2.4.0.0 及后续版本由 taosAdapter,默认端口为6041 | | 补充说明 | RESTful 服务在 2.4.0.0 之前(不含)由 taosd 提供,默认端口为 6041; 在 2.4.0.0 及后续版本由 taosAdapter,默认端口为 6041 |
:::note :::note
对于端口,TDengine 会使用从 serverPort 起 13 个连续的 TCP 和 UDP 端口号,请务必在防火墙打开。因此如果是缺省配置,需要打开从 6030 到 6042 共 13 个端口,而且必须 TCP 和 UDP 都打开。(详细的端口情况请参见下表) 对于端口,TDengine 会使用从 serverPort 起 13 个连续的 TCP 和 UDP 端口号,请务必在防火墙打开。因此如果是缺省配置,需要打开从 6030 到 6042 共 13 个端口,而且必须 TCP 和 UDP 都打开。(详细的端口情况请参见下表)
...@@ -147,7 +146,6 @@ taos --dump-config ...@@ -147,7 +146,6 @@ taos --dump-config
| 取值范围 | 1-600 | | 取值范围 | 1-600 |
| 缺省值 | 30 | | 缺省值 | 30 |
### telemetryReporting ### telemetryReporting
| 属性 | 说明 | | 属性 | 说明 |
...@@ -172,7 +170,7 @@ taos --dump-config ...@@ -172,7 +170,7 @@ taos --dump-config
### ratioOfQueryCores ### ratioOfQueryCores
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 设置查询线程的最大数量。 | | 含义 | 设置查询线程的最大数量。 |
| 缺省值 | 1 | | 缺省值 | 1 |
...@@ -181,7 +179,7 @@ taos --dump-config ...@@ -181,7 +179,7 @@ taos --dump-config
### maxNumOfDistinctRes ### maxNumOfDistinctRes
| 属性 | 说明 | | 属性 | 说明 |
| -------- | -------------------------------- | | -------- | -------------------------------- | --- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 允许返回的 distinct 结果最大行数 | | 含义 | 允许返回的 distinct 结果最大行数 |
| 取值范围 | 默认值为 10 万,最大值 1 亿 | | 取值范围 | 默认值为 10 万,最大值 1 亿 |
...@@ -201,35 +199,35 @@ taos --dump-config ...@@ -201,35 +199,35 @@ taos --dump-config
:::info :::info
为应对多时区的数据写入和查询问题,TDengine 采用 Unix 时间戳(Unix Timestamp)来记录和存储时间戳。Unix 时间戳的特点决定了任一时刻不论在任何时区,产生的时间戳均一致。需要注意的是,Unix 时间戳是在客户端完成转换和记录。为了确保客户端其他形式的时间转换为正确的 Unix 时间戳,需要设置正确的时区。 为应对多时区的数据写入和查询问题,TDengine 采用 Unix 时间戳(Unix Timestamp)来记录和存储时间戳。Unix 时间戳的特点决定了任一时刻不论在任何时区,产生的时间戳均一致。需要注意的是,Unix 时间戳是在客户端完成转换和记录。为了确保客户端其他形式的时间转换为正确的 Unix 时间戳,需要设置正确的时区。
在 Linux 系统中,客户端会自动读取系统设置的时区信息。用户也可以采用多种方式在配置文件设置时区。例如: 在 Linux 系统中,客户端会自动读取系统设置的时区信息。用户也可以采用多种方式在配置文件设置时区。例如:
``` ```
timezone UTC-8 timezone UTC-8
timezone GMT-8 timezone GMT-8
timezone Asia/Shanghai timezone Asia/Shanghai
``` ```
均是合法的设置东八区时区的格式。但需注意,Windows 下并不支持 `timezone Asia/Shanghai` 这样的写法,而必须写成 `timezone UTC-8` 均是合法的设置东八区时区的格式。但需注意,Windows 下并不支持 `timezone Asia/Shanghai` 这样的写法,而必须写成 `timezone UTC-8`
时区的设置对于查询和写入 SQL 语句中非 Unix 时间戳的内容(时间戳字符串、关键词 now 的解析)产生影响。例如: 时区的设置对于查询和写入 SQL 语句中非 Unix 时间戳的内容(时间戳字符串、关键词 now 的解析)产生影响。例如:
```sql ```sql
SELECT count(*) FROM table_name WHERE TS<'2019-04-11 12:01:08'; SELECT count(*) FROM table_name WHERE TS<'2019-04-11 12:01:08';
``` ```
在东八区,SQL 语句等效于 在东八区,SQL 语句等效于
```sql ```sql
SELECT count(*) FROM table_name WHERE TS<1554955268000; SELECT count(*) FROM table_name WHERE TS<1554955268000;
``` ```
在 UTC 时区,SQL 语句等效于 在 UTC 时区,SQL 语句等效于
```sql ```sql
SELECT count(*) FROM table_name WHERE TS<1554984068000; SELECT count(*) FROM table_name WHERE TS<1554984068000;
``` ```
为了避免使用字符串时间格式带来的不确定性,也可以直接使用 Unix 时间戳。此外,还可以在 SQL 语句中使用带有时区的时间戳字符串,例如:RFC3339 格式的时间戳字符串,2013-04-12T15:52:01.123+08:00 或者 ISO-8601 格式时间戳字符串 2013-04-12T15:52:01.123+0800。上述两个字符串转化为 Unix 时间戳不受系统所在时区的影响。 为了避免使用字符串时间格式带来的不确定性,也可以直接使用 Unix 时间戳。此外,还可以在 SQL 语句中使用带有时区的时间戳字符串,例如:RFC3339 格式的时间戳字符串,2013-04-12T15:52:01.123+08:00 或者 ISO-8601 格式时间戳字符串 2013-04-12T15:52:01.123+0800。上述两个字符串转化为 Unix 时间戳不受系统所在时区的影响。
::: :::
...@@ -242,11 +240,11 @@ taos --dump-config ...@@ -242,11 +240,11 @@ taos --dump-config
| 缺省值 | 系统中动态获取,如果自动获取失败,需要用户在配置文件设置或通过 API 设置 | | 缺省值 | 系统中动态获取,如果自动获取失败,需要用户在配置文件设置或通过 API 设置 |
:::info :::info
TDengine 为存储中文、日文、韩文等非 ASCII 编码的宽字符,提供一种专门的字段类型 nchar。写入 nchar 字段的数据将统一采用 UCS4-LE 格式进行编码并发送到服务器。需要注意的是,编码正确性是客户端来保证。因此,如果用户想要正常使用 nchar 字段来存储诸如中文、日文、韩文等非 ASCII 字符,需要正确设置客户端的编码格式。 TDengine 为存储中文、日文、韩文等非 ASCII 编码的宽字符,提供一种专门的字段类型 nchar。写入 nchar 字段的数据将统一采用 UCS4-LE 格式进行编码并发送到服务器。需要注意的是,编码正确性是客户端来保证。因此,如果用户想要正常使用 nchar 字段来存储诸如中文、日文、韩文等非 ASCII 字符,需要正确设置客户端的编码格式。
客户端的输入的字符均采用操作系统当前默认的编码格式,在 Linux 系统上多为 UTF-8,部分中文系统编码则可能是 GB18030 或 GBK 等。在 docker 环境中默认的编码是 POSIX。在中文版 Windows 系统中,编码则是 CP936。客户端需要确保正确设置自己所使用的字符集,即客户端运行的操作系统当前编码字符集,才能保证 nchar 中的数据正确转换为 UCS4-LE 编码格式。 客户端的输入的字符均采用操作系统当前默认的编码格式,在 Linux 系统上多为 UTF-8,部分中文系统编码则可能是 GB18030 或 GBK 等。在 docker 环境中默认的编码是 POSIX。在中文版 Windows 系统中,编码则是 CP936。客户端需要确保正确设置自己所使用的字符集,即客户端运行的操作系统当前编码字符集,才能保证 nchar 中的数据正确转换为 UCS4-LE 编码格式。
在 Linux 中 locale 的命名规则为: <语言>\_<地区>.<字符集编码> 如:zh_CN.UTF-8,zh 代表中文,CN 代表大陆地区,UTF-8 表示字符集。字符集编码为客户端正确解析本地字符串提供编码转换的说明。Linux 系统与 Mac OSX 系统可以通过设置 locale 来确定系统的字符编码,由于 Windows 使用的 locale 中不是 POSIX 标准的 locale 格式,因此在 Windows 下需要采用另一个配置参数 charset 来指定字符编码。在 Linux 系统中也可以使用 charset 来指定字符编码。 在 Linux 中 locale 的命名规则为: <语言>\_<地区>.<字符集编码> 如:zh_CN.UTF-8,zh 代表中文,CN 代表大陆地区,UTF-8 表示字符集。字符集编码为客户端正确解析本地字符串提供编码转换的说明。Linux 系统与 Mac OSX 系统可以通过设置 locale 来确定系统的字符编码,由于 Windows 使用的 locale 中不是 POSIX 标准的 locale 格式,因此在 Windows 下需要采用另一个配置参数 charset 来指定字符编码。在 Linux 系统中也可以使用 charset 来指定字符编码。
::: :::
...@@ -261,35 +259,35 @@ taos --dump-config ...@@ -261,35 +259,35 @@ taos --dump-config
:::info :::info
如果配置文件中不设置 charset,在 Linux 系统中,taos 在启动时候,自动读取系统当前的 locale 信息,并从 locale 信息中解析提取 charset 编码格式。如果自动读取 locale 信息失败,则尝试读取 charset 配置,如果读取 charset 配置也失败,则中断启动过程。 如果配置文件中不设置 charset,在 Linux 系统中,taos 在启动时候,自动读取系统当前的 locale 信息,并从 locale 信息中解析提取 charset 编码格式。如果自动读取 locale 信息失败,则尝试读取 charset 配置,如果读取 charset 配置也失败,则中断启动过程。
在 Linux 系统中,locale 信息包含了字符编码信息,因此正确设置了 Linux 系统 locale 以后可以不用再单独设置 charset。例如: 在 Linux 系统中,locale 信息包含了字符编码信息,因此正确设置了 Linux 系统 locale 以后可以不用再单独设置 charset。例如:
``` ```
locale zh_CN.UTF-8 locale zh_CN.UTF-8
``` ```
在 Windows 系统中,无法从 locale 获取系统当前编码。如果无法从配置文件中读取字符串编码信息,taos 默认设置为字符编码为 CP936。其等效在配置文件中添加如下配置: 在 Windows 系统中,无法从 locale 获取系统当前编码。如果无法从配置文件中读取字符串编码信息,taos 默认设置为字符编码为 CP936。其等效在配置文件中添加如下配置:
``` ```
charset CP936 charset CP936
``` ```
如果需要调整字符编码,请查阅当前操作系统使用的编码,并在配置文件中正确设置。 如果需要调整字符编码,请查阅当前操作系统使用的编码,并在配置文件中正确设置。
在 Linux 系统中,如果用户同时设置了 locale 和字符集编码 charset,并且 locale 和 charset 的不一致,后设置的值将覆盖前面设置的值。 在 Linux 系统中,如果用户同时设置了 locale 和字符集编码 charset,并且 locale 和 charset 的不一致,后设置的值将覆盖前面设置的值。
``` ```
locale zh_CN.UTF-8 locale zh_CN.UTF-8
charset GBK charset GBK
``` ```
则 charset 的有效值是 GBK。 则 charset 的有效值是 GBK。
``` ```
charset GBK charset GBK
locale zh_CN.UTF-8 locale zh_CN.UTF-8
``` ```
charset 的有效值是 UTF-8。 charset 的有效值是 UTF-8。
::: :::
...@@ -391,7 +389,7 @@ taos --dump-config ...@@ -391,7 +389,7 @@ taos --dump-config
| 含义 | 是否在内存中缓存子表的最近数据 | | 含义 | 是否在内存中缓存子表的最近数据 |
| 取值范围 | 0:关闭 <br/> 1:缓存子表最近一行数据 <br/> 2:缓存子表每一列的最近的非 NULL 值 <br/> 3:同时打开缓存最近行和列功能。(2.1.2.0 版本开始此参数支持 0 ~ 3 的取值范围,在此之前取值只能是 [0, 1]) | | 取值范围 | 0:关闭 <br/> 1:缓存子表最近一行数据 <br/> 2:缓存子表每一列的最近的非 NULL 值 <br/> 3:同时打开缓存最近行和列功能。(2.1.2.0 版本开始此参数支持 0 ~ 3 的取值范围,在此之前取值只能是 [0, 1]) |
| 缺省值 | 0 | | 缺省值 | 0 |
| 补充说明 | 2.1.2.0 版本之前、2.0.20.7 版本之前在 taos.cfg 文件中不支持此参数。 | 补充说明 | 2.1.2.0 版本之前、2.0.20.7 版本之前在 taos.cfg 文件中不支持此参数。 |
### minimalTmpDirGB ### minimalTmpDirGB
...@@ -456,6 +454,7 @@ taos --dump-config ...@@ -456,6 +454,7 @@ taos --dump-config
| 含义 | dnode 的可选角色 | | 含义 | dnode 的可选角色 |
| 取值范围 | 0:any(既可作为 mnode,也可分配 vnode) <br/> 1:mgmt(只能作为 mnode,不能分配 vnode) <br/> 2:dnode(不能作为 mnode,只能分配 vnode) | | 取值范围 | 0:any(既可作为 mnode,也可分配 vnode) <br/> 1:mgmt(只能作为 mnode,不能分配 vnode) <br/> 2:dnode(不能作为 mnode,只能分配 vnode) |
| 缺省值 | 0 | | 缺省值 | 0 |
### balance ### balance
| 属性 | 说明 | | 属性 | 说明 |
...@@ -478,13 +477,22 @@ taos --dump-config ...@@ -478,13 +477,22 @@ taos --dump-config
### arbitrator ### arbitrator
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ------------------------ | | -------- | ------------------------------------------ |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 系统中裁决器的 end point,其格式如firstEp | | 含义 | 系统中裁决器的 end point,其格式如 firstEp |
| 缺省值 | 空 | | 缺省值 | 空 |
## 时间相关 ## 时间相关
### precision
| 属性 | 说明 |
| -------- | ------------------------------------------------- |
| 适用范围 | 仅服务端 |
| 含义 | 创建数据库时使用的时间精度 |
| 取值范围 | ms: millisecond; us: microsecond ; ns: nanosecond |
| 缺省值 | ms |
### rpcTimer ### rpcTimer
| 属性 | 说明 | | 属性 | 说明 |
...@@ -555,7 +563,6 @@ taos --dump-config ...@@ -555,7 +563,6 @@ taos --dump-config
| 取值范围 | 5-7200000 | | 取值范围 | 5-7200000 |
| 缺省值 | 86400\*10(10 天) | | 缺省值 | 86400\*10(10 天) |
## 性能调优 ## 性能调优
### numOfThreadsPerCore ### numOfThreadsPerCore
...@@ -604,7 +611,7 @@ taos --dump-config ...@@ -604,7 +611,7 @@ taos --dump-config
### tableIncStepPerVnode ### tableIncStepPerVnode
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ----------------------------------- | | -------- | ------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 每个 vnode 中超过最小表数,i.e. minTablesPerVnode, 后递增步长 | | 含义 | 每个 vnode 中超过最小表数,i.e. minTablesPerVnode, 后递增步长 |
| 缺省值 | 1000 | | 缺省值 | 1000 |
...@@ -617,11 +624,10 @@ taos --dump-config ...@@ -617,11 +624,10 @@ taos --dump-config
| 含义 | 支持超级表时间排序允许的最多记录数限制 | | 含义 | 支持超级表时间排序允许的最多记录数限制 |
| 缺省值 | 10 万 | | 缺省值 | 10 万 |
### mnodeEqualVnodeNum ### mnodeEqualVnodeNum
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ---------------------------------- | | -------- | ------------------------------------ |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 将一个 mnode 等同于 vnode 消耗的个数 | | 含义 | 将一个 mnode 等同于 vnode 消耗的个数 |
| 缺省值 | 4 | | 缺省值 | 4 |
...@@ -739,7 +745,7 @@ taos --dump-config ...@@ -739,7 +745,7 @@ taos --dump-config
### maxStreamCompDelay ### maxStreamCompDelay
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | -------- | -------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 连续查询启动最大延迟 | | 含义 | 连续查询启动最大延迟 |
| 单位 | 毫秒 | | 单位 | 毫秒 |
...@@ -769,7 +775,7 @@ taos --dump-config ...@@ -769,7 +775,7 @@ taos --dump-config
### streamCompDelayRatio ### streamCompDelayRatio
| 属性 | 说明 | | 属性 | 说明 |
| -------- | -------------------------- | | -------- | ---------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 连续查询的延迟时间计算系数,实际延迟时间为本参数乘以计算时间窗口 | | 含义 | 连续查询的延迟时间计算系数,实际延迟时间为本参数乘以计算时间窗口 |
| 取值范围 | 0.1-0.9 | | 取值范围 | 0.1-0.9 |
...@@ -783,8 +789,8 @@ taos --dump-config ...@@ -783,8 +789,8 @@ taos --dump-config
## HTTP 相关 ## HTTP 相关
:::note :::note
HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以后(含)由taosAdapter提供。 HTTP 服务在 2.4.0.0(不含)以前的版本中由 taosd 提供,在 2.4.0.0 以后(含)由 taosAdapter 提供。
本节的配置参数仅在2.4.0.0(不含)以前的版本中生效。如果您使用的是2.4.0.0(含)及以后的版本请参考[文档](/reference/taosadapter/) 本节的配置参数仅在 2.4.0.0(不含)以前的版本中生效。如果您使用的是 2.4.0.0(含)及以后的版本请参考[文档](/reference/taosadapter/)
::: :::
...@@ -800,7 +806,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以 ...@@ -800,7 +806,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
### httpEnableRecordSql ### httpEnableRecordSql
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------- | --------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 记录通过 RESTFul 接口,产生的 SQL 调用。 | | 含义 | 记录通过 RESTFul 接口,产生的 SQL 调用。 |
| 缺省值 | 0 | | 缺省值 | 0 |
...@@ -809,7 +815,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以 ...@@ -809,7 +815,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
### httpMaxThreads ### httpMaxThreads
| 属性 | 说明 | | 属性 | 说明 |
| -------- | --------------------------------------------------------------------------------------------------------------------------- | | -------- | ------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | RESTFul 接口的线程数。taosAdapter 配置或有不同,请参考相应[文档](/reference/taosadapter/)。 | | 含义 | RESTFul 接口的线程数。taosAdapter 配置或有不同,请参考相应[文档](/reference/taosadapter/)。 |
| 缺省值 | 2 | | 缺省值 | 2 |
...@@ -817,7 +823,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以 ...@@ -817,7 +823,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
### restfulRowLimit ### restfulRowLimit
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | -------- | ----------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | RESTFul 接口单次返回的记录条数。taosAdapter 配置或有不同,请参考相应[文档](/reference/taosadapter/)。 | | 含义 | RESTFul 接口单次返回的记录条数。taosAdapter 配置或有不同,请参考相应[文档](/reference/taosadapter/)。 |
| 缺省值 | 10240 | | 缺省值 | 10240 |
...@@ -852,7 +858,6 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以 ...@@ -852,7 +858,6 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
| 单位 | GB | | 单位 | GB |
| 缺省值 | 1.0 | | 缺省值 | 1.0 |
### numOfLogLines ### numOfLogLines
| 属性 | 说明 | | 属性 | 说明 |
...@@ -1075,7 +1080,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以 ...@@ -1075,7 +1080,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
### maxBinaryDisplayWidth ### maxBinaryDisplayWidth
| 属性 | 说明 | | 属性 | 说明 |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------- | -------------------------------------------------------------------------- |
| 含义 | Taos shell 中 binary 和 nchar 字段的显示宽度上限,超过此限制的部分将被隐藏 | | 含义 | Taos shell 中 binary 和 nchar 字段的显示宽度上限,超过此限制的部分将被隐藏 |
| 取值范围 | 5 - | | 取值范围 | 5 - |
| 缺省值 | 30 | | 缺省值 | 30 |
......
--- ---
sidebar_label: Connect sidebar_label: Connection
title: Connect to TDengine title: Connect to TDengine
description: "This document explains how to establish connection to TDengine, and briefly introduce how to install and use TDengine connectors." description: "This document explains how to establish connection to TDengine, and briefly introduce how to install and use TDengine connectors."
--- ---
......
--- ---
sidebar_label: Data Model
slug: /model slug: /model
title: Data Model title: Data Model
--- ---
......
label: Insert label: Insert Data
\ No newline at end of file
...@@ -19,7 +19,23 @@ CREATE DATABASE [IF NOT EXISTS] db_name [KEEP keep] [DAYS days] [UPDATE 1]; ...@@ -19,7 +19,23 @@ CREATE DATABASE [IF NOT EXISTS] db_name [KEEP keep] [DAYS days] [UPDATE 1];
3. UPDATE set to 2 means updating a part of columns for a row is allowed, the columns for which no value is specified will be kept as no change 3. UPDATE set to 2 means updating a part of columns for a row is allowed, the columns for which no value is specified will be kept as no change
3. The maximum length of database name is 33 bytes. 3. The maximum length of database name is 33 bytes.
4. The maximum length of a SQL statement is 65,480 bytes. 4. The maximum length of a SQL statement is 65,480 bytes.
5. For more parameters that can be used when creating a database, like cache, blocks, days, keep, minRows, maxRows, wal, fsync, update, cacheLast, replica, quorum, maxVgroupsPerDb, ctime, comp, prec, Please refer to [Configuration Parameters](/reference/config/). 5. Below are the parameters that can be used when creating a database
- cache: [Description](/reference/config/#cache)
- blocks: [Description](/reference/config/#blocks)
- days: [Description](/reference/config/#days)
- keep: [Description](/reference/config/#keep)
- minRows: [Description](/reference/config/#minrows)
- maxRows: [Description](/reference/config/#maxrows)
- wal: [Description](/reference/config/#wallevel)
- fsync: [Description](/reference/config/#fsync)
- update: [Description](/reference/config/#update)
- cacheLast: [Description](/reference/config/#cachelast)
- replica: [Description](/reference/config/#replica)
- quorum: [Description](/reference/config/#quorum)
- maxVgroupsPerDb: [Description](/reference/config/#maxvgroupsperdb)
- comp: [Description](/reference/config/#comp)
- precision: [Description](reference/config/#precision)
6. Please be noted that all of the parameters mentioned in this section can be configured in configuration file `taosd.cfg` at server side and used by default, can be override if they are specifically in `create database` statement.
::: :::
......
--- ---
sidebar_label: Insert
title: Insert title: Insert
--- ---
......
--- ---
sidebar_label: Select
title: Select title: Select
--- ---
......
--- ---
sidebar_label: Functions
title: Functions title: Functions
--- ---
......
--- ---
sidebar_label: Window sidebar_label: Interval
title: Aggregate by Window title: Aggregate by Time Window
--- ---
Aggregate by time window is supported in TDengine. For example, each temperature sensor reports the temperature every second, the average temperature every 10 minutes can be retrieved by query with time window. Aggregate by time window is supported in TDengine. For example, each temperature sensor reports the temperature every second, the average temperature every 10 minutes can be retrieved by query with time window.
......
--- ---
sidebar_label: Limits title: Limits & Restrictions
title: Limits and Restrictions
--- ---
## Naming Rules ## Naming Rules
......
--- ---
sidebar_label: JSON
title: JSON Type title: JSON Type
--- ---
......
--- ---
sidebar-label: Escape title: Escape Characters
title: Escape
--- ---
## Escape Characters Below table is the list of escape characters used in TDengine.
| Escape Character | **Actual Meaning** | | Escape Character | **Actual Meaning** |
| :--------------: | ------------------------ | | :--------------: | ------------------------ |
......
--- ---
sidebar_label: Keywords title: Keywords
title: Reserved Keywords
--- ---
## Reserved Keywords
There are about 200 keywords reserved by TDengine, they can't be used as the name of database, STable or table with either upper case, lower case or mixed case. There are about 200 keywords reserved by TDengine, they can't be used as the name of database, STable or table with either upper case, lower case or mixed case.
**Keywords List** **Keywords List**
......
--- ---
sidebar_label: Tolerance sidebar_label: Fault Tolerance
title: Fault Tolerance and Disaster Recovery title: Fault Tolerance & Disaster Recovery
--- ---
## Fault Tolerance ## Fault Tolerance
......
--- ---
sidebar_label: Import
title: Import Data title: Import Data
--- ---
......
--- ---
sidebar_label: Export
title: Export Data title: Export Data
--- ---
......
--- ---
sidebar_label: Monitor
title: Monitor TDengine title: Monitor TDengine
--- ---
......
--- ---
sidebar_label: Optimize
title: Optimize Performance title: Optimize Performance
--- ---
......
--- ---
sidebar_label: Diagnose
title: Diagnose Problems title: Diagnose Problems
--- ---
## Diagnose Network Connection ## Network Connection Diagnostics
When the client is unable to access the server, the network connection between the client side and the server side needs to be checked to find out the root cause and resolve problems. When the client is unable to access the server, the network connection between the client side and the server side needs to be checked to find out the root cause and resolve problems.
......
--- ---
title: "taosAdapter" title: "taosAdapter"
description: "taosAdapter 是一个 TDengine 的配套工具,是 TDengine 集群和应用程序之间的桥梁和适配器。它提供了一种易于使用和高效的方式来直接从数据收集代理软件(如 Telegraf、StatsD、collectd 等)摄取数据。它还提供了 InfluxDB/OpenTSDB 兼容的数据摄取接口,允许 InfluxDB/OpenTSDB 应用程序无缝移植到 TDengine" description: "taosAdapter is a TDengine companion tool that acts as a bridge and adapter between TDengine clusters and applications. It provides an easy-to-use and efficient way to ingest data directly from data collection agent software such as Telegraf, StatsD, collectd, etc. It also provides an InfluxDB/OpenTSDB compatible data ingestion interface, allowing InfluxDB/OpenTSDB applications to be seamlessly ported to TDengine."
sidebar_label: "taosAdapter" sidebar_label: "taosAdapter"
--- ---
...@@ -10,46 +10,46 @@ import StatsD from "./_statsd.mdx" ...@@ -10,46 +10,46 @@ import StatsD from "./_statsd.mdx"
import Icinga2 from "./_icinga2.mdx" import Icinga2 from "./_icinga2.mdx"
import Tcollector from "./_tcollector.mdx" import Tcollector from "./_tcollector.mdx"
taosAdapter 是一个 TDengine 的配套工具,是 TDengine 集群和应用程序之间的桥梁和适配器。它提供了一种易于使用和高效的方式来直接从数据收集代理软件(如 Telegraf、StatsD、collectd 等)摄取数据。它还提供了 InfluxDB/OpenTSDB 兼容的数据摄取接口,允许 InfluxDB/OpenTSDB 应用程序无缝移植到 TDengine。 taosAdapter is a TDengine companion tool that acts as a bridge and adapter between TDengine clusters and applications. It provides an easy-to-use and efficient way to ingest data directly from data collection agent software such as Telegraf, StatsD, collectd, etc. It also provides an InfluxDB/OpenTSDB compatible data ingestion interface that allows InfluxDB/OpenTSDB applications to be seamlessly ported to TDengine.
taosAdapter 提供以下功能: taosAdapter provides the following features.
- RESTful 接口 - RESTful interface
- 兼容 InfluxDB v1 写接口 - InfluxDB v1 compliant write interface
- 兼容 OpenTSDB JSON 和 telnet 格式写入 - OpenTSDB JSON and telnet format writes compatible
- 无缝连接到 Telegraf - Seamless connection to Telegraf
- 无缝连接到 collectd - Seamless connection to collectd
- 无缝连接到 StatsD - Seamless connection to StatsD
- 支持 Prometheus remote_read 和 remote_write - Supports Prometheus remote_read and remote_write
## taosAdapter 架构图 ## taosAdapter architecture diagram
![taosAdapter Architecture](taosAdapter-architecture.png) ![taosAdapter Architecture](taosAdapter-architecture.png)
## taosAdapter 部署方法 ## taosAdapter Deployment Method
### 安装 taosAdapter ### Install taosAdapter
taosAdapter 从 TDengine v2.4.0.0 版本开始成为 TDengine 服务端软件 的一部分,如果您使用 TDengine server 您不需要任何额外的步骤来安装 taosAdapter。您可以从[涛思数据官方网站](https://taosdata.com/cn/all-downloads/)下载 TDengine server(taosAdapter 包含在 v2.4.0.0 及以上版本)安装包。如果需要将 taosAdapter 分离部署在 TDengine server 之外的服务器上,则应该在该服务器上安装完整的 TDengine 来安装 taosAdapter。如果您需要使用源代码编译生成 taosAdapter,您可以参考[构建 taosAdapter](https://github.com/taosdata/taosadapter/blob/develop/BUILD-CN.md)文档。 taosAdapter has been part of TDengine server software since TDengine v2.4.0.0. If you use the TDengine server, you don't need additional steps to install taosAdapter. You can download taosAdapter from [Taos Data official website](https://taosdata. com/cn/all-downloads/) to download the TDengine server (taosAdapter is included in v2.4.0.0 and above) installation package. If you need to deploy taosAdapter separately on a server other than the TDengine server, you should install the full TDengine on that server to install taosAdapter. If you need to generate taosAdapter using source code compilation, you can refer to the [Building taosAdapter]( https://github.com/taosdata/taosadapter/blob/develop/BUILD-CN.md) documentation.
### start/stop taosAdapter ### start/stop taosAdapter
在 Linux 系统上 taosAdapter 服务默认由 systemd 管理。使用命令 `systemctl start taosadapter` 可以启动 taosAdapter 服务。使用命令 `systemctl stop taosadapter` 可以停止 taosAdapter 服务。 On Linux systems, the taosAdapter service is managed by systemd by default. You can use the command `systemctl start taosadapter` to start the taosAdapter service and use the command `systemctl stop taosadapter` to stop the taosAdapter service.
### 移除 taosAdapter ### Remove taosAdapter
使用命令 rmtaos 可以移除包括 taosAdapter 在内的 TDengine server 软件。 Use the command `rmtaos` to remove the TDengine server software, including taosAdapter.
### 升级 taosAdapter ### Upgrade taosAdapter
taosAdapter 和 TDengine server 需要使用相同版本。请通过升级 TDengine server 来升级 taosAdapter。 taosAdapter and TDengine server need to use the same version. Please upgrade the taosAdapter by upgrading the TDengine server.
与 taosd 分离部署的 taosAdapter 必须通过升级其所在服务器的 TDengine server 才能得到升级。 You need to upgrade the taosAdapter deployed separately from taosd by upgrading the TDengine server of the deployed server.
## taosAdapter 参数列表 ## taosAdapter parameter list
taosAdapter 支持通过命令行参数、环境变量和配置文件来进行配置。默认配置文件是 /etc/taos/taosadapter.toml。 taosAdapter supports configuration via command-line arguments, environment variables and configuration files. The default configuration file is /etc/taos/taosadapter.toml.
命令行参数优先于环境变量优先于配置文件,命令行用法是 arg=val,如 taosadapter -p=30000 --debug=true,详细列表如下: Command-line arguments take precedence over environment variables over configuration files. The command line usage is arg=val, e.g., taosadapter -p=30000 --debug=true. The detailed list is as follows:
```shell ```shell
Usage of taosAdapter: Usage of taosAdapter:
...@@ -133,8 +133,8 @@ Usage of taosAdapter: ...@@ -133,8 +133,8 @@ Usage of taosAdapter:
--version Print the version and exit --version Print the version and exit
``` ```
备注: Note:
使用浏览器进行接口调用请根据实际情况设置如下跨源资源共享(CORS)参数: Please set the following Cross-Origin Resource Sharing (CORS) parameters according to the actual situation when using a browser for interface calls.
```text ```text
AllowAllOrigins AllowAllOrigins
...@@ -145,39 +145,39 @@ AllowCredentials ...@@ -145,39 +145,39 @@ AllowCredentials
AllowWebSockets AllowWebSockets
``` ```
如果不通过浏览器进行接口调用无需关心这几项配置。 You do not need to care about these configurations if you do not make interface calls through the browser.
关于 CORS 协议细节请参考:[https://www.w3.org/wiki/CORS_Enabled](https://www.w3.org/wiki/CORS_Enabled)[https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CORS](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CORS) For details on the CORS protocol, please refer to: [https://www.w3.org/wiki/CORS_Enabled](https://www.w3.org/wiki/CORS_Enabled) or [https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CORS](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CORS).
示例配置文件参见 [example/config/taosadapter.toml](https://github.com/taosdata/taosadapter/blob/develop/example/config/taosadapter.toml) See [example/config/taosadapter.toml](https://github.com/taosdata/taosadapter/blob/develop/example/config/taosadapter.toml) for sample configuration files.
## 功能列表 ## Feature List
- 与 RESTful 接口兼容 - Compatible with RESTful interfaces
[https://www.taosdata.com/cn/documentation/connector#restful](https://www.taosdata.com/cn/documentation/connector#restful) [https://www.taosdata.com/cn/documentation/connector#restful](https://www.taosdata.com/cn/documentation/connector#restful)
- 兼容 InfluxDB v1 写接口 - Compatible with InfluxDB v1 write interface
[https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/write/](https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/write/) [https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/write/](https://docs.influxdata.com/influxdb/v2.0/reference/ api/influxdb-1x/write/)
- 兼容 OpenTSDB JSON 和 telnet 格式写入 - Compatible with OpenTSDB JSON and telnet format writes
- <http://opentsdb.net/docs/build/html/api_http/put.html> - <http://opentsdb.net/docs/build/html/api_http/put.html>
- <http://opentsdb.net/docs/build/html/api_telnet/put.html> - <http://opentsdb.net/docs/build/html/api_telnet/put.html>
- 与 collectd 无缝连接 - Seamless connection to collectd
collectd 是一个系统统计收集守护程序,请访问 [https://collectd.org/](https://collectd.org/) 了解更多信息。 collectd is a system statistics collection daemon, please visit [https://collectd.org/](https://collectd.org/) for more information.
- Seamless connection with StatsD - Seamless connection with StatsD
StatsD 是一个简单而强大的统计信息汇总的守护程序。请访问 [https://github.com/statsd/statsd](https://github.com/statsd/statsd) 了解更多信息。 StatsD is a simple yet powerful daemon for aggregating statistical information. Please visit [https://github.com/statsd/statsd](https://github.com/statsd/statsd) for more information.
- 与 icinga2 的无缝连接 - Seamless connection with icinga2
icinga2 是一个收集检查结果指标和性能数据的软件。请访问 [https://icinga.com/docs/icinga-2/latest/doc/14-features/#opentsdb-writer](https://icinga.com/docs/icinga-2/latest/doc/14-features/#opentsdb-writer) 了解更多信息。 icinga2 is a software that collects inspection result metrics and performance data. Please visit [https://icinga.com/docs/icinga-2/latest/doc/14-features/#opentsdb-writer](https://icinga.com/docs/icinga-2/latest/doc/14- features/#opentsdb-writer) for more information.
- 与 tcollector 无缝连接 - Seamless connection to tcollector
TCollector 是一个客户端进程,从本地收集器收集数据,并将数据推送到 OpenTSDB。请访问 [http://opentsdb.net/docs/build/html/user_guide/utilities/tcollector.html](http://opentsdb.net/docs/build/html/user_guide/utilities/tcollector.html) 了解更多信息。 TCollector is a client process that collects data from a local collector and pushes the data to OpenTSDB. Please visit [http://opentsdb.net/docs/build/html/user_guide/utilities/tcollector.html](http://opentsdb.net/docs/build/html/user_guide/utilities/tcollector.html) for more information.
- 无缝连接 node_exporter - Seamless connection to node_exporter
node_export 是一个机器指标的导出器。请访问 [https://github.com/prometheus/node_exporter](https://github.com/prometheus/node_exporter) 了解更多信息。 node_export is an exporter for machine metrics. Please visit [https://github.com/prometheus/node_exporter](https://github.com/prometheus/node_exporter) for more information.
- 支持 Prometheus remote_read 和 remote_write - Support for Prometheus remote_read and remote_write
remote_read 和 remote_write 是 Prometheus 数据读写分离的集群方案。请访问[https://prometheus.io/blog/2019/10/10/remote-read-meets-streaming/#remote-apis](https://prometheus.io/blog/2019/10/10/remote-read-meets-streaming/#remote-apis) 了解更多信息。 remote_read and remote_write are clustering solutions for Prometheus data read and write separation. Please visit [https://prometheus.io/blog/2019/10/10/remote-read-meets-streaming/#remote-apis](https://prometheus.io/blog/2019/10/10/remote- read-meets-streaming/#remote-apis) for more information.
## 接口 ## Interfaces
### TDengine RESTful 接口 ### TDengine RESTful interface
您可以使用任何支持 http 协议的客户端通过访问 RESTful 接口地址 `http://<fqdn>:6041/<APIEndPoint>` 来写入数据到 TDengine 或从 TDengine 中查询数据。细节请参考[官方文档](/reference/connector#restful)。支持如下 EndPoint : You can use any client that supports the http protocol to write data to or query data from TDengine by accessing the RESTful interface address `http://<fqdn>:6041/<APIEndPoint>`. See the [official documentation](/reference/connector#restful) for details. The following EndPoint is supported.
```text ```text
/rest/sql /rest/sql
...@@ -187,24 +187,24 @@ AllowWebSockets ...@@ -187,24 +187,24 @@ AllowWebSockets
### InfluxDB ### InfluxDB
您可以使用任何支持 http 协议的客户端访问 Restful 接口地址 `http://<fqdn>:6041/<APIEndPoint>` 来写入 InfluxDB 兼容格式的数据到 TDengine。EndPoint 如下: You can use any client that supports the http protocol to access the Restful interface address `http://<fqdn>:6041/<APIEndPoint>` to write data in InfluxDB compatible format to TDengine. The EndPoint is as follows:
```text ```text
/influxdb/v1/write /influxdb/v1/write
``` ```
支持 InfluxDB 查询参数如下: Support InfluxDB query parameters as follows.
- `db` 指定 TDengine 使用的数据库名 - `db` Specifies the database name used by TDengine
- `precision` TDengine 使用的时间精度 - `precision` The time precision used by TDengine
- `u` TDengine 用户名 - `u` TDengine user name
- `p` TDengine 密码 - `p` TDengine password
注意: 目前不支持 InfluxDB 的 token 验证方式只支持 Basic 验证和查询参数验证。 Note: InfluxDB token verification is not supported at present. Only Basic verification and query parameter validation are supported.
### OpenTSDB ### OpenTSDB
您可以使用任何支持 http 协议的客户端访问 Restful 接口地址 `http://<fqdn>:6041/<APIEndPoint>` 来写入 OpenTSDB 兼容格式的数据到 TDengine。EndPoint 如下: You can use any client that supports the http protocol to access the Restful interface address `http://<fqdn>:6041/<APIEndPoint>` to write data in OpenTSDB compatible format to TDengine.
```text ```text
/opentsdb/v1/put/json/:db /opentsdb/v1/put/json/:db
...@@ -229,110 +229,110 @@ AllowWebSockets ...@@ -229,110 +229,110 @@ AllowWebSockets
### node_exporter ### node_exporter
Prometheus 使用的由\*NIX 内核暴露的硬件和操作系统指标的输出器 Exporter of hardware and OS metrics exposed by the \*NIX kernel used by Prometheus
- 启用 taosAdapter 的配置 node_exporter.enable - Enable the taosAdapter configuration node_exporter.enable
- 设置 node_exporter 的相关配置 - Set the configuration of the node_exporter
- 重新启动 taosAdapter - Restart taosAdapter
### prometheus ### prometheus
<Prometheus /> <Prometheus />
## 内存使用优化方法 ## Memory usage optimization methods
taosAdapter 将监测自身运行过程中内存使用率并通过两个阈值进行调节。有效值范围为 -1 到 100 的整数,单位为系统物理内存的百分比。 taosAdapter will monitor its memory usage during operation and adjust it with two thresholds. Valid values range from -1 to 100 integers in percent of the system's physical memory.
- pauseQueryMemoryThreshold - pauseQueryMemoryThreshold
- pauseAllMemoryThreshold - pauseAllMemoryThreshold
当超过 pauseQueryMemoryThreshold 阈值时时停止处理查询请求。 Stops processing query requests when the pauseQueryMemoryThreshold threshold is exceeded.
http 返回内容: http response content.
- code 503 - code 503
- body "query memory exceeds threshold" - body "query memory exceeds threshold"
当超过 pauseAllMemoryThreshold 阈值时停止处理所有写入和查询请求。 Stops processing all write and query requests when the pauseAllMemoryThreshold threshold is exceeded.
http 返回内容: http response: code 503
- code 503 - code 503
- body "memory exceeds threshold" - body "memory exceeds threshold"
当内存回落到阈值之下时恢复对应功能。 Resume the corresponding function when the memory falls back below the threshold.
状态检查接口 `http://<fqdn>:6041/-/ping` Status check interface `http://<fqdn>:6041/-/ping`
- 正常返回 `code 200` - Normal returns `code 200`
- 无参数 如果内存超过 pauseAllMemoryThreshold 将返回 `code 503` - No parameter If memory exceeds pauseAllMemoryThreshold returns `code 503`
- 请求参数 `action=query` 如果内存超过 pauseQueryMemoryThreshold 或 pauseAllMemoryThreshold 将返回 `code 503` - Request parameter `action=query` returns `code 503` if memory exceeds pauseQueryMemoryThreshold or pauseAllMemoryThreshold
对应配置参数 Corresponding configuration parameter
```text ``text
monitor.collectDuration 监测间隔 环境变量 "TAOS_MONITOR_COLLECT_DURATION" (默认值 3s) monitor.collectDuration monitoring interval environment variable "TAOS_MONITOR_COLLECT_DURATION" (default value 3s)
monitor.incgroup 是否是cgroup中运行(容器中运行设置为 true) 环境变量 "TAOS_MONITOR_INCGROUP" monitor.incgroup whether to run in cgroup (set to true for running in container) environment variable "TAOS_MONITOR_INCGROUP"
monitor.pauseAllMemoryThreshold 不再进行插入和查询的内存阈值 环境变量 "TAOS_MONITOR_PAUSE_ALL_MEMORY_THRESHOLD" (默认值 80) monitor.pauseAllMemoryThreshold memory threshold for no more inserts and queries environment variable "TAOS_MONITOR_PAUSE_ALL_MEMORY_THRESHOLD" (default 80)
monitor.pauseQueryMemoryThreshold 不再进行查询的内存阈值 环境变量 "TAOS_MONITOR_PAUSE_QUERY_MEMORY_THRESHOLD" (默认值 70) monitor.pauseQueryMemoryThreshold memory threshold for no more queries Environment variable "TAOS_MONITOR_PAUSE_QUERY_MEMORY_THRESHOLD" (default 70)
``` ```
您可以根据具体项目应用场景和运营策略进行相应调整,并建议使用运营监控软件及时进行系统内存状态监控。负载均衡器也可以通过这个接口检查 taosAdapter 运行状态。 You can adjust it according to the specific project application scenario and operation strategy, and it is recommended to use operation monitoring software for timely system memory status monitoring. The load balancer can also check the taosAdapter running status through this interface.
## taosAdapter 监控指标 ## taosAdapter Monitoring Metrics
taosAdapter 采集 http 相关指标、cpu 百分比和内存百分比。 taosAdapter collects http-related metrics, CPU percentage, and memory percentage.
### http 接口 ### http interface
提供符合 [OpenMetrics](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md) 接口: Provides an interface conforming to [OpenMetrics](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md).
```text ```text
http://<fqdn>:6041/metrics http://<fqdn>:6041/metrics
``` ```
### 写入 TDengine ### Write to TDengine
taosAdapter 支持将 http 监控、cpu 百分比和内存百分比写入 TDengine。 taosAdapter supports writing http monitoring, CPU percentage, and memory percentage to TDengine.
有关配置参数 For configuration parameters
| **配置项** | **描述** | **默认值** | | **Configuration items** | **Description** | **Default values** |
| ----------------------- | --------------------------------------------------------- | ---------- | | ----------------------- | --------------------------------------------------------- | ---------- |
| monitor.collectDuration | cpu 和内存采集间隔 | 3s | | monitor.collectDuration | CPU and memory collection interval | 3s |
| monitor.identity | 当前 taosadapter 的标识符如果不设置将使用 'hostname:port' | | | monitor.identity | The current taosadapter identifier will be used if not set to 'hostname:port' | |
| monitor.incgroup | 是否是 cgroup 中运行(容器中运行设置为 true) | false | | monitor.incgroup | whether it is running in a cgroup (set to true for running in a container) | false |
| monitor.writeToTD | 是否写入到 TDengine | true | | monitor.writeToTD | Whether to write to TDengine | true |
| monitor.user | TDengine 连接用户名 | root | | monitor.user | TDengine connection username | root |
| monitor.password | TDengine 连接密码 | taosdata | | monitor.password | TDengine connection password | taosdata |
| monitor.writeInterval | 写入 TDengine 间隔 | 30s | | monitor.writeInterval | Write to TDengine interval | 30s |
## 结果返回条数限制 ## Limit the number of results returned
taosAdapter 通过参数 `restfulRowLimit` 来控制结果的返回条数,-1 代表无限制,默认无限制。 taosAdapter controls the number of results returned by the parameter `restfulRowLimit`, -1 means no limit, default is no limit.
该参数控制以下接口返回 This parameter controls the number of results returned by the following interfaces:
- `http://<fqdn>:6041/rest/sql` - `http://<fqdn>:6041/rest/sql`
- `http://<fqdn>:6041/rest/sqlt` - `http://<fqdn>:6041/rest/sqlt`
- `http://<fqdn>:6041/rest/sqlutc` - `http://<fqdn>:6041/rest/sqlutc`
- `http://<fqdn>:6041/prometheus/v1/remote_read/:db` - ` http://<fqdn>:6041/prometheus/v1/remote_read/:db`
## 故障解决 ## Troubleshooting
您可以通过命令 `systemctl status taosadapter` 来检查 taosAdapter 运行状态。 You can check the taosAdapter running status with the` systemctl status taosadapter` command.
您也可以通过设置 --logLevel 参数或者环境变量 TAOS_ADAPTER_LOG_LEVEL 来调节 taosAdapter 日志输出详细程度。有效值包括: panic、fatal、error、warn、warning、info、debug 以及 trace。 You can also adjust the level of the taosAdapter log output by setting the --logLevel parameter or the environment variable TAOS_ADAPTER_LOG_LEVEL. Valid values are: panic, fatal, error, warn, warning, info, debug and trace.
## 如何从旧版本 TDengine 迁移到 taosAdapter ## How to migrate from older TDengine versions to taosAdapter
在 TDengine server 2.2.x.x 或更早期版本中,taosd 进程包含一个内嵌的 http 服务。如前面所述,taosAdapter 是一个使用 systemd 管理的独立软件,拥有自己的进程。并且两者有一些配置参数和行为是不同的,请见下表: In TDengine server 2.2.x.x or earlier, the taosd process contains an embedded http service. As mentioned earlier, taosAdapter is a standalone software managed using systemd and has its process. And there are some configuration parameters and behaviors that are different between the two. See the following table.
| **#** | **embedded httpd** | **taosAdapter** | **comment** | | **#** | **embedded httpd** | **taosAdapter** | **comment** |
| ----- | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | ----- | ------------------- | ------------------------------------ | ------------------------------------------------------------------ ------------------------------------------------------------------------ |
| 1 | httpEnableRecordSql | --logLevel=debug | | | 1 | httpEnableRecordSql | --logLevel=debug | |
| 2 | httpMaxThreads | n/a | taosAdapter 自动管理线程池,无需此参数 | | 2 | httpMaxThreads | n/a | taosAdapter Automatically manages thread pools without this parameter |
| 3 | telegrafUseFieldNum | 请参考 taosAdapter telegraf 配置方法 | | | 3 | telegrafUseFieldNum | See the taosAdapter telegraf configuration method | |
| 4 | restfulRowLimit | restfulRowLimit | 内嵌 httpd 默认输出 10240 行数据,最大允许值为 102400。taosAdapter 也提供 restfulRowLimit 但是默认不做限制。您可以根据实际场景需求进行配置 | | 4 | restfulRowLimit | restfulRowLimit | Embedded httpd outputs 10240 rows of data by default, the maximum allowed is 102400. taosAdapter also provides restfulRowLimit but it is not limited by default. You can configure it according to the actual scenario.
| 5 | httpDebugFlag | 不适用 | httpdDebugFlag 对 taosAdapter 不起作用 | | 5 | httpDebugFlag | Not applicable | httpdDebugFlag does not work for taosAdapter |
| 6 | httpDBNameMandatory | 不适用 | taosAdapter 要求 URL 中必须指定数据库名 | | 6 | httpDBNameMandatory | N/A | taosAdapter requires the database name to be specified in the URL |
...@@ -2,64 +2,64 @@ ...@@ -2,64 +2,64 @@
title: taosBenchmark title: taosBenchmark
sidebar_label: taosBenchmark sidebar_label: taosBenchmark
toc_max_heading_level: 4 toc_max_heading_level: 4
description: "taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能的工具" description: "taosBenchmark (once called taosdemo ) is a tool for testing the performance of TDengine."
--- ---
## 简介 ## Introduction
taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能的工具。taosBenchmark 可以测试 TDengine 的插入、查询和订阅等功能的性能,它可以模拟由大量设备产生的大量数据,还可以灵活地控制数据库、超级表、标签列的数量和类型、数据列的数量和类型、子表的数量、每张子表的数据量、插入数据的时间间隔、taosBenchmark 的工作线程数量、是否以及如何插入乱序数据等。为了兼容过往用户的使用习惯,安装包提供 了 taosdemo 作为 taosBenchmark 的软链接。 taosBenchmark (formerly taosdemo ) is a tool for testing the performance of TDengine products. taosBenchmark can test the performance of TDengine's insert, query, and subscription functions and simulate large amounts of data generated by many devices. taosBenchmark can flexibly control the number and type of databases, supertables, tag columns, number and type of data columns, and sub-tables, and types of databases, super tables, the number and types of data columns, the number of sub-tables, the amount of data per sub-table, the time interval for inserting data, the number of working threads, whether and how to insert disordered data, and so on. The installer provides taosdemo as a soft link to taosBenchmark for compatibility with past users.
## 安装 ## Installation
taosBenchmark 有两种安装方式: There are two ways to install taosBenchmark:
- 安装 TDengine 官方安装包的同时会自动安装 taosBenchmark, 详情请参考[ TDengine 安装](/operation/pkg-install) - Installing the official TDengine installer will automatically install taosBenchmark. Please refer to [TDengine installation](/operation/pkg-install) for details.
- 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](https://github.com/taosdata/taos-tools) 仓库。 - Compile taos-tools separately and install them. Please refer to the [taos-tools](https://github.com/taosdata/taos-tools) repository for details.
## 运行 ## Run
### 配置和运行方式 ### Configuration and running methods
taosBenchmark 支持两种配置方式:[命令行参数](#命令行参数详解)[JSON 配置文件](#配置文件参数详解)。这两种方式是互斥的,在使用配置文件时只能使用一个命令行参数 `-f <json file>` 指定配置文件。在使用命令行参数运行 taosBenchmark 并控制其行为时则不能使用 `-f` 参数而要用其它参数来进行配置。除此之外,taosBenchmark 还提供了一种特殊的运行方式,即无参数运行。 taosBenchmark supports two configuration methods: [command line arguments](# command line arguments detailed) and [JSON configuration file](# configuration file arguments detailed). These two methods are mutually exclusive, and with only one command line parameter, users can use `-f <json file>` to specify a configuration file when using a configuration file. When running taosBenchmark with command-line arguments and controlling its behavior, users should use other parameters for configuration rather than `-f` parameter. In addition, taosBenchmark offers a special way of running without parameters.
taosBenchmark 支持对 TDengine 做完备的性能测试,其所支持的 TDengine 功能分为三大类:写入、查询和订阅。这三种功能之间是互斥的,每次运行 taosBenchmark 只能选择其中之一。值得注意的是,所要测试的功能类型在使用命令行配置方式时是不可配置的,命令行配置方式只能测试写入性能。若要测试 TDegnine 的查询和订阅性能,必须使用配置文件的方式,通过配置文件中的参数 `filetype` 指定所要测试的功能类型。 taosBenchmark supports complete performance testing of TDengine. taosBenchmark supports the TDengine functions in three categories: write, query, and subscribe. These three functions are mutually exclusive, and users can select only one of them each time taosBenchmark runs. It is important to note that the type of functionality to be tested is not configurable when using the command line configuration method, which can only test writing performance. To test the query and subscription performance of the TDengine, you must use the configuration file method and specify the function type to test via the parameter `filetype` in the configuration file.
**在运行 taosBenchmark 之前要确保 TDengine 集群已经在正确运行。** **Make sure that the TDengine cluster is running correctly before running taosBenchmark. **
### 无命令行参数运行 ### Run without command-line arguments
执行下列命令即可快速体验 taosBenchmark 对 TDengine 进行基于默认配置的写入性能测试。 Execute the following commands to quickly experience taosBenchmark's default configuration-based write performance testing of TDengine.
```bash ```bash
taosBenchmark taosBenchmark
``` ```
在无参数运行时,taosBenchmark 默认连接 `/etc/taos` 下指定的 TDengine 集群,并在 TDengine 中创建一个名为 test 的数据库,test 数据库下创建名为 meters 的一张超级表,超级表下创建 10000 张表,每张表中写入 10000 条记录。注意,如果已有 test 数据库,这个命令会先删除该数据库后建立一个全新的 test 数据库。 When run without parameters, taosBenchmark connects to the TDengine cluster specified in `/etc/taos` by default and creates a database named test in TDengine, a super table named `meters` under the test database, and 10,000 tables under the super table with 10,000 records written to each table. Note that if there is already a test database, this table is not used. Note that if there is already a test database, this command will delete it first and create a new test database.
### 使用命令行配置参数运行 ### Run with command line configuration parameters
在使用命令行参数运行 taosBenchmark 并控制其行为时,`-f <json file>` 参数不能使用。所有配置参数都必须通过命令行指定。以下是使用命令行方式测试 taosBenchmark 写入性能的一个示例。 The `-f <json file>` argument cannot be used when running taosBenchmark with command-line parameters and controlling its behavior. Users must specify all configuration parameters from the command line. The following is an example of testing taosBenchmark writing performance using the command line approach.
```bash ```bash
taosBenchmark -I stmt -n 200 -t 100 taosBenchmark -I stmt -n 200 -t 100
``` ```
上面的命令 `taosBenchmark` 将创建一个名为`test`的数据库,在其中建立一张超级表`meters`,在该超级表中建立 100 张子表并使用参数绑定的方式为每张子表插入 200 条记录。 The above command, `taosBenchmark` will create a database named `test`, create a super table `meters` in it, create 100 sub-tables in the super table and insert 200 records for each sub-table using parameter binding.
### 使用配置文件运行 ### Run with the configuration file
taosBenchmark 安装包中提供了配置文件的示例,位于 `<install_directory>/examples/taosbenchmark-json` A sample configuration file is provided in the taosBenchmark installation package under `<install_directory>/examples/taosbenchmark-json`.
使用如下命令行即可运行 taosBenchmark 并通过配置文件控制其行为。 Use the following command line to run taosBenchmark and control its behavior via a configuration file.
```bash ```bash
taosBenchmark -f <json file> taosBenchmark -f <json file>
``` ```
**下面是几个配置文件的示例:** **Here are a few examples of configuration files:**
#### 插入场景 JSON 配置文件示例 #### Example of inserting a scenario JSON configuration file
<details> <details>
<summary>insert.json</summary> <summary>insert.json</summary>
...@@ -70,7 +70,7 @@ taosBenchmark -f <json file> ...@@ -70,7 +70,7 @@ taosBenchmark -f <json file>
</details> </details>
#### 查询场景 JSON 配置文件示例 #### Query Scenario JSON Profile Example
<details> <details>
<summary>query.json</summary> <summary>query.json</summary>
...@@ -92,343 +92,343 @@ taosBenchmark -f <json file> ...@@ -92,343 +92,343 @@ taosBenchmark -f <json file>
</details> </details>
## 命令行参数详解 ## Command Line Parameters Explained
- **-f/--file <json file\>** : - **-f/--file <json file\>** :
要使用的 JSON 配置文件,由该文件指定所有参数,本参数与命令行其他参数不能同时使用。没有默认值。 specify the configuration file to use. This file includes All parameters. And users should not use this parameter with other parameters on the command line. There is no default value.
- **-c/--config-dir <dir\>** : - **-c/--config-dir <dir\>** :
TDengine 集群配置文件所在的目录,默认路径是 /etc/taos 。 specify the directory where the TDengine cluster configuration file. the default path is `/etc/taos`.
- **-h/--host <host\>** : - **-h/--host <host\>** :
指定要连接的 TDengine 服务端的 FQDN,默认值为 localhost 。 Specify the FQDN of the TDengine server to connect to. The default value is localhost.
- **-P/--port <port\>** : - **-P/--port <port\>** :
要连接的 TDengine 服务器的端口号,默认值为 6030 。 The port number of the TDengine server to connect to, the default value is 6030.
- **-I/--interface <insertMode\>** : - **-I/--interface <insertMode\>** :
插入模式,可选项有 taosc, rest, stmt, sml, sml-rest, 分别对应普通写入、restful 接口写入、参数绑定接口写入、schemaless 接口写入、restful schemaless 接口写入 (由 taosAdapter 提供)。默认值为 taosc。 Insert mode. Options are taosc, rest, stmt, sml, sml-rest, corresponding to normal write, restful interface writing, parameter binding interface writing, schemaless interface writing, RESTful schemaless interface writing (provided by taosAdapter). The default value is taosc.
- **-u/--user <user\>** : - **-u/--user <user\>** :
用于连接 TDengine 服务端的用户名,默认为 root 。 User name to connect to the TDengine server. Default is root.
- **-p/--password <passwd\>** : - **-p/--password <passwd\>** :
用于连接 TDengine 服务端的密码,默认值为 taosdata。 The default password to connect to the TDengine server is `taosdata`.
- **-o/--output <file\>** : - **-o/--output <file\>** :
结果输出文件的路径,默认值为 ./output.txt。 specify the path of the result output file, the default value is `. /output.txt`.
- **-T/--thread <threadNum\>** : - **-T/--thread <threadNum\>** :
插入数据的线程数量,默认为 8 。 The number of threads to insert data. Default is 8.
- **-B/--interlace-rows <rowNum\>** : - **-B/--interlace-rows <rowNum\>** :
启用交错插入模式并同时指定向每个子表每次插入的数据行数。交错插入模式是指依次向每张子表插入由本参数所指定的行数并重复这个过程,直到所有子表的数据都插入完成。默认值为 0, 即向一张子表完成数据插入后才会向下一张子表进行数据插入。 Enables interleaved insertion mode and specifies the number of rows of data to be inserted into each child table. Interleaved insertion mode means inserting the number of rows specified by this parameter into each sub-table and repeating the process until all sub-tables have been inserted. The default value is 0, i.e., data is inserted into one sub-table before the next sub-table is inserted.
- **-i/--insert-interval <timeInterval\>** : - **-i/--insert-interval <timeInterval\>** :
指定交错插入模式的插入间隔,单位为 ms,默认值为 0。 只有当 `-B/--interlace-rows` 大于 0 时才起作用。意味着数据插入线程在为每个子表插入隔行扫描记录后,会等待该值指定的时间间隔后再进行下一轮写入。 Specify the insert interval in `ms` for interleaved insert mode. The default value is 0. It only works if `-B/--interlace-rows` is greater than 0. That means that after inserting interlaced rows for each child table, the data insertion with multiple threads will wait for the interval specified by this value before proceeding to the next round of writes.
- **-r/--rec-per-req <rowNum\>** : - **-r/--rec-per-req <rowNum\>** :
每次向 TDegnine 请求写入的数据行数,默认值为 30000 。 Writing the number of rows of records per request to TDengine, the default value is 30000.
- **-t/--tables <tableNum\>** : - **-t/--tables <tableNum\>** :
指定子表的数量,默认为 10000 。 Specify the number of sub-tables. The default is 10000.
- **-S/--timestampstep <stepLength\>** : - **-S/--timestampstep <stepLength\>** :
每个子表中插入数据的时间戳步长,单位是 ms,默认值是 1。 Timestamp step for inserting data in each child table in ms, default is 1.
- **-n/--records <recordNum\>** : - **-n/--records <recordNum\>** :
每个子表插入的记录数,默认值为 10000 。 The default value of the number of records inserted in each sub-table is 10000.
- **-d/--database <dbName\>** : - **-d/--database <dbName\>** :
所使用的数据库的名称,默认值为 test 。 The name of the database used, the default value is `test`.
- **-b/--data-type <colType\>** : - **-b/--data-type <colType\>** :
超级表的数据列的类型。如果不使用则默认为有三个数据列,其类型分别为 FLOAT, INT, FLOAT 。 specify the type of the data columns of the super table. It defaults to three columns of type FLOAT, INT, and FLOAT if not used.
- **-l/--columns <colNum\>** : - **-l/--columns <colNum\>** :
超级表的数据列的总数量。如果同时设置了该参数和 `-b/--data-type`,则最后的结果列数为两者取大。如果本参数指定的数量大于 `-b/--data-type` 指定的列数,则未指定的列类型默认为 INT, 例如: `-l 5 -b float,double`, 那么最后的列为 `FLOAT,DOUBLE,INT,INT,INT`。如果 columns 指定的数量小于或等于 `-b/--data-type` 指定的列数,则结果为 `-b/--data-type` 指定的列和类型,例如: `-l 3 -b float,double,float,bigint`,那么最后的列为 `FLOAT,DOUBLE,FLOAT,BIGINT` specify the number of columns in the super table. If both this parameter and `-b/--data-type` is set, the final result number of columns is the greater of the two. If the number specified by this parameter is greater than the number of columns specified by `-b/--data-type`, the unspecified column type defaults to INT, for example: `-l 5 -b float,double`, then the final column is `FLOAT,DOUBLE,INT,INT,INT`. If the number of columns specified is less than or equal to the number of columns specified by `-b/--data-type`, then the result is the column and type specified by `-b/--data-type`, e.g.: `-l 3 -b float,double,float,bigint`. The last column is `FLOAT,DOUBLE, FLOAT,BIGINT`.
- **-A/--tag-type <tagType\>** : - **-A/--tag-type <tagType\>** :
超级表的标签列类型。nchar 和 binary 类型可以同时设置长度,例如: The tag column type of the super table. nchar and binary types can both set the length, for example:
``` ```
taosBenchmark -A INT,DOUBLE,NCHAR,BINARY(16) taosBenchmark -A INT,DOUBLE,NCHAR,BINARY(16)
``` ```
如果没有设置标签类型,默认是两个标签,其类型分别为 INT 和 BINARY(16)。 If users did not set tag type, the default is two tags, whose types are INT and BINARY(16).
注意:在有的 shell 比如 bash 命令里面 “()” 需要转义,则上述指令应为: Note: In some shells, such as bash, "()" needs to be escaped, so the above command should be
``` ```
taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
``` ```
- **-w/--binwidth <length\>**: - **-w/--binwidth <length\>**:
nchar 和 binary 类型的默认长度,默认值为 64。 specify the default length for nchar and binary types. The default value is 64.
- **-m/--table-prefix <tablePrefix\>** : - **-m/--table-prefix <tablePrefix\>** :
子表名称的前缀,默认值为 "d"。 The prefix of the sub-table name, the default value is "d".
- **-E/--escape-character** : - **-E/--escape-character** :
开关参数,指定在超级表和子表名称中是否使用转义字符。默认值为不使用。 Switch parameter specifying whether to use escape characters in the super table and sub-table names. By default is not used.
- **-C/--chinese** : - **-C/--chinese** :
开关参数,指定 nchar 和 binary 是否使用 Unicode 中文字符。默认值为不使用。 Switch specifying whether to use Unicode Chinese characters in nchar and binary. By default is not used.
- **-N/--normal-table** : - **-N/--normal-table** :
开关参数,指定只创建普通表,不创建超级表。默认值为 false。仅当插入模式为 taosc, stmt, rest 模式下可以使用。 This parameter indicates that taosBenchmark will create only normal tables instead of super tables. The default value is false. It can be used if the insert mode is taosc, stmt, and rest.
- **-M/--random** : - **-M/--random** :
开关参数,插入数据为生成的随机值。默认值为 false。若配置此参数,则随机生成要插入的数据。对于数值类型的 标签列/数据列,其值为该类型取值范围内的随机值。对于 NCHAR 和 BINARY 类型的 标签列/数据列,其值为指定长度范围内的随机字符串。 This parameter indicates writing data with random values. The default is false. If users use this parameter, taosBenchmark will generate the random values. For tag/data columns of numeric type, the value is a random value within the range of values of that type. For NCHAR and BINARY type tag columns/data columns, the value is the random string within the specified length range.
- **-x/--aggr-func** : - **-x/--aggr-func** :
开关参数,指示插入后查询聚合函数。默认值为 false。 Switch parameter to indicate query aggregation function after insertion. The default value is false.
- **-y/--answer-yes** : - **-y/--answer-yes** :
开关参数,要求用户在提示后确认才能继续。默认值为 false 。 Switch parameter that requires the user to confirm at the prompt to continue. The default value is false.
- **-O/--disorder <Percentage\>** : - **-O/--disorder <Percentage\>** :
指定乱序数据的百分比概率,其值域为 [0,50]。默认为 0,即没有乱序数据。 Specify the percentage probability of disordered data, with a value range of [0,50]. The default is 0, i.e., there is no disordered data.
- **-R/--disorder-range <timeRange\>** : - **-R/--disorder-range <timeRange\>** :
指定乱序数据的时间戳回退范围。所生成的乱序时间戳为非乱序情况下应该使用的时间戳减去这个范围内的一个随机值。仅在 `-O/--disorder` 指定的乱序数据百分比大于 0 时有效。 Specify the timestamp range for the disordered data. It leads the resulting disorder timestamp as the ordered timestamp minus a random value in this range. Valid only if the percentage of disordered data specified by `-O/--disorder` is greater than 0.
- **-F/--prepare_rand <Num\>** : - **-F/--prepare_rand <Num\>** :
生成的随机数据中唯一值的数量。若为 1 则表示所有数据都相同。默认值为 10000 。 Specify the number of unique values in the generated random data. A value of 1 means that all data are equal. The default value is 10000.
- **-a/--replica <replicaNum\>** : - **-a/--replica <replicaNum\>** :
创建数据库时指定其副本数,默认值为 1 。 Specify the number of replicas when creating the database. The default value is 1.
- **-V/--version** : - **-V/--version** :
显示版本信息并退出。不能与其它参数混用。 Show version information only. Users should not use it with other parameters.
- **-?/--help** : - **-? /--help** :
显示帮助信息并退出。不能与其它参数混用。 Show help information and exit. Users should not use it with other parameters.
## 配置文件参数详解 ## Configuration file parameters in detail
### 通用配置参数 ### General configuration parameters
本节所列参数适用于所有功能模式。 The parameters listed in this section apply to all function modes.
- **filetype** : 要测试的功能,可选值为 `insert`, `query``subscribe`。分别对应插入、查询和订阅功能。每个配置文件中只能指定其中之一。 - **filetype** : The function to be tested, with optional values `insert`, `query` and `subscribe`. These correspond to the insert, query, and subscribe functions, respectively. Users can specify only one of these in each configuration file.
- **cfgdir** : TDengine 集群配置文件所在的目录,默认路径是 /etc/taos 。 **cfgdir**: specify the TDengine cluster configuration file's directory. The default path is /etc/taos.
- **host** : 指定要连接的 TDengine 服务端的 FQDN,默认值为 localhost。 - **host**: Specify the FQDN of the TDengine server to connect. The default value is `localhost`.
- **port** : 要连接的 TDengine 服务器的端口号,默认值为 6030。 - **port**: The port number of the TDengine server to connect to, the default value is `6030`.
- **user** : 用于连接 TDengine 服务端的用户名,默认为 root。 - **user**: The user name of the TDengine server to connect to, the default is `root`.
- **password** : 用于连接 TDengine 服务端的密码,默认值为 taosdata。 - **password**: The password to connect to the TDengine server, the default value is `taosdata`.
### 插入场景配置参数 ### Insert scenario configuration parameters
插入场景下 `filetype` 必须设置为 `insert`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) `filetype` must be set to `insert` in the insertion scenario. See [General Configuration Parameters](#General Configuration Parameters)
#### 数据库相关配置参数 #### Database related configuration parameters
创建数据库时的相关参数在 json 配置文件中的 `dbinfo` 中配置,具体参数如下。这些参数与 TDengine 中 `create database` 时所指定的数据库参数相对应。 The parameters related to database creation are configured in `dbinfo` in the json configuration file, as follows. These parameters correspond to the database parameters specified when `create database` in TDengine.
- **name** : 数据库名。 - **name**: specify the name of the database.
- **drop** : 插入前是否删除数据库,默认为 true。 - **drop**: indicate whether to delete the database before inserting. The default is true.
- **replica** : 创建数据库时指定的副本数。 - **replica**: specify the number of replicas when creating the database.
- **days** : 单个数据文件中存储数据的时间跨度,默认值为 10。 - **days**: specify the time span for storing data in a single data file. The default is 10.
- **cache** : 缓存块的大小,单位是 MB,默认值是 16。 - **cache**: specify the size of the cache blocks in MB. The default value is 16.
- **blocks** : 每个 vnode 中缓存块的数量,默认为 6。 - **blocks**: specify the number of cache blocks in each vnode. The default is 6.
- **precision** : 数据库时间精度,默认值为 "ms"。 - **precision**: specify the database time precision. The default value is "ms".
- **keep** : 保留数据的天数,默认值为 3650。 - **keep**: specify the number of days to keep the data. The default value is 3650.
- **minRows** : 文件块中的最小记录数,默认值为 100。 - **minRows**: specify the minimum number of records in the file block. The default value is 100.
- **maxRows** : 文件块中的最大记录数,默认值为 4096。 - **maxRows**: specify the maximum number of records in the file block. The default value is 4096.
- **comp** : 文件压缩标志,默认值为 2。 - **comp**: specify the file compression level. The default value is 2.
- **walLevel** : WAL 级别,默认为 1。 - **walLevel** : specify WAL level, default is 1.
- **cacheLast** : 是否允许将每个表的最后一条记录保留在内存中,默认值为 0,可选值为 0,1,2,3。 - **cacheLast**: indicate whether to allow the last record of each table to be kept in memory. The default value is 0. The value can be 0, 1, 2, or 3.
- **quorum** : 多副本模式下的写确认数量,默认值为 1。 - **quorum**: specify the number of writing acknowledgments in multi-replica mode. The default value is 1.
- **fsync** : 当 wal 设置为 2 时,fsync 的间隔时间,单位为 ms,默认值为 3000。 - **fsync**: specify the interval of fsync in ms when users set WAL to 2. The default value is 3000.
- **update** : 是否支持数据更新,默认值为 0, 可选值为 0, 1, 2。 - **update** : indicate whether to support data update, default value is 0, optional values are 0, 1, 2.
#### 超级表相关配置参数 #### Super table related configuration parameters
创建超级表时的相关参数在 json 配置文件中的 `super_tables` 中配置,具体参数如下表。 The parameters for creating super tables are configured in `super_tables` in the json configuration file, as shown below.
- **name**: 超级表名,必须配置,没有默认值。 - **name**: Super table name, mandatory, no default value.
- **child_table_exists** : 子表是否已经存在,默认值为 "no",可选值为 "yes" 或 "no"。 - **child_table_exists** : whether the child table already exists, default value is "no", optional value is "yes" or "no".
- **child_table_count** : 子表的数量,默认值为 10。 - **child_table_count** : The number of child tables, the default value is 10.
- **child_table_prefix** : 子表名称的前缀,必选配置项,没有默认值。 - **child_table_prefix** : The prefix of the child table name, mandatory configuration item, no default value.
- **escape_character** : 超级表和子表名称中是否包含转义字符,默认值为 "no",可选值为 "yes" 或 "no"。 - **escape_character**: specify the super table and child table names containing escape characters. By default is "no". The value can be "yes" or "no".
- **auto_create_table** : 仅当 insert_mode 为 taosc, rest, stmt 并且 childtable_exists 为 "no" 时生效,该参数为 "yes" 表示 taosBenchmark 在插入数据时会自动创建不存在的表;为 "no" 则表示先提前建好所有表再进行插入。 - **auto_create_table**: only when insert_mode is taosc, rest, stmt, and childtable_exists is "no". "yes" means taosBenchmark will automatically create non-existent tables when inserting data; "no" means that taosBenchmark will create all tables before inserting.
- **batch_create_tbl_num** : 创建子表时每批次的建表数量,默认为 10。注:实际的批数不一定与该值相同,当执行的 SQL 语句大于支持的最大长度时,会自动截断再执行,继续创建。 - **batch_create_tbl_num** : the number of tables per batch when creating sub-tables, default is 10. Note: the actual number of batches may not be the same as this value when the executed SQL statement is larger than the maximum length supported, it will be automatically truncated and re-executed to continue creating.
- **data_source** : 数据的来源,默认为 taosBenchmark 随机产生,可以配置为 "rand" 和 "sample"。为 "sample" 时使用 sample_file 参数指定的文件内的数据。 - **data_source**: specify the source of data-generating. Default is taosBenchmark randomly generated. Users can configure it as "rand" and "sample". When "sample" is used, taosBenchmark will use the data in the file specified by the `sample_file` parameter.
- **insert_mode** : 插入模式,可选项有 taosc, rest, stmt, sml, sml-rest, 分别对应普通写入、restful 接口写入、参数绑定接口写入、schemaless 接口写入、restful schemaless 接口写入 (由 taosAdapter 提供)。默认值为 taosc 。 - **insert_mode**: insertion mode with options taosc, rest, stmt, sml, sml-rest, corresponding to normal write, restful interface write, parameter binding interface write, schemaless interface write, restful schemaless interface write (provided by taosAdapter). The default value is taosc.
- **non_stop_mode** : 指定是否持续写入,若为 "yes" 则 insert_rows 失效,直到 Ctrl + C 停止程序,写入才会停止。默认值为 "no",即写入指定数量的记录后停止。注:即使在持续写入模式下 insert_rows 失效,但其也必须被配置为一个非零正整数。 - **non_stop_mode**: Specify whether to keep writing. If "yes", insert_rows will be disabled, and writing will not stop until Ctrl + C stops the program. The default value is "no", i.e., taosBenchmark will stop the writing after the specified number of rows are written. Note: insert_rows must be configured as a non-zero positive integer even if it fails in continuous write mode.
- **line_protocol** : 使用行协议插入数据,仅当 insert_mode 为 sml 或 sml-rest 时生效,可选项为 line, telnet, json。 - **line_protocol**: Insert data using line protocol. Only works when insert_mode is sml or sml-rest. The value can be `line`, `telnet`, or `json`.
- **tcp_transfer** : telnet 模式下的通信协议,仅当 insert_mode 为 sml-rest 并且 line_protocol 为 telnet 时生效。如果不配置,则默认为 http 协议。 - **tcp_transfer**: Communication protocol in telnet mode only takes effect when insert_mode is sml-rest, and line_protocol is telnet. If not configured, the default protocol is http.
- **insert_rows** : 每个子表插入的记录数,默认为 0 。 - **insert_rows** : The number of inserted rows per child table, default is 0.
- **childtable_offset** : 仅当 childtable_exists 为 yes 时生效,指定从超级表获取子表列表时的偏移量,即从第几个子表开始。 - **childtable_offset**: Effective only if childtable_exists is yes, specifies the offset when fetching the list of child tables from the super table, i.e., starting from the first child table.
- **childtable_limit** : 仅当 childtable_exists 为 yes 时生效,指定从超级表获取子表列表的上限。 - **childtable_limit**: Effective only when childtable_exists is yes, specifies the upper limit for fetching the list of child tables from the super table.
- **interlace_rows** : 启用交错插入模式并同时指定向每个子表每次插入的数据行数。交错插入模式是指依次向每张子表插入由本参数所指定的行数并重复这个过程,直到所有子表的数据都插入完成。默认值为 0, 即向一张子表完成数据插入后才会向下一张子表进行数据插入。 - **interlace_rows**: Enables interleaved insertion mode and specifies the number of rows of data to be inserted into each child table at a time. Staggered insertion mode means inserting the number of rows specified by this parameter into each sub-table and repeating the process until all sub-tables have been inserted. The default value is 0, i.e., data is inserted into one sub-table before the next sub-table is inserted.
- **insert_interval** : 指定交错插入模式的插入间隔,单位为 ms,默认值为 0。 只有当 `-B/--interlace-rows` 大于 0 时才起作用。意味着数据插入线程在为每个子表插入隔行扫描记录后,会等待该值指定的时间间隔后再进行下一轮写入。 - **insert_interval** : Specifies the insertion interval in ms for interleaved insertion mode. The default value is 0. It only works if `-B/--interlace-rows` is greater than 0. After inserting interlaced rows for each child table, the data insertion thread will wait for the interval specified by this value before proceeding to the next round of writes.
- **partial_col_num** : 若该值为正数 n 时, 则仅向前 n 列写入,仅当 insert_mode 为 taosc 和 rest 时生效,如果 n 为 0 则是向全部列写入。 - **partial_col_num**: If this value is a positive number n, only the first n columns are written to, only if insert_mode is taosc and rest, or all columns if n is 0.
- **disorder_ratio** : 指定乱序数据的百分比概率,其值域为 [0,50]。默认为 0,即没有乱序数据。 - **disorder_ratio** : Specifies the percentage probability of disordered data in the value range [0,50]. The default is 0, which means there is no disorder data.
- **disorder_range** : 指定乱序数据的时间戳回退范围。所生成的乱序时间戳为非乱序情况下应该使用的时间戳减去这个范围内的一个随机值。仅在 `-O/--disorder` 指定的乱序数据百分比大于 0 时有效。 - **disorder_range** : Specifies the timestamp fallback range for the disordered data. The generated disorder timestamp is the timestamp that should be used in the non-disorder case minus a random value in this range. Valid only if the percentage of disordered data specified by `-O/--disorder` is greater than 0.
- **timestamp_step** : 每个子表中插入数据的时间戳步长,单位与数据库的 `precision` 一致,默认值是 1。 - **timestamp_step**: The timestamp step for inserting data in each child table, in units consistent with the `precision` of the database, the default value is 1.
- **start_timestamp** : 每个子表的时间戳起始值,默认值是 now。 - **start_timestamp** : The timestamp start value of each sub-table, the default value is now.
- **sample_format** : 样本数据文件的类型,现在只支持 "csv" 。 - **sample_format**: The type of the sample data file, now only "csv" is supported.
- **sample_file** : 指定 csv 格式的文件作为数据源,仅当 data_source 为 sample 时生效。若 csv 文件内的数据行数小于等于 prepared_rand,那么会循环读取 csv 文件数据直到与 prepared_rand 相同;否则则会只读取 prepared_rand 个数的行的数据。也即最终生成的数据行数为二者取小。 - **sample_file**: Specify a CSV format file as the data source. It only works when data_source is a sample. If the number of rows in the CSV file is less than or equal to prepared_rand, then taosBenchmark will read the CSV file data cyclically until it is the same as prepared_rand; otherwise, taosBenchmark will read only the rows with the number of prepared_rand. The final number of rows of data generated is the smaller of the two.
- **use_sample_ts** : 仅当 data_source 为 sample 时生效,表示 sample_file 指定的 csv 文件内是否包含第一列时间戳,默认为 no。 若设置为 yes, 则使用 csv 文件第一列作为时间戳,由于同一子表时间戳不能重复,生成的数据量取决于 csv 文件内的数据行数相同,此时 insert_rows 失效。 - **use_sample_ts**: effective only when data_source is `sample`, indicates whether the CSV file specified by sample_file contains the first timestamp column. Default is no. If set to yes, the first column of the CSV file is used as `timestamp`. Since the timestamp of the same sub-table cannot be repeated, the amount of data generated depends on the same number of rows of data in the CSV file, and insert_rows will be invalidated.
- **tags_file** : 仅当 insert_mode 为 taosc, rest 的模式下生效。 最终的 tag 的数值与 childtable_count 有关,如果 csv 文件内的 tag 数据行小于给定的子表数量,那么会循环读取 csv 文件数据直到生成 childtable_count 指定的子表数量;否则则只会读取 childtable_count 行 tag 数据。也即最终生成的子表数量为二者取小。 - **tags_file** : only works when insert_mode is taosc, rest. The final tag value is related to the childtable_count. Suppose the tag data rows in the CSV file are smaller than the given number of child tables. In that case, taosBenchmark will read the CSV file data cyclically until the number of child tables specified by childtable_count is generated. Otherwise, taosBenchmark will read the childtable_count rows of tag data only. The final number of child tables generated is the smaller of the two.
#### 标签列与数据列配置参数 #### Tag and Data Column Configuration Parameters
指定超级表标签列与数据列的配置参数分别在 `super_tables` 中的 `columns``tag` 中。 The configuration parameters for specifying super table tag columns and data columns are in `columns` and `tag` in `super_tables`, respectively.
- **type** : 指定列类型,可选值请参考 TDengine 支持的数据类型。 - **type**: Specify the column type. For optional values, please refer to the data types supported by TDengine.
注:JSON 数据类型比较特殊,只能用于标签,当使用 JSON 类型作为 tag 时有且只能有这一个标签,此时 count 和 len 代表的意义分别是 JSON tag 内的 key-value pair 的个数和每个 KV pair 的 value 的值的长度,value 默认为 string。 Note: JSON data type is unique and can only be used for tags. When using JSON type as a tag, there is and can only be this one tag. At this time, `count` and `len` represent the meaning of the number of key-value pairs within the JSON tag and the length of the value of each KV pair. Respectively, the value is a string by default.
- **len** : 指定该数据类型的长度,对 NCHAR,BINARY 和 JSON 数据类型有效。如果对其他数据类型配置了该参数,若为 0 , 则代表该列始终都是以 null 值写入;如果不为 0 则被忽略。 - **len**: Specifies the length of this data type, valid for NCHAR, BINARY, and JSON data types. If this parameter is configured for other data types, a value of 0 means that the column is always written with a null value; if it is not 0, it is ignored.
- **count** : 指定该类型列连续出现的数量,例如 "count": 4096 即可生成 4096 个指定类型的列。 - **count**: Specifies the number of consecutive occurrences of the column type, e.g., "count": 4096 generates 4096 columns of the specified type.
- **name** : 列的名字,若与 count 同时使用,比如 "name":"current", "count":3, 则 3 个列的名字分别为 current, current_2. current_3。 - **name** : The name of the column, if used together with count, e.g. "name": "current", "count":3, then the names of the 3 columns are current, current_2. current_3.
- **min** : 数据类型的 列/标签 的最小值。 - **min**: The minimum value of the column/label of the data type.
- **max** : 数据类型的 列/标签 的最大值。 - **max**: The maximum value of the column/label of the data type.
- **values** : nchar/binary 列/标签的值域,将从值中随机选择。 - **values**: The value field of the nchar/binary column/label, which will be chosen randomly from the values.
#### 插入行为配置参数 #### insertion behavior configuration parameters
- **thread_count** : 插入数据的线程数量,默认为 8。 - **thread_count**: specify the number of threads to insert data. Default is 8.
- **create_table_thread_count** : 建表的线程数量,默认为 8。 - **create_table_thread_count** : The number of threads to build the table, default is 8.
- **connection_pool_size** : 预先建立的与 TDengine 服务端之间的连接的数量。若不配置,则与所指定的线程数相同。 - **connection_pool_size** : The number of pre-established connections to the TDengine server. If not configured, it is the same number of threads specified.
- **result_file** : 结果输出文件的路径,默认值为 ./output.txt。 - **result_file** : The path to the result output file, the default value is . /output.txt.
- **confirm_parameter_prompt** : 开关参数,要求用户在提示后确认才能继续。默认值为 false 。 - **confirm_parameter_prompt**: The switch parameter requires the user to confirm after the prompt to continue. The default value is false.
- **interlace_rows** : 启用交错插入模式并同时指定向每个子表每次插入的数据行数。交错插入模式是指依次向每张子表插入由本参数所指定的行数并重复这个过程,直到所有子表的数据都插入完成。默认值为 0, 即向一张子表完成数据插入后才会向下一张子表进行数据插入。 - **interlace_rows**: Enables interleaved insertion mode and specifies the number of rows of data to be inserted into each child table at a time. Interleaved insertion mode means inserting the number of rows specified by this parameter into each sub-table and repeating the process until all sub-tables are inserted. The default value is 0, which means that data will be inserted into the following child table only after data is inserted into one child table.
`super_tables` 中也可以配置该参数,若配置则以 `super_tables` 中的配置为高优先级,覆盖全局设置。 This parameter can also be configured in `super_tables`, and if so, the configuration in `super_tables` takes precedence and overrides the global setting.
- **insert_interval** : - **insert_interval** :
指定交错插入模式的插入间隔,单位为 ms,默认值为 0。 只有当 `-B/--interlace-rows` 大于 0 时才起作用。意味着数据插入线程在为每个子表插入隔行扫描记录后,会等待该值指定的时间间隔后再进行下一轮写入。 Specifies the insertion interval in ms for interleaved insertion mode. The default value is 0. Only works if `-B/--interlace-rows` is greater than 0. It means that after inserting interlace rows for each child table, the data insertion thread will wait for the interval specified by this value before proceeding to the next round of writes.
`super_tables` 中也可以配置该参数,若配置则以 `super_tables` 中的配置为高优先级,覆盖全局设置。 This parameter can also be configured in `super_tables`, and if configured, the configuration in `super_tables` takes high priority, overriding the global setting.
- **num_of_records_per_req** : - **num_of_records_per_req** :
每次向 TDegnine 请求写入的数据行数,默认值为 30000 。当其设置过大时,TDegnine 客户端驱动会返回相应的错误信息,此时需要调低这个参数的设置以满足写入要求。 The number of rows of data to be written per request to TDengine, the default value is 30000. When it is set too large, the TDengine client driver will return the corresponding error message, so you need to lower the setting of this parameter to meet the writing requirements.
- **prepare_rand** : 生成的随机数据中唯一值的数量。若为 1 则表示所有数据都相同。默认值为 10000 。 - **prepare_rand**: The number of unique values in the generated random data. A value of 1 means that all data are the same. The default value is 10000.
### 查询场景配置参数 ### Query scenario configuration parameters
查询场景下 `filetype` 必须设置为 `qeury`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) `filetype` must be set to `query` in the query scenario. See [General Configuration Parameters](#General Configuration Parameters) for details of this parameter and other general parameters
#### 执行指定查询语句的配置参数 #### Configuration parameters for executing the specified query statement
查询子表或者普通表的配置参数在 `specified_table_query` 中设置。 The configuration parameters for querying the sub-tables or the normal tables are set in `specified_table_query`.
- **query_interval** : 查询时间间隔,单位是秒,默认值为 0。 - **query_interval** : The query interval in seconds, the default value is 0.
- **threads** : 执行查询 SQL 的线程数,默认值为 1。 - **threads**: The number of threads to execute the query SQL, the default value is 1.
- **sqls** - **sqls**.
- **sql**: 执行的 SQL 命令,必填。 - **sql**: the SQL command to be executed.
- **result**: 保存查询结果的文件,未指定则不保存。 - **result**: the file to save the query result. If it is unspecified, taosBenchark will not save the result.
#### 查询超级表的配置参数 #### Configuration parameters of query super table
查询超级表的配置参数在 `super_table_query` 中设置。 The configuration parameters of the super table query are set in `super_table_query`.
- **stblname** : 指定要查询的超级表的名称,必填。 - **stblname**: Specify the name of the super table to be queried, required.
- **query_interval** : 查询时间间隔,单位是秒,默认值为 0。 - **query_interval** : The query interval in seconds, the default value is 0.
- **threads** : 执行查询 SQL 的线程数,默认值为 1。 - **threads**: The number of threads to execute the query SQL, the default value is 1.
- **sqls** - **sqls** : The default value is 1.
- **sql** : 执行的 SQL 命令,必填;对于超级表的查询 SQL,在 SQL 命令中保留 "xxxx",程序会自动将其替换为超级表的所有子表名。 - **sql**: The SQL command to be executed. For the query SQL of super table, keep "xxxx" in the SQL command. The program will automatically replace it with all the sub-table names of the super table.
替换为超级表中所有的子表名。 Replace it with all the sub-table names in the super table.
- **result** : 保存查询结果的文件,未指定则不保存。 - **result**: The file to save the query result. If not specified, taosBenchmark will not save result.
### 订阅场景配置参数 ### Subscription scenario configuration parameters
订阅场景下 `filetype` 必须设置为 `subscribe`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) `filetype` must be set to `subscribe` in the subscription scenario. See [General Configuration Parameters](#General Configuration Parameters) for details of this and other general parameters
#### 执行指定订阅语句的配置参数 #### Configuration parameters for executing the specified subscription statement
订阅子表或者普通表的配置参数在 `specified_table_query` 中设置。 The configuration parameters for subscribing to a sub-table or a generic table are set in `specified_table_query`.
- **threads** : 执行 SQL 的线程数,默认为 1。 - **threads**: The number of threads to execute SQL, default is 1.
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0。 - **interval**: The time interval to execute the subscription, in seconds, default is 0.
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"。 - **restart** : "yes" means start a new subscription, "no" means continue the previous subscription, the default value is "no".
- **keepProgress** : "yes" 表示保留订阅进度,"no" 表示不保留,默认值为 "no"。 - **keepProgress**: "yes" means keep the progress of the subscription, "no" means don't keep it, and the default value is "no".
- **resubAfterConsume** : "yes" 表示取消之前的订阅然后再次订阅, "no" 表示继续之前的订阅,默认值为 "no"。 - **resubAfterConsume**: "yes" means cancel the previous subscription and then subscribe again, "no" means continue the previous subscription, and the default value is "no".
- **sqls** - **sqls** : The default value is "no".
- **sql** : 执行的 SQL 命令,必填。 - **sql** : The SQL command to be executed, required.
- **result** : 保存查询结果的文件,未指定则不保存。 - **result** : The file to save the query result, unspecified is not saved.
#### 订阅超级表的配置参数 #### Configuration parameters for subscribing to supertables
订阅超级表的配置参数在 `super_table_query` 中设置。 The configuration parameters for subscribing to a super table are set in `super_table_query`.
- **stblname** : 要订阅的超级表名称,必填。 - **stblname**: The name of the super table to subscribe.
- **threads** : 执行 SQL 的线程数,默认为 1。 - **threads**: The number of threads to execute SQL, default is 1.
- **interva** : 执行订阅的时间间隔,单位为秒,默认为 0。 - **interval**: The time interval to execute the subscription, in seconds, default is 0.
- **restart** : "yes" 表示开始新的订阅,"no" 表示继续之前的订阅,默认值为 "no"。 - **restart** : "yes" means start a new subscription, "no" means continue the previous subscription, the default value is "no".
- **keepProgress** : "yes" 表示保留订阅进度,"no" 表示不保留,默认值为 "no"。 - **keepProgress**: "yes" means keep the progress of the subscription, "no" means don't keep it, and the default value is "no".
- **resubAfterConsume** : "yes" 表示取消之前的订阅然后再次订阅, "no" 表示继续之前的订阅,默认值为 "no"。 - **resubAfterConsume**: "yes" means cancel the previous subscription and then subscribe again, "no" means continue the previous subscription, and the default value is "no".
- **sqls** - **sqls** : The default value is "no".
- **sql** : 执行的 SQL 命令,必填;对于超级表的查询 SQL,在 SQL 命令中保留 "xxxx",程序会自动将其替换为超级表的所有子表名。 - **sql**: SQL command to be executed, required; for the query SQL of the super table, keep "xxxx" in the SQL command, and the program will replace it with all the sub-table names of the super table automatically.
替换为超级表中所有的子表名。 Replace it with all the sub-table names in the super table.
- **result** : 保存查询结果的文件,未指定则不保存。 - **result**: The file to save the query result, if not specified, it will not be saved.
--- ---
title: taosdump title: taosdump
description: "taosdump 是一个支持从运行中的 TDengine 集群备份数据并将备份的数据恢复到相同或另一个运行中的 TDengine 集群中的工具应用程序" description: "taosdump is a tool application that supports backing up data from a running TDengine cluster and restoring the backed up data to the same or another running TDengine cluster."
--- ---
## 简介 ## Introduction
taosdump 是一个支持从运行中的 TDengine 集群备份数据并将备份的数据恢复到相同或另一个运行中的 TDengine 集群中的工具应用程序。 taosdump is a tool application that supports backing up data from a running TDengine cluster and restoring the backed up data to the same or another running TDengine cluster.
taosdump 可以用数据库、超级表或普通表作为逻辑数据单元进行备份,也可以对数据库、超级 taosdump can back up a database, a super table, or a normal table as a logical data unit or backup data records in the database, super tables, and normal tables. When using taosdump, you can specify the directory path for data backup. If you do not specify a directory, taosdump will back up the data to the current directory by default.
表和普通表中指定时间段内的数据记录进行备份。使用时可以指定数据备份的目录路径,如果
不指定位置,taosdump 默认会将数据备份到当前目录。
如果指定的位置已经有数据文件,taosdump 会提示用户并立即退出,避免数据被覆盖。这意味着同一路径只能被用于一次备份。 Suppose the specified location already has data files. In that case, taosdump will prompt the user and exit immediately to avoid data overwriting which means that the same path can only be used for one backup.
如果看到相关提示,请小心操作。 Please be careful if you see a prompt for this.
taosdump 是一个逻辑备份工具,它不应被用于备份任何原始数据、环境设置、 taosdump is a logical backup tool and should not be used to back up any raw data, environment settings,
硬件信息、服务端配置或集群的拓扑结构。taosdump 使用 Users should not use taosdump to back up raw data, environment settings, hardware information, server configuration, or cluster topology. taosdump uses [Apache AVRO](https://avro.apache.org/) as the data file format to store backup data.
[ Apache AVRO ](https://avro.apache.org/)作为数据文件格式来存储备份数据。
## 安装 ## Installation
taosdump 有两种安装方式: There are two ways to install taosdump:
- 安装 taosTools 官方安装包, 请从[所有下载链接](https://www.taosdata.com/all-downloads)页面找到 taosTools 并下载安装。 - Install the taosTools official installer. Please find taosTools from [All download links](https://www.taosdata.com/all-downloads) page and download and install it.
- 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](https://github.com/taosdata/taos-tools) 仓库。 - Compile taos-tools separately and install it. Please refer to the [taos-tools](https://github.com/taosdata/taos-tools) repository for details.
## 常用使用场景 ## Common usage scenarios
### taosdump 备份数据 ### taosdump backup data
1. 备份所有数据库:指定 `-A``--all-databases` 参数; 1. backing up all databases: specify `-A` or `-all-databases` parameter.
2. 备份多个指定数据库:使用 `-D db1,db2,...` 参数; 2. backup multiple specified databases: use `-D db1,db2,... ` parameters; 3.
3. 备份指定数据库中的某些超级表或普通表:使用 `dbname stbname1 stbname2 tbname1 tbname2 ...` 参数,注意这种输入序列第一个参数为数据库名称,且只支持一个数据库,第二个和之后的参数为该数据库中的超级表或普通表名称,中间以空格分隔; 3. back up some super or normal tables in the specified database: use `-dbname stbname1 stbname2 tbname1 tbname2 ... ` parameters. Note that the first parameter of this input sequence is the database name, and only one database is supported. The second and subsequent parameters are the names of super or normal tables in that database, separated by spaces.
4. 备份系统 log 库:TDengine 集群通常会包含一个系统数据库,名为 `log`,这个数据库内的数据为 TDengine 自我运行的数据,taosdump 默认不会对 log 库进行备份。如果有特定需求对 log 库进行备份,可以使用 `-a``--allow-sys` 命令行参数。 4. back up the system log database: TDengine clusters usually contain a system database named `log`. The data in this database is the data that TDengine runs itself, and the taosdump will not back up the log database by default. If users need to back up the log database, users can use the `-a` or `-allow-sys` command line parameter.
5. “宽容”模式备份:taosdump 1.4.1 之后的版本提供 `-n` 参数和 `-L` 参数,用于备份数据时不使用转义字符和“宽容”模式,可以在表名、列名、标签名没使用转义字符的情况下减少备份数据时间和备份数据占用空间。如果不确定符合使用 `-n``-L` 条件时请使用默认参数进行“严格”模式进行备份。转义字符的说明请参考[官方文档](/taos-sql/escape) 5. Loose mode backup: taosdump version 1.4.1 onwards provides `-n` and `-L` parameters for backing up data without using escape characters and "loose" mode, which can reduce the number of backups if table names, column names, tag names do not use This can reduce the backup data time and backup data footprint if table names, column names, and tag names do not use `escape character`. If you are unsure about using `-n` and `-L` conditions, please use the default parameters for "strict" mode backup. See the [official documentation](/taos-sql/escape) for a description of escaped characters.
:::tip :::tip
- taosdump 1.4.1 之后的版本提供 `-I` 参数,用于解析 avro 文件 schema 和数据,如果指定 `-s` 参数将只解析 schema。 - taosdump versions after 1.4.1 provide the `-I` argument for parsing Avro file schema and data. If users specify `-s` then only taosdump will parse schema.
- taosdump 1.4.2 之后的备份使用 `-B` 参数指定的批次数,默认值为 16384,如果在某些环境下由于网络速度或磁盘性能不足导致 "Error actual dump .. batch .." 可以通过 `-B` 参数挑战为更小的值进行尝试。 - Backups after taosdump 1.4.2 use the batch count specified by the `-B` parameter. The default value is 16384. If, in some environments, low network speed or disk performance causes "Error actual dump ... batch ..." can be tried by challenging the `-B` parameter to a smaller value.
::: :::
### taosdump 恢复数据 ### taosdump recover data
恢复指定路径下的数据文件:使用 `-i` 参数加上数据文件所在路径。如前面提及,不应该使用同一个目录备份不同数据集合,也不应该在同一路径多次备份同一数据集,否则备份数据会造成覆盖或多次备份。 Restore the data file in the specified path: use the `-i` parameter plus the path to the data file. You should not use the same directory to backup different data sets, and you should not backup the same data set multiple times in the same path. Otherwise, the backup data will cause overwriting or multiple backups.
:::tip :::tip
taosdump 内部使用 TDengine stmt binding API 进行恢复数据的写入,为提高数据恢复性能,目前使用 16384 为一次写入批次。如果备份数据中有比较多列数据,可能会导致产生 "WAL size exceeds limit" 错误,此时可以通过使用 `-B` 参数调整为一个更小的值进行尝试。 taosdump internally uses TDengine stmt binding API for writing recovery data and currently uses 16384 as one write batch for better data recovery performance. If there are more columns in the backup data, it may cause a "WAL size exceeds limit" error. You can try to adjust to a smaller value by using the `-B` parameter.
::: :::
## 详细命令行参数列表 ## Detailed command line parameter list
以下为 taosdump 详细命令行参数列表: The following is a detailed list of taosdump command line arguments.
``` ```
Usage: taosdump [OPTION...] dbname [tbname ...] Usage: taosdump [OPTION...] dbname [tbname ...]
......
--- ---
title: TDengine 命令行(CLI) title: TDengine Command Line (CLI)
sidebar_label: TDengine CLI sidebar_label: TDengine CLI
description: TDengine CLI 的使用说明和技巧 description: Instructions and tips for using the TDengine CLI
--- ---
TDengine 命令行程序(以下简称 TDengine CLI)是用户操作 TDengine 实例并与之交互的最简洁最常用的方式。 The TDengine command-line application (hereafter referred to as TDengine CLI) is the cleanest and most common way for users to manipulate and interact with TDengine instances.
## 安装 ## Installation
如果在 TDengine 服务器端执行,无需任何安装,已经自动安装好。如果要在非 TDengine 服务器端运行,需要安装 TDengine 客户端驱动,具体安装,请参考 [连接器](/reference/connector/) If executed on the TDengine server-side, there is no need for additional installation as it is already installed automatically. To run on the non-TDengine server-side, the TDengine client driver needs to be installed. For details, please refer to [connector](/reference/connector/).
## 执行 ## Execution
要进入 TDengine CLI,您只要在 Linux 终端或Windos 终端执行 `taos` 即可。 To access the TDengine CLI, you can execute `taos` from a Linux terminal or Windows terminal.
```bash ```bash
taos taos
``` ```
如果连接服务成功,将会打印出欢迎消息和版本信息。如果失败,则会打印错误消息出来(请参考 [FAQ](/train-faq/faq) 来解决终端连接服务端失败的问题)。TDengine CLI 的提示符号如下: TDengine will display a welcome message and version information if the connection to the service is successful. If it fails, TDengine will print an error message (see [FAQ](/train-faq/faq) to solve the problem of terminal connection failure to the server.) The TDengine CLI prompt symbols are as follows:
```cmd ```cmd
taos> taos>
``` ```
进入CLI后,你可执行各种SQL语句,包括插入、查询以及各种管理命令。 After entering the CLI, you can execute various SQL statements, including inserts, queries, and administrative commands.
## 执行 SQL 脚本 ## Execute SQL scripts
在 TDengine CLI 里可以通过 `source` 命令来运行 SQL 命令脚本。 Run SQL command scripts in the TDengine CLI via the `source` command.
```sql ```sql
taos> source <filename>; taos> source <filename>;
``` ```
## 在线修改显示字符宽度 ## Modify display character width online
可以在 TDengine CLI 里使用如下命令调整字符显示宽度 Users can adjust the character display width in TDengine CLI with the following command:
```sql ```sql
taos> SET MAX_BINARY_DISPLAY_WIDTH <nn>; taos> SET MAX_BINARY_DISPLAY_WIDTH <nn>;
``` ```
如显示的内容后面以...结尾时,表示该内容已被截断,可通过本命令修改显示字符宽度以显示完整的内容。 If the displayed content is followed by `...` you can use this command to change the display width to display the full content.
## 命令行参数 ## Command Line Parameters
您可通过配置命令行参数来改变 TDengine CLI 的行为。以下为常用的几个命令行参数: You can change the behavior of TDengine CLI by configuring command-line parameters. The following command-line arguments are commonly used.
- -h, --host=HOST: 要连接的 TDengine 服务端所在服务器的 FQDN, 默认为连接本地服务 -h, --host=HOST: FQDN of the server where the TDengine server is to be connected. Default is to connect to the local service
- -P, --port=PORT: 指定服务端所用端口号 -P, --port=PORT: Specify the port number to be used by the server
- -u, --user=USER: 连接时使用的用户名 -u, --user=USER: the user name to use when connecting
- -p, --password=PASSWORD: 连接服务端时使用的密码 -p, --password=PASSWORD: the password to use when connecting to the server
- -?, --help: 打印出所有命令行参数 --?, --help: print out all command-line arguments
还有更多其他参数: And many more parameters.
- -c, --config-dir: 指定配置文件目录,默认为 `/etc/taos`,该目录下的配置文件默认名称为 taos.cfg -c, --config-dir: Specify the configuration file directory. The default is `/etc/taos`, and the default name of the configuration file in this directory is taos.cfg
- -C, --dump-config: 打印 -c 指定的目录中 taos.cfg 的配置参数 -C, --dump-config: Print the configuration parameters of taos.cfg in the directory specified by -c
- -d, --database=DATABASE: 指定连接到服务端时使用的数据库 -d, --database=DATABASE: Specify the database to use when connecting to the server
- -D, --directory=DIRECTORY: 导入指定路径中的 SQL 脚本文件 -D, --directory=DIRECTORY: Import the SQL script file in the specified path
- -f, --file=FILE: 以非交互模式执行 SQL 脚本文件 -f, --file=FILE: Execute the SQL script file in non-interactive mode
- -k, --check=CHECK: 指定要检查的表 -k, --check=CHECK: Specify the table to be checked
- -l, --pktlen=PKTLEN: 网络测试时使用的测试包大小 -l, --pktlen=PKTLEN: Test package size to be used for network testing
- -n, --netrole=NETROLE: 网络连接测试时的测试范围,默认为 startup, 可选值为 client, server, rpc, startup, sync, speed, fqdn -n, --netrole=NETROLE: test scope for network connection test, default is `startup`, The value can be `client`, `server`, `rpc`, `startup`, `sync`, `speed`, or `fqdn`.
- -r, --raw-time: 将时间输出出 uint64_t -r, --raw-time: output the time to uint64_t
- -s, --commands=COMMAND: 以非交互模式执行的 SQL 命令 -s, --commands=COMMAND: execute SQL commands in non-interactive mode
- -S, --pkttype=PKTTYPE: 指定网络测试所用的包类型,默认为 TCP。只有 netrole 为 speed 时既可以指定为 TCP 也可以指定为 UDP -S, --pkttype=PKTTYPE: Specify the packet type used for network testing. The default is TCP. only `netrole` can be specified as either TCP or UDP when speed is specified
- -T, --thread=THREADNUM: 以多线程模式导入数据时的线程数 -T, --thread=THREADNUM: The number of threads to import data in multi-threaded mode
- -s, --commands: 在不进入终端的情况下运行 TDengine 命令 -s, --commands: Run TDengine commands without entering the terminal
- -z, --timezone=TIMEZONE: 指定时区,默认为本地 -z, --timezone=TIMEZONE: Specify time zone. Default is local
- -V, --version: 打印出当前版本号 -V, --version: Print out the current version number
示例: Example.
```bash ```bash
taos -h h1.taos.com -s "use db; show tables;" taos -h h1.taos.com -s "use db; show tables;"
``` ```
## TDengine CLI 小技巧 ## TDengine CLI tips
- 可以使用上下光标键查看历史输入的指令 - You can use the up and down cursor keys to see the history of commands entered
- 修改用户密码:在 shell 中使用 `alter user` 命令,缺省密码为 taosdata - Change user password: use `alter user` command in TDengine CLI. The default password is `taosdata`.
- ctrl+c 中止正在进行中的查询 - ctrl+c to stop a query in progress
- 执行 `RESET QUERY CACHE` 可清除本地缓存的表 schema - Execute `RESET QUERY CACHE` to clear the local cache of the table schema
- 批量执行 SQL 语句。可以将一系列的 shell 命令(以英文 ; 结尾,每个 SQL 语句为一行)按行存放在文件里,在 shell 里执行命令 `source <file-name>` 自动执行该文件里所有的 SQL 语句 - Execute SQL statements in batches. You can store a series of shell commands (ending with ;, one line for each SQL statement) in a file and execute the command `source <file-name>` in the shell to execute all SQL statements in that file automatically
- 输入 q 回车,退出 taos shell - Enter `q` to exit taos shell
...@@ -475,6 +475,15 @@ charset CP936 ...@@ -475,6 +475,15 @@ charset CP936
## Time Parameters ## Time Parameters
### precision
| Attribute | Description |
| ------------- | ------------------------------------------------- |
| Applicable | Server only |
| Meaning | Time precision used for each database |
| Value Range | ms: millisecond; us: microsecond ; ns: nanosecond |
| Default Value | ms |
### rpcTimer ### rpcTimer
| Attribute | Description | | Attribute | Description |
......
--- ---
title: 文件目录结构 title: File directory structure
description: "TDengine 安装目录说明" description: "TDengine installation directory description"
--- ---
安装 TDengine 后,默认会在操作系统中生成下列目录或文件: When TDengine is installed, the following directories or files will be created in the operating system by default.
| 目录/文件 | 说明 | | directory/file | description |
| ------------------------- | -------------------------------------------------------------------- | | ------------------------- | -------------------------------------------------------------------- |
| /usr/local/taos/bin | TDengine 可执行文件目录。其中的执行文件都会软链接到/usr/bin 目录下。 | | /usr/local/taos/bin | The TDengine executable directory. The executable files are soft-linked to the /usr/bin directory. |
| /usr/local/taos/driver | TDengine 动态链接库目录。会软链接到/usr/lib 目录下。 | | /usr/local/taos/driver | The TDengine dynamic link library directory. It is soft-linked to the /usr/lib directory. |
| /usr/local/taos/examples | TDengine 各种语言应用示例目录。 | | /usr/local/taos/examples | The TDengine various language application examples directory. |
| /usr/local/taos/include | TDengine 对外提供的 C 语言接口的头文件。 | | /usr/local/taos/include | The header files for TDengine's external C interface. |
| /etc/taos/taos.cfg | TDengine 默认[配置文件] | | /etc/taos/taos.cfg | TDengine default [configuration file] |
| /var/lib/taos | TDengine 默认数据文件目录。可通过[配置文件]修改位置。 | | /var/lib/taos | TDengine's default data file directory. The location can be changed via [configuration file]. |
| /var/log/taos | TDengine 默认日志文件目录。可通过[配置文件]修改位置。 | | /var/log/taos | TDengine default log file directory. The location can be changed via [configure file]. |
## 可执行文件 ## Executable files
TDengine 的所有可执行文件默认存放在 _/usr/local/taos/bin_ 目录下。其中包括: All executable files of TDengine are stored in the _/usr/local/taos/bin_ directory by default. These include.
- _taosd_:TDengine 服务端可执行文件 - _taosd_: TDengine server-side executable files
- _taos_:TDengine Shell 可执行文件 - _taos_: TDengine shell executable
- _taosdump_:数据导入导出工具 - _taosdump_: data import and export tool
- _taosBenchmark_:TDengine 测试工具 - _taosBenchmark_: TDengine testing tool
- _remove.sh_:卸载 TDengine 的脚本,请谨慎执行,链接到/usr/bin 目录下的**rmtaos**命令。会删除 TDengine 的安装目录/usr/local/taos,但会保留/etc/taos、/var/lib/taos、/var/log/taos - _remove.sh_: script to uninstall TDengine, please execute it carefully, link to the **rmtaos** command in the /usr/bin directory. Will remove the TDengine installation directory /usr/local/taos, but will keep /etc/taos, /var/lib/taos, /var/log/taos
- _taosadapter_: 提供 RESTful 服务和接受其他多种软件写入请求的服务端可执行文件 - _taosadapter_: server-side executable that provides RESTful services and accepts writing requests from a variety of other software
- _tarbitrator_: 提供双节点集群部署的仲裁功能 - _tarbitrator_: provides arbitration for two-node cluster deployments
- _run_taosd_and_taosadapter.sh_:同时启动 taosd 和 taosAdapter 的脚本 - _run_taosd_and_taosadapter.sh_: script to start both taosd and taosAdapter
- _TDinsight.sh_:用于下载 TDinsight 并安装的脚本 - _TDinsight.sh_: script to download TDinsight and install it
- _set_core.sh_:用于方便调试设置系统生成 core dump 文件的脚本 - _set_core.sh_: script for setting up the system to generate core dump files for easy debugging
- _taosd-dump-cfg.gdb_:用于方便调试 taosd 的 gdb 执行脚本。 - _taosd-dump-cfg.gdb_: script to facilitate debugging of taosd's gdb execution.
:::note :::note
2.4.0.0 版本之后的 taosBenchmark 和 taosdump 需要安装独立安装包 taosTools。 taosBenchmark and taosdump after version 2.4.0.0 require taosTools as a standalone installation.
::: :::
:::tip :::tip
您可以通过修改系统配置文件 taos.cfg 来配置不同的数据目录和日志目录。 You can configure different data directories and log directories by modifying the system configuration file taos.cfg.
::: :::
...@@ -123,7 +123,7 @@ TDengine REST API 详情请参考[官方文档](/reference/rest-api/)。 ...@@ -123,7 +123,7 @@ TDengine REST API 详情请参考[官方文档](/reference/rest-api/)。
### 使用 Docker 容器运行 TDengine server 和 taosAdapter ### 使用 Docker 容器运行 TDengine server 和 taosAdapter
在 TDegnine 2.4.0.0 之后版本的 Docker 容器,开始提供一个独立运行的组件 taosAdapter,代替之前版本 TDengine 中 taosd 进程中内置的 http server。taosAdapter 支持通过 RESTful 接口对 TDengine server 的数据写入和查询能力,并提供和 InfluxDB/OpenTSDB 兼容的数据摄取接口,允许 InfluxDB/OpenTSDB 应用程序无缝移植到 TDengine。在新版本 Docker 镜像中,默认启用了 taosAdapter,也可以使用 docker run 命令中设置 TAOS_DISABLE_ADAPTER=true 来禁用 taosAdapter;也可以在 docker run 命令中单独使用 taosAdapter,而不运行 taosd 。 在 TDengine 2.4.0.0 之后版本的 Docker 容器,开始提供一个独立运行的组件 taosAdapter,代替之前版本 TDengine 中 taosd 进程中内置的 http server。taosAdapter 支持通过 RESTful 接口对 TDengine server 的数据写入和查询能力,并提供和 InfluxDB/OpenTSDB 兼容的数据摄取接口,允许 InfluxDB/OpenTSDB 应用程序无缝移植到 TDengine。在新版本 Docker 镜像中,默认启用了 taosAdapter,也可以使用 docker run 命令中设置 TAOS_DISABLE_ADAPTER=true 来禁用 taosAdapter;也可以在 docker run 命令中单独使用 taosAdapter,而不运行 taosd 。
注意:如果容器中运行 taosAdapter,需要根据需要映射其他端口,具体端口默认配置和修改方法请参考[taosAdapter 文档](/reference/taosadapter/) 注意:如果容器中运行 taosAdapter,需要根据需要映射其他端口,具体端口默认配置和修改方法请参考[taosAdapter 文档](/reference/taosadapter/)
......
...@@ -49,7 +49,7 @@ namespace insertCn ...@@ -49,7 +49,7 @@ namespace insertCn
String table = stable + "_subtable_1"; String table = stable + "_subtable_1";
var colData = new List<Object>{1637064040000,1,"涛思数据","保利广场","Beijing","China", var colData = new List<Object>{1637064040000,1,"涛思数据","保利广场","Beijing","China",
1637064041000,2,"涛思数据taosdata","保利广场baoli","Beijing","China", 1637064041000,2,"涛思数据taosdata","保利广场baoli","Beijing","China",
1637064042000,3,"TDegnine涛思数据","time广场","NewYork","US", 1637064042000,3,"TDengine涛思数据","time广场","NewYork","US",
1637064043000,4,"4涛思数据","4广场南部","London","UK", 1637064043000,4,"4涛思数据","4广场南部","London","UK",
1637064044000,5,"涛思数据5","!广场路中部123","Tokyo","JP", 1637064044000,5,"涛思数据5","!广场路中部123","Tokyo","JP",
1637064045000,6,"taos涛思数据6","青年广场123号!","Washin","DC", 1637064045000,6,"taos涛思数据6","青年广场123号!","Washin","DC",
...@@ -99,7 +99,7 @@ namespace insertCn ...@@ -99,7 +99,7 @@ namespace insertCn
{ {
var colData = new List<Object>{1637064040000,1,"涛思数据","保利广场","Beijing","China", var colData = new List<Object>{1637064040000,1,"涛思数据","保利广场","Beijing","China",
1637064041000,2,"涛思数据taosdata","保利广场baoli","Beijing","China", 1637064041000,2,"涛思数据taosdata","保利广场baoli","Beijing","China",
1637064042000,3,"TDegnine涛思数据","time广场","NewYork","US", 1637064042000,3,"TDengine涛思数据","time广场","NewYork","US",
1637064043000,4,"4涛思数据","4广场南部","London","UK", 1637064043000,4,"4涛思数据","4广场南部","London","UK",
1637064044000,5,"涛思数据5","!广场路中部123","Tokyo","JP", 1637064044000,5,"涛思数据5","!广场路中部123","Tokyo","JP",
1637064045000,6,"taos涛思数据6","青年广场123号!","Washin","DC", 1637064045000,6,"taos涛思数据6","青年广场123号!","Washin","DC",
......
...@@ -10248,6 +10248,9 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS ...@@ -10248,6 +10248,9 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
tstrncpy(pTableMetaInfo1->aliasName, subInfo->aliasName.z, subInfo->aliasName.n + 1); tstrncpy(pTableMetaInfo1->aliasName, subInfo->aliasName.z, subInfo->aliasName.n + 1);
} }
if (TPARSER_HAS_TOKEN(pSqlNode->interval.interval) && pSub->order.orderColId == INT32_MIN) {
pSub->order.orderColId = PRIMARYKEY_TIMESTAMP_COL_INDEX;
}
// NOTE: order mix up in subquery not support yet. // NOTE: order mix up in subquery not support yet.
pQueryInfo->order = pSub->order; pQueryInfo->order = pSub->order;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册