提交 ea13d2bc 编写于 作者: K kailixu

docs: add description of keep/multi-tier storage

上级 a3f7cb3e
......@@ -56,7 +56,7 @@ database_option: {
- WAL_FSYNC_PERIOD: specifies the interval (in milliseconds) at which data is written from the WAL to disk. This parameter takes effect only when the WAL parameter is set to 2. The default value is 3000. Enter a value between 0 and 180000. The value 0 indicates that incoming data is immediately written to disk.
- MAXROWS: specifies the maximum number of rows recorded in a block. The default value is 4096.
- MINROWS: specifies the minimum number of rows recorded in a block. The default value is 100.
- KEEP: specifies the time for which data is retained. Enter a value between 1 and 365000. The default value is 3650. The value of the KEEP parameter must be greater than or equal to the value of the DURATION parameter. TDengine automatically deletes data that is older than the value of the KEEP parameter. You can use m (minutes), h (hours), and d (days) as the unit, for example KEEP 100h or KEEP 10d. If you do not include a unit, d is used by default. The official version supports multi-tier storage, corresponding to multiple KEEP values(comma separated and up to 3 values keep0,keep1,keep2, and meet keep0 <= keep1 <= keep2, e.g. KEEP 100h,100d,3650d); the community version does not support multi-tier storage(although multiple keep values are configured, they do not take effect, only the maximum keep value is used as KEEP).
- KEEP: specifies the time for which data is retained. Enter a value between 1 and 365000. The default value is 3650. The value of the KEEP parameter must be greater than or equal to the value of the DURATION parameter. TDengine automatically deletes data that is older than the value of the KEEP parameter. You can use m (minutes), h (hours), and d (days) as the unit, for example KEEP 100h or KEEP 10d. If you do not include a unit, d is used by default. The official version supports [multi-tier storage](https://docs.tdengine.com/reference/config/#datadir), corresponding to multiple KEEP values(comma separated and up to 3 values keep0,keep1,keep2 supported, and meet keep0 <= keep1 <= keep2, e.g. KEEP 100h,100d,3650d); the community version does not support multi-tier storage(although multiple keep values are configured, they do not take effect, only the maximum keep value is used as KEEP).
- PAGES: specifies the number of pages in the metadata storage engine cache on each vnode. Enter a value greater than or equal to 64. The default value is 256. The space occupied by metadata storage on each vnode is equal to the product of the values of the PAGESIZE and PAGES parameters. The space occupied by default is 1 MB.
- PAGESIZE: specifies the size (in KB) of each page in the metadata storage engine cache on each vnode. The default value is 4. Enter a value between 1 and 16384.
- PRECISION: specifies the precision at which a database records timestamps. Enter ms for milliseconds, us for microseconds, or ns for nanoseconds. The default value is ms.
......
......@@ -314,6 +314,32 @@ The charset that takes effect is UTF-8.
| Applicable | Server Only |
| Meaning | All data files are stored in this directory |
| Default Value | /var/lib/taos |
```
The official version supports multi-tier storage (need to cooperate with [KEEP parameter](https://docs.tdengine.com/taos-sql/database/#create-a-database)). The configuration method is as follows.
The multi-tier storage directory is configured through dataDir, the format is: dataDir [path] <level> <primary>
dataDir: Configuration items in the configuration file (taos.cfg)
path: the directory to mount (cannot be omitted)
level: mount level, the value is 0, 1 or 2, if omitted, the default is 0. Up to 3 levels are supported, and each level supports up to 16 mount points, so a maximum of 48 mount points are supported.
primary: whether it is the primary mount point, 0 (no) or 1 (yes), the default is 1. The primary mount point is only allowed at level 0, and only one primary mount point is allowed (level=0, primary=1).
Here is a normal configuration (3 storage tiers, each with 3 mount points):
Data directory /mnt/data01 0 1
Data directory /mnt/data02 0 0
Data directory /mnt/data03 0 0
Data directory /mnt/data10 1 0
Data directory /mnt/data11 1 0
Data directory /mnt/data12 1 0
Data directory /mnt/data20 2 0
Data directory /mnt/data21 2 0
Data directory /mnt/data22 2 0
The community version does not support multi-tier storage, and the following three configurations are acceptable:
Data directory /var/lib/taos
or dataDir /var/lib/taos 0
or dataDir /var/lib/taos 0 1
```
### tempDir
......
......@@ -56,7 +56,7 @@ database_option: {
- WAL_FSYNC_PERIOD:当 WAL 参数设置为 2 时,落盘的周期。默认为 3000,单位毫秒。最小为 0,表示每次写入立即落盘;最大为 180000,即三分钟。
- MAXROWS:文件块中记录的最大条数,默认为 4096 条。
- MINROWS:文件块中记录的最小条数,默认为 100 条。
- KEEP:表示数据文件保存的天数,缺省值为 3650,取值范围 [1, 365000],且必须大于或等于 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m(分钟)、h(小时)和 d(天)三个单位。也可以不写单位,如 KEEP 50,此时默认单位为天。企业版支持多级存储功能, 对应多个保存时间(多个以逗号分隔, 最多 3 级, 如 KEEP 100h,100d,3650d, 其中, keep0 <= keep1 <= keep2); 社区版不支持多级存储(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的 keep 值)
- KEEP:表示数据文件保存的天数,缺省值为 3650,取值范围 [1, 365000],且必须大于或等于 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m(分钟)、h(小时)和 d(天)三个单位。也可以不写单位,如 KEEP 50,此时默认单位为天。企业版支持[多级存储](https://docs.taosdata.com/reference/config/#datadir)功能, 对应多个保存时间(多个以英文逗号分隔,最多 3 级:keep0,keep1,keep2,满足 keep0 <= keep1 <= keep2,如 KEEP 100h,100d,3650d); 社区版不支持多级存储(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的 keep 值)
- PAGES:一个 VNODE 中元数据存储引擎的缓存页个数,默认为 256,最小 64。一个 VNODE 元数据存储占用 PAGESIZE \* PAGES,默认情况下为 1MB 内存。
- PAGESIZE:一个 VNODE 中元数据存储引擎的页大小,单位为 KB,默认为 4 KB。范围为 1 到 16384,即 1 KB 到 16 MB。
- PRECISION:数据库的时间戳精度。ms 表示毫秒,us 表示微秒,ns 表示纳秒,默认 ms 毫秒。
......
......@@ -306,13 +306,16 @@ charset 的有效值是 UTF-8。
| 含义 | 数据文件目录,所有的数据文件都将写入该目录 |
| 缺省值 | /var/lib/taos |
```
多级存储目录通过 dataDir 配置. 格式如下:
dataDir [path] <level> <primary>
dataDir: 配置文件( taos.cfg )中的配置项
企业版支持多级存储 (需要与[KEEP 参数](https://docs.taosdata.com/taos-sql/database/#%E5%88%9B%E5%BB%BA%E6%95%B0%E6%8D%AE%E5%BA%93)配合使用). 配置方法如下。
多级存储目录通过 dataDir 配置。配置项格式: dataDir [path] <level> <primary>
dataDir: 配置文件(taos.cfg)中的配置项
path: 需要挂载的目录(不可省略)
level: 挂载等级,取值为 0,1 或 2,省略默认为 0。 最多支持 3 级, 每一级最多支持 16 个挂载点, 因此, 最多支持 48 个挂载点.
primary: 是否为主挂载点,0(否)或 1(是),默认为 1. 主挂载点只允许在 level 0, 且只允许一个主挂载点存在(level=0,primary=1).
如下,为一个正常的配置:
level: 挂载等级,取值为 0,1 或 2,省略默认为 0。最多支持 3 级, 每一级最多支持 16 个挂载点, 因此, 最多支持 48 个挂载点。
primary: 是否为主挂载点,0(否)或 1(是),默认为 1。主挂载点只允许在 level 0,且只允许一个主挂载点存在(level = 0,primary = 1)。
如下,为正常的配置 ( 3 个存储层级,每个层级 3 个挂载点):
dataDir /mnt/data01 0 1
dataDir /mnt/data02 0 0
dataDir /mnt/data03 0 0
......@@ -322,8 +325,12 @@ dataDir /mnt/data12 1 0
dataDir /mnt/data20 2 0
dataDir /mnt/data21 2 0
dataDir /mnt/data22 2 0
```
社区版不支持多级存储, 以下 3 种均为正常配置:
dataDir /var/lib/taos
或 dataDir /var/lib/taos 0
或 dataDir /var/lib/taos 0 1
```
### tempDir
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册