Skip to content
Permalink
Browse files
Merge remote-tracking branch 'origin/master'
  • Loading branch information
qiaojialin committed Nov 15, 2019
2 parents 043af03 + 3e18e11 commit 2eb8d60df7a8b44a52963313bbede40743984a69
Showing 22 changed files with 490 additions and 224 deletions.
@@ -21,19 +21,24 @@

# 第3章 服务器端

## 系统配置
## 配置手册

为方便IoTDB Server的配置与管理,IoTDB Server为用户提供三种配置项,使得用户可以在启动服务器或服务器运行时对其进行配置。

三种配置项的配置文件均位于IoTDB安装目录:`$IOTDB_HOME/conf`文件夹下,其中涉及server配置的共有3个文件,分别为:`iotdb-env.sh`, `tsfile-format.properties`, `iotdb-engine.properties`。用户可以通过更改其中的配置项对系统运行的相关配置项进行配置。
三种配置项的配置文件均位于IoTDB安装目录:`$IOTDB_HOME/conf`文件夹下,其中涉及server配置的共有2个文件,分别为:`iotdb-env.sh`, `iotdb-engine.properties`。用户可以通过更改其中的配置项对系统运行的相关配置项进行配置。

配置文件的说明如下:

* `iotdb-env.sh`:环境配置项的默认配置文件。用户可以在文件中配置JAVA-JVM的相关系统配置项。

* `tsfile-format.properties`IoTDB文件层系统配置项的默认配置文件。用户可以在文件中配置IoTDB存储时TsFile文件的相关信息,如每次将内存中的数据写入到磁盘时的数据大小(`group_size_in_byte`),内存中每个列打一次包的大小(`page_size_in_byte`)等。
* `iotdb-engine.properties`IoTDB引擎层系统配置项的默认配置文件。用户可以在文件中配置IoTDB引擎运行时的相关参数,如JDBC服务监听端口(`rpc_port`)、overflow数据文件存储目录(`overflow_data_dir`)等。此外,用户可以在文件中配置IoTDB存储时TsFile文件的相关信息,如每次将内存中的数据写入到磁盘时的数据大小(`group_size_in_byte`),内存中每个列打一次包的大小(`page_size_in_byte`)等。

* `iotdb-engine.properties`:IoTDB引擎层系统配置项的默认配置文件。用户可以在文件中配置IoTDB引擎运行时的相关参数,如JDBC服务监听端口(`rpc_port`)、overflow数据文件存储目录(`overflow_data_dir`)等。
### 热修改配置项

为方便用户使用,IoTDB Server为用户提供了热修改功能,即在系统运行过程中修改`iotdb-engine.properties`中部分配置参数并即时应用到系统中。下面介绍的参数中,改后
生效方式为`触发生效`的均为支持热修改的配置参数。

触发方式:客户端发送```load configuration```命令至IoTDB Server,客户端的使用方式详见第4章

### 环境配置项

@@ -78,7 +83,7 @@

### 系统配置项

系统配置项是IoTDB Server运行的核心配置,它主要用于设置IoTDB Server文件层和引擎层的参数,便于用户根据自身需求调整Server的相关配置,以达到较好的性能表现。系统配置项可分为两大模块:文件层配置项和引擎层配置项。用户可以通过查看`tsfile-format.properties`, `iotdb-engine.properties`,文件查看和修改两种配置项的内容。在0.7.0版本中字符串类型的配置项大小写敏感。
系统配置项是IoTDB Server运行的核心配置,它主要用于设置IoTDB Server文件层和引擎层的参数,便于用户根据自身需求调整Server的相关配置,以达到较好的性能表现。系统配置项可分为两大模块:文件层配置项和引擎层配置项。用户可以通过查看`iotdb-engine.properties`,文件查看和修改两种配置项的内容。在0.7.0版本中字符串类型的配置项大小写敏感。

#### 文件层配置

@@ -89,7 +94,7 @@
|描述|数据压缩方法|
|类型|枚举String : “UNCOMPRESSED”, “SNAPPY”|
|默认值| UNCOMPRESSED |
|改后生效方式|即时生效|
|改后生效方式|触发生效|

* group\_size\_in\_byte

@@ -98,7 +103,7 @@
|描述|每次将内存中的数据写入到磁盘时的最大写入字节数|
|类型|Int32|
|默认值| 134217728 |
|改后生效方式|即时生效|
|改后生效方式|触发生效|

* max\_number\_of\_points\_in\_page

@@ -107,7 +112,7 @@
|描述|一个页中最多包含的数据点(时间戳-值的二元组)数量|
|类型|Int32|
|默认值| 1048576 |
|改后生效方式|即时生效|
|改后生效方式|触发生效|

* max\_string\_length

@@ -116,7 +121,7 @@
|描述|针对字符串类型的数据,单个字符串最大长度,单位为字符|
|类型|Int32|
|默认值| 128 |
|改后生效方式|即时生效|
|改后生效方式|触发生效|

* page\_size\_in\_byte

@@ -125,7 +130,7 @@
|描述|内存中每个列写出时,写成的单页最大的大小,单位为字节|
|类型|Int32|
|默认值| 65536 |
|改后生效方式|即时生效|
|改后生效方式|触发生效|

* time\_series\_data\_type

@@ -134,7 +139,7 @@
|描述|时间戳数据类型|
|类型|枚举String: "INT32", "INT64"|
|默认值| Int64 |
|改后生效方式|即时生效|
|改后生效方式|触发生效|

* time\_encoder

@@ -143,7 +148,7 @@
|描述| 时间列编码方式|
|类型|枚举String: “TS_2DIFF”,“PLAIN”,“RLE”|
|默认值| TS_2DIFF |
|改后生效方式|即时生效|
|改后生效方式|触发生效|

* float_precision

@@ -152,27 +157,27 @@
|描述| 浮点数精度,为小数点后数字的位数 |
|类型|Int32|
|默认值| 默认为2位。注意:32位浮点数的十进制精度为7位,64位浮点数的十进制精度为15位。如果设置超过机器精度将没有实际意义。|
|改后生效方式|即时生效|
|改后生效方式|触发生效|

#### 引擎层配置

* back\_loop\_period
* back\_loop\_period\_in\_second

|名字| back\_loop\_period |
|名字| back\_loop\_period\_in\_second |
|:---:|:---|
|描述| 系统统计量触发统计的频率,单位为秒。|
|类型|Int32|
|默认值| 5 |
|改后生效方式|重启服务器生效|

* data\_dir
* data\_dirs

|名字| data\_dir |
|名字| data\_dirs |
|:---:|:---|
|描述| IoTDB数据存储路径,默认存放在和bin目录同级的data目录下。相对路径的起始目录与操作系统相关,建议使用绝对路径。|
|类型|String|
|默认值| data |
|改后生效方式|重启服务器生效|
|改后生效方式|触发生效|

* enable_wal

@@ -181,7 +186,7 @@
|描述| 是否开启写前日志,默认值为true表示开启,配置成false表示关闭 |
|类型|Bool|
|默认值| true |
|改后生效方式|重启服务器生效|
|改后生效方式|触发生效|

* fetch_size

@@ -199,7 +204,7 @@
|描述| 写前日志定期刷新到磁盘的周期,单位毫秒,有可能丢失至多flush\_wal\_period\_in\_ms毫秒的操作。 |
|类型|Int32|
|默认值| 10 |
|改后生效方式|重启服务器生效|
|改后生效方式|触发生效|

* flush\_wal\_threshold

@@ -208,7 +213,7 @@
|描述| 写前日志的条数达到该值之后,刷新到磁盘,有可能丢失至多flush\_wal\_threshold个操作 |
|类型|Int32|
|默认值| 10000 |
|改后生效方式|重启服务器生效|
|改后生效方式|触发生效|

* merge\_concurrent\_threads

@@ -226,7 +231,7 @@
|描述| IoTDB在tsfile\_dir中为TsFile选择目录时采用的策略。可使用简单类名或类名全称。系统提供以下三种策略:<br>1. SequenceStrategy:IoTDB按顺序从tsfile\_dir中选择目录,依次遍历tsfile\_dir中的所有目录,并不断轮循;<br>2. MaxDiskUsableSpaceFirstStrategy:IoTDB优先选择tsfile\_dir中对应磁盘空余空间最大的目录;<br>3. MinFolderOccupiedSpaceFirstStrategy:IoTDB优先选择tsfile\_dir中已使用空间最小的目录;<br>4. <UserDfineStrategyPackage>(用户自定义策略)<br>您可以通过以下方法完成用户自定义策略:<br>1. 继承cn.edu.tsinghua.iotdb.conf.directories.strategy.DirectoryStrategy类并实现自身的Strategy方法;<br>2. 将实现的类的完整类名(包名加类名,UserDfineStrategyPackage)填写到该配置项;<br>3. 将该类jar包添加到工程中。|
|类型|String|
|默认值| MaxDiskUsableSpaceFirstStrategy |
|改后生效方式|重启服务器生效|
|改后生效方式|触发生效|

* rpc_address

@@ -246,14 +251,14 @@
|默认值| 6667 |
|改后生效方式|重启服务器生效||

* time_zone
* time\_zone

|名字| time_zone |
|:---:|:---|
|描述| 服务器所处的时区,默认为北京时间(东八区) |
|类型|Time Zone String|
|默认值| +08:00 |
|改后生效方式|重启服务器生效|
|改后生效方式|触发生效|

* enable\_stat\_monitor

@@ -29,13 +29,20 @@ Before starting to use IoTDB, you need to config the configuration files first.
In total, we provide users three kinds of configurations module:

* environment configuration file (`iotdb-env.bat`, `iotdb-env.sh`). The default configuration file for the environment configuration item. Users can configure the relevant system configuration items of JAVA-JVM in the file.
* system configuration file (`tsfile-format.properties`, `iotdb-engine.properties`).
* `tsfile-format.properties`: The default configuration file for the IoTDB file layer configuration item. Users can configure the information about the TsFile, such as the data size written to the disk per time(`group_size_in_byte`).
* `iotdb-engine.properties`: The default configuration file for the IoTDB engine layer configuration item. Users can configure the IoTDB engine related parameters in the file, such as JDBC service listening port (`rpc_port`), unsequence data storage directory (`unsequence_data_dir`), etc.
* system configuration file (`iotdb-engine.properties`).
* `iotdb-engine.properties`: The default configuration file for the IoTDB engine layer configuration item. Users can configure the IoTDB engine related parameters in the file, such as JDBC service listening port (`rpc_port`), unsequence data storage directory (`unsequence_data_dir`), etc. What's more, Users can configure the information about the TsFile, such as the data size written to the disk per time(`group_size_in_byte`).
* log configuration file (`logback.xml`)

The configuration files of the three configuration items are located in the IoTDB installation directory: `$IOTDB_HOME/conf` folder.

### Hot Modification Configuration

For the convenience of users, IoTDB server provides users with hot modification function, that is, modifying some configuration parameters in `iotdb engine. Properties` during the system operation and applying them to the system immediately.
In the parameters described below, these parameters whose way of `Effective` is `trigger` support hot modification.

Trigger way: The client sends the command `load configuration` to the IoTDB server. See Chapter 4 for the usage of the client.

### IoTDB Environment Configuration File

The environment configuration file is mainly used to configure the Java environment related parameters when IoTDB Server is running, such as JVM related configuration. This part of the configuration is passed to the JVM when the IoTDB Server starts. Users can view the contents of the environment configuration file by viewing the `iotdb-env.sh` (or `iotdb-env.bat`) file.
@@ -90,7 +97,7 @@ The detail of each variables are as follows:
|Description|Data compression method|
|Type|Enum String : “UNCOMPRESSED”, “SNAPPY”|
|Default| UNCOMPRESSED |
|Effective|Immediately|
|Effective|Trigger|

* group\_size\_in\_byte

@@ -99,7 +106,7 @@ The detail of each variables are as follows:
|Description|The data size written to the disk per time|
|Type|Int32|
|Default| 134217728 |
|Effective|Immediately|
|Effective|Trigger|

* page\_size\_in\_byte

@@ -108,7 +115,7 @@ The detail of each variables are as follows:
|Description|The maximum size of a single page written in memory when each column in memory is written (in bytes)|
|Type|Int32|
|Default| 65536 |
|Effective|Immediately|
|Effective|Trigger|

* max\_number\_of\_points\_in\_page

@@ -117,7 +124,7 @@ The detail of each variables are as follows:
|Description|The maximum number of data points (timestamps - valued groups) contained in a page|
|Type|Int32|
|Default| 1048576 |
|Effective|Immediately|
|Effective|Trigger|

* max\_string\_length

@@ -126,7 +133,7 @@ The detail of each variables are as follows:
|Description|The maximum length of a single string (number of character)|
|Type|Int32|
|Default| 128 |
|Effective|Immediately|
|Effective|Trigger|

* time\_series\_data\_type

@@ -135,7 +142,7 @@ The detail of each variables are as follows:
|Description|Timestamp data type|
|Type|Enum String: "INT32", "INT64"|
|Default| Int64 |
|Effective|Immediately|
|Effective|Trigger|

* time\_encoder

@@ -144,7 +151,7 @@ The detail of each variables are as follows:
|Description| Encoding type of time column|
|Type|Enum String: “TS_2DIFF”,“PLAIN”,“RLE”|
|Default| TS_2DIFF |
|Effective|Immediately|
|Effective|Trigger|

* value\_encoder

@@ -153,7 +160,7 @@ The detail of each variables are as follows:
|Description| Encoding type of value column|
|Type|Enum String: “TS_2DIFF”,“PLAIN”,“RLE”|
|Default| PLAIN |
|Effective|Immediately|
|Effective|Trigger|

* float_precision

@@ -162,7 +169,7 @@ The detail of each variables are as follows:
|Description| The precision of the floating point number.(The number of digits after the decimal point) |
|Type|Int32|
|Default| The default is 2 digits. Note: The 32-bit floating point number has a decimal precision of 7 bits, and the 64-bit floating point number has a decimal precision of 15 bits. If the setting is out of the range, it will have no practical significance. |
|Effective|Immediately|
|Effective|Trigger|

#### Engine Layer

@@ -191,7 +198,7 @@ The detail of each variables are as follows:
|Description| The time zone in which the server is located, the default is Beijing time (+8) |
|Type|Time Zone String|
|Default| +08:00 |
|Effective|After restart system|
|Effective|Trigger|

* base\_dir

@@ -209,7 +216,7 @@ The detail of each variables are as follows:
|Description| The directories of data files. Multiple directories are separated by comma. The starting directory of the relative path is related to the operating system. It is recommended to use an absolute path. If the path does not exist, the system will automatically create it.|
|Type|String[]|
|Default| data/data |
|Effective|After restart system|
|Effective|Trigger|

* wal\_dir

@@ -227,7 +234,7 @@ The detail of each variables are as follows:
|Description| Whether to enable the pre-write log. The default value is true(enabled), and false means closed. |
|Type|Bool|
|Default| true |
|Effective|After restart system|
|Effective|Trigger|

* multi\_dir\_strategy

@@ -236,7 +243,7 @@ The detail of each variables are as follows:
|Description| IoTDB's strategy for selecting directories for TsFile in tsfile_dir. You can use a simple class name or a full name of the class. The system provides the following three strategies: <br>1. SequenceStrategy: IoTDB selects the directory from tsfile\_dir in order, traverses all the directories in tsfile\_dir in turn, and keeps counting;<br>2. MaxDiskUsableSpaceFirstStrategy: IoTDB first selects the directory with the largest free disk space in tsfile\_dir;<br>3. MinFolderOccupiedSpaceFirstStrategy: IoTDB prefers the directory with the least space used in tsfile\_dir;<br>4. <UserDfineStrategyPackage> (user-defined policy)<br>You can complete a user-defined policy in the following ways:<br>1. Inherit the cn.edu.tsinghua.iotdb.conf.directories.strategy.DirectoryStrategy class and implement its own Strategy method;<br>2. Fill in the configuration class with the full class name of the implemented class (package name plus class name, UserDfineStrategyPackage);<br>3. Add the jar file to the project. |
|Type|String|
|Default| MaxDiskUsableSpaceFirstStrategy |
|Effective|After restart system|
|Effective|Trigger|

* tsfile\_size\_threshold

@@ -254,7 +261,7 @@ The detail of each variables are as follows:
|Description| After the WAL reaches this value, it is flushed to disk, and it is possible to lose at most flush_wal_threshold operations. |
|Type|Int32|
|Default| 10000 |
|Effective|After restart system|
|Effective|Trigger|

* force\_wal\_period\_in\_ms

@@ -263,7 +270,7 @@ The detail of each variables are as follows:
|Description| The period during which the log is periodically forced to flush to disk(in milliseconds) |
|Type|Int32|
|Default| 10 |
|Effective|After restart system|
|Effective|Trigger|

* fetch\_size

@@ -54,15 +54,22 @@ for /f "tokens=1-3" %%j in ('java -version 2^>^&1') do (
set BIT_VERSION=%%l
)
IF "%BIT_VERSION%" == "64-Bit" (
rem 64-bit Java
echo Detect 64-bit Java, maximum memory allocation pool = 2GB, initial memory allocation pool = 2GB
set IOTDB_HEAP_OPTS=-Xmx2G -Xms2G
rem 64bit, Maximum heap size
set MAX_HEAP_SIZE="2G"
rem 64bit, Minimum heap size
set HEAP_NEWSIZE="2G"
) ELSE (
rem 32-bit Java
echo Detect 32-bit Java, maximum memory allocation pool = 512MB, initial memory allocation pool = 512MB
set IOTDB_HEAP_OPTS=-Xmx512M -Xms512M
rem 32bit, Maximum heap size
set MAX_HEAP_SIZE="512M"
rem 32bit, Minimum heap size
set HEAP_NEWSIZE="512M"
)

@REM MAX_HEAP_SIZE="2G"
@REM HEAP_NEWSIZE="2G"

set IOTDB_HEAP_OPTS=-Xmx%MAX_HEAP_SIZE% -Xms%HEAP_NEWSIZE%

@REM You can put your env variable here
@REM set JAVA_HOME=%JAVA_HOME%

@@ -273,6 +273,10 @@ K_UNSET
: U N S E T
;

K_CONFIGURATION
: C O N F I G U R A T I O N
;

//************** logical operator***********
OPERATOR_AND
: A N D

0 comments on commit 2eb8d60

Please sign in to comment.