提交 8ecd9eb0 编写于 作者: G gccgdb1234

docs: unify some terms and labels, and refine database parameters

上级 052512cb
......@@ -19,7 +19,23 @@ CREATE DATABASE [IF NOT EXISTS] db_name [KEEP keep] [DAYS days] [UPDATE 1];
4. 更多关于 UPDATE 参数的用法,请参考[FAQ](/train-faq/faq)
3. 数据库名最大长度为 33;
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` 的参数中明确指定的会覆盖配置文件中的设置。
:::
......
......@@ -38,7 +38,6 @@ taos --dump-config
:::
:::note
配置文件参数修改后,需要重启*taosd*服务,或客户端应用才能生效。
......@@ -49,7 +48,7 @@ taos --dump-config
### firstEp
| 属性 | 说明 |
| -------- | ----------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 适用范围 | 服务端和客户端均适用 |
| 含义 | taosd 或者 taos 启动时,主动连接的集群中首个 dnode 的 end point |
| 缺省值 | localhost:6030 |
......@@ -57,7 +56,7 @@ taos --dump-config
### secondEp
| 属性 | 说明 |
| -------- | ---------------------------------------------------------------------------- |
| -------- | -------------------------------------------------------------------------------------- |
| 适用范围 | 服务端和客户端均适用 |
| 含义 | taosd 或者 taos 启动时,如果 firstEp 连接不上,尝试连接集群中第二个 dnode 的 end point |
| 缺省值 | 无 |
......@@ -74,11 +73,11 @@ taos --dump-config
### serverPort
| 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------- |
| -------- | ----------------------------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | taosd 启动后,对外服务的端口号 |
| 缺省值 | 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
对于端口,TDengine 会使用从 serverPort 起 13 个连续的 TCP 和 UDP 端口号,请务必在防火墙打开。因此如果是缺省配置,需要打开从 6030 到 6042 共 13 个端口,而且必须 TCP 和 UDP 都打开。(详细的端口情况请参见下表)
......@@ -147,7 +146,6 @@ taos --dump-config
| 取值范围 | 1-600 |
| 缺省值 | 30 |
### telemetryReporting
| 属性 | 说明 |
......@@ -172,7 +170,7 @@ taos --dump-config
### ratioOfQueryCores
| 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | 设置查询线程的最大数量。 |
| 缺省值 | 1 |
......@@ -181,7 +179,7 @@ taos --dump-config
### maxNumOfDistinctRes
| 属性 | 说明 |
| -------- | -------------------------------- |
| -------- | -------------------------------- | --- |
| 适用范围 | 仅服务端适用 |
| 含义 | 允许返回的 distinct 结果最大行数 |
| 取值范围 | 默认值为 10 万,最大值 1 亿 |
......@@ -201,35 +199,35 @@ taos --dump-config
:::info
为应对多时区的数据写入和查询问题,TDengine 采用 Unix 时间戳(Unix Timestamp)来记录和存储时间戳。Unix 时间戳的特点决定了任一时刻不论在任何时区,产生的时间戳均一致。需要注意的是,Unix 时间戳是在客户端完成转换和记录。为了确保客户端其他形式的时间转换为正确的 Unix 时间戳,需要设置正确的时区。
在 Linux 系统中,客户端会自动读取系统设置的时区信息。用户也可以采用多种方式在配置文件设置时区。例如:
在 Linux 系统中,客户端会自动读取系统设置的时区信息。用户也可以采用多种方式在配置文件设置时区。例如:
```
timezone UTC-8
timezone GMT-8
timezone Asia/Shanghai
```
```
timezone UTC-8
timezone GMT-8
timezone Asia/Shanghai
```
均是合法的设置东八区时区的格式。但需注意,Windows 下并不支持 `timezone Asia/Shanghai` 这样的写法,而必须写成 `timezone UTC-8`
均是合法的设置东八区时区的格式。但需注意,Windows 下并不支持 `timezone Asia/Shanghai` 这样的写法,而必须写成 `timezone UTC-8`
时区的设置对于查询和写入 SQL 语句中非 Unix 时间戳的内容(时间戳字符串、关键词 now 的解析)产生影响。例如:
时区的设置对于查询和写入 SQL 语句中非 Unix 时间戳的内容(时间戳字符串、关键词 now 的解析)产生影响。例如:
```sql
SELECT count(*) FROM table_name WHERE TS<'2019-04-11 12:01:08';
```
```sql
SELECT count(*) FROM table_name WHERE TS<'2019-04-11 12:01:08';
```
在东八区,SQL 语句等效于
在东八区,SQL 语句等效于
```sql
SELECT count(*) FROM table_name WHERE TS<1554955268000;
```
```sql
SELECT count(*) FROM table_name WHERE TS<1554955268000;
```
在 UTC 时区,SQL 语句等效于
在 UTC 时区,SQL 语句等效于
```sql
SELECT count(*) FROM table_name WHERE TS<1554984068000;
```
```sql
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
| 缺省值 | 系统中动态获取,如果自动获取失败,需要用户在配置文件设置或通过 API 设置 |
:::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
:::info
如果配置文件中不设置 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
charset GBK
```
```
locale zh_CN.UTF-8
charset GBK
```
则 charset 的有效值是 GBK。
则 charset 的有效值是 GBK。
```
charset GBK
locale zh_CN.UTF-8
```
```
charset GBK
locale zh_CN.UTF-8
```
charset 的有效值是 UTF-8。
charset 的有效值是 UTF-8。
:::
......@@ -391,7 +389,7 @@ taos --dump-config
| 含义 | 是否在内存中缓存子表的最近数据 |
| 取值范围 | 0:关闭 <br/> 1:缓存子表最近一行数据 <br/> 2:缓存子表每一列的最近的非 NULL 值 <br/> 3:同时打开缓存最近行和列功能。(2.1.2.0 版本开始此参数支持 0 ~ 3 的取值范围,在此之前取值只能是 [0, 1]) |
| 缺省值 | 0 |
| 补充说明 | 2.1.2.0 版本之前、2.0.20.7 版本之前在 taos.cfg 文件中不支持此参数。
| 补充说明 | 2.1.2.0 版本之前、2.0.20.7 版本之前在 taos.cfg 文件中不支持此参数。 |
### minimalTmpDirGB
......@@ -456,6 +454,7 @@ taos --dump-config
| 含义 | dnode 的可选角色 |
| 取值范围 | 0:any(既可作为 mnode,也可分配 vnode) <br/> 1:mgmt(只能作为 mnode,不能分配 vnode) <br/> 2:dnode(不能作为 mnode,只能分配 vnode) |
| 缺省值 | 0 |
### balance
| 属性 | 说明 |
......@@ -478,13 +477,22 @@ taos --dump-config
### arbitrator
| 属性 | 说明 |
| -------- | ------------------------ |
| -------- | ------------------------------------------ |
| 适用范围 | 仅服务端适用 |
| 含义 | 系统中裁决器的 end point,其格式如firstEp |
| 含义 | 系统中裁决器的 end point,其格式如 firstEp |
| 缺省值 | 空 |
## 时间相关
### precision
| 属性 | 说明 |
| -------- | ------------------------------------------------- |
| 适用范围 | 仅服务端 |
| 含义 | 创建数据库时使用的时间精度 |
| 取值范围 | ms: millisecond; us: microsecond ; ns: nanosecond |
| 缺省值 | ms |
### rpcTimer
| 属性 | 说明 |
......@@ -555,7 +563,6 @@ taos --dump-config
| 取值范围 | 5-7200000 |
| 缺省值 | 86400\*10(10 天) |
## 性能调优
### numOfThreadsPerCore
......@@ -604,7 +611,7 @@ taos --dump-config
### tableIncStepPerVnode
| 属性 | 说明 |
| -------- | ----------------------------------- |
| -------- | ------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | 每个 vnode 中超过最小表数,i.e. minTablesPerVnode, 后递增步长 |
| 缺省值 | 1000 |
......@@ -617,11 +624,10 @@ taos --dump-config
| 含义 | 支持超级表时间排序允许的最多记录数限制 |
| 缺省值 | 10 万 |
### mnodeEqualVnodeNum
| 属性 | 说明 |
| -------- | ---------------------------------- |
| -------- | ------------------------------------ |
| 适用范围 | 仅服务端适用 |
| 含义 | 将一个 mnode 等同于 vnode 消耗的个数 |
| 缺省值 | 4 |
......@@ -739,7 +745,7 @@ taos --dump-config
### maxStreamCompDelay
| 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| -------- | -------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | 连续查询启动最大延迟 |
| 单位 | 毫秒 |
......@@ -769,7 +775,7 @@ taos --dump-config
### streamCompDelayRatio
| 属性 | 说明 |
| -------- | -------------------------- |
| -------- | ---------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | 连续查询的延迟时间计算系数,实际延迟时间为本参数乘以计算时间窗口 |
| 取值范围 | 0.1-0.9 |
......@@ -783,8 +789,8 @@ taos --dump-config
## HTTP 相关
:::note
HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以后(含)由taosAdapter提供。
本节的配置参数仅在2.4.0.0(不含)以前的版本中生效。如果您使用的是2.4.0.0(含)及以后的版本请参考[文档](/reference/taosadapter/)
HTTP 服务在 2.4.0.0(不含)以前的版本中由 taosd 提供,在 2.4.0.0 以后(含)由 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以
### httpEnableRecordSql
| 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | 记录通过 RESTFul 接口,产生的 SQL 调用。 |
| 缺省值 | 0 |
......@@ -809,7 +815,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
### httpMaxThreads
| 属性 | 说明 |
| -------- | --------------------------------------------------------------------------------------------------------------------------- |
| -------- | ------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | RESTFul 接口的线程数。taosAdapter 配置或有不同,请参考相应[文档](/reference/taosadapter/)。 |
| 缺省值 | 2 |
......@@ -817,7 +823,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
### restfulRowLimit
| 属性 | 说明 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| -------- | ----------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
| 含义 | RESTFul 接口单次返回的记录条数。taosAdapter 配置或有不同,请参考相应[文档](/reference/taosadapter/)。 |
| 缺省值 | 10240 |
......@@ -852,7 +858,6 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
| 单位 | GB |
| 缺省值 | 1.0 |
### numOfLogLines
| 属性 | 说明 |
......@@ -1075,7 +1080,7 @@ HTTP服务在2.4.0.0(不含)以前的版本中由taosd提供,在2.4.0.0以
### maxBinaryDisplayWidth
| 属性 | 说明 |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| -------- | -------------------------------------------------------------------------- |
| 含义 | Taos shell 中 binary 和 nchar 字段的显示宽度上限,超过此限制的部分将被隐藏 |
| 取值范围 | 5 - |
| 缺省值 | 30 |
......
---
sidebar_label: Connect
sidebar_label: Connection
title: Connect to TDengine
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
title: Data Model
---
......
label: Insert
label: Insert Data
link:
type: generated-index
slug: /insert-data/
......
......@@ -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. The maximum length of database name is 33 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
---
......
---
sidebar_label: Select
title: Select
---
......
---
sidebar_label: Functions
title: Functions
---
......
---
sidebar_label: Window
title: Aggregate by Window
sidebar_label: Interval
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.
......
---
sidebar_label: Limits
title: Limits and Restrictions
title: Limits & Restrictions
---
## Naming Rules
......
---
sidebar_label: JSON
title: JSON Type
---
......
---
sidebar-label: Escape
title: Escape
title: Escape Characters
---
## Escape Characters
Below table is the list of escape characters used in TDengine.
| Escape Character | **Actual Meaning** |
| :--------------: | ------------------------ |
......
---
sidebar_label: Keywords
title: Reserved Keywords
title: 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.
**Keywords List**
......
---
sidebar_label: Tolerance
title: Fault Tolerance and Disaster Recovery
sidebar_label: Fault Tolerance
title: Fault Tolerance & Disaster Recovery
---
## Fault Tolerance
......
---
sidebar_label: Import
title: Import Data
---
......
---
sidebar_label: Export
title: Export Data
---
......
---
sidebar_label: Monitor
title: Monitor TDengine
---
......
---
sidebar_label: Optimize
title: Optimize Performance
---
......
---
sidebar_label: Diagnose
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.
......
......@@ -475,6 +475,15 @@ charset CP936
## 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
| Attribute | Description |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册