docs: update taosAdapter doc

This commit is contained in:
t_max 2025-02-05 17:24:46 +08:00
parent ab0e3b2b67
commit c70fcdc884
10 changed files with 144 additions and 141 deletions

View File

@ -24,6 +24,8 @@ The architecture diagram is as follows:
## Feature List ## Feature List
The taosAdapter provides the following features:
- WebSocket Interface: - WebSocket Interface:
Supports executing SQL, schemaless writing, parameter binding, and data subscription through the WebSocket protocol. Supports executing SQL, schemaless writing, parameter binding, and data subscription through the WebSocket protocol.
- Compatible with InfluxDB v1 write interface: - Compatible with InfluxDB v1 write interface:
@ -228,13 +230,14 @@ See the example configuration file at [example/config/taosadapter.toml](https://
### Cross-Origin Configuration ### Cross-Origin Configuration
When using the RESTful API, the system will manage TDengine connections through a connection pool. The connection pool can be configured with the following parameters: When making API calls from the browser, please configure the following Cross-Origin Resource Sharing (CORS) parameters based on your actual situation:
- **`pool.maxConnect`**: The maximum number of connections allowed in the pool, default is twice the number of CPU cores. It is recommended to keep the default setting. - **`cors.allowAllOrigins`**: Whether to allow all origins to access, default is true.
- **`pool.maxIdle`**: The maximum number of idle connections in the pool, default is the same as `pool.maxConnect`. It is recommended to keep the default setting. - **`cors.allowOrigins`**: A comma-separated list of origins allowed to access. Multiple origins can be specified.
- **`pool.idleTimeout`**: Connection idle timeout, default is never timeout. It is recommended to keep the default setting. - **`cors.allowHeaders`**: A comma-separated list of request headers allowed for cross-origin access. Multiple headers can be specified.
- **`pool.waitTimeout`**: Timeout for obtaining a connection from the pool, default is set to 60 seconds. If a connection is not obtained within the timeout period, HTTP status code 503 will be returned. This parameter is available starting from version 3.3.3.0. - **`cors.exposeHeaders`**: A comma-separated list of response headers exposed for cross-origin access. Multiple headers can be specified.
- **`pool.maxWait`**: The maximum number of requests waiting to get a connection in the pool, default is 0, which means no limit. When the number of queued requests exceeds this value, new requests will return HTTP status code 503. This parameter is available starting from version 3.3.3.0. - **`cors.allowCredentials`**: Whether to allow cross-origin requests to include user credentials, such as cookies, HTTP authentication information, or client SSL certificates.
- **`cors.allowWebSockets`**: Whether to allow WebSockets connections.
If you are not making API calls through a browser, you do not need to worry about these configurations. If you are not making API calls through a browser, you do not need to worry about these configurations.
@ -253,11 +256,11 @@ taosAdapter uses a connection pool to manage connections to TDengine, improving
* RESTful API requests * RESTful API requests
* InfluxDB v1 write interface * InfluxDB v1 write interface
* OpenTSDB JSON and telnet format writes * OpenTSDB JSON and telnet format writing
* Telegraf data writes * Telegraf data writing
* collectd data writes * collectd data writing
* StatsD data writes * StatsD data writing
* node_exporter data collection writes * node_exporter data collection writing
* Prometheus remote_read and remote_write * Prometheus remote_read and remote_write
The configuration parameters for the connection pool are as follows: The configuration parameters for the connection pool are as follows:
@ -336,11 +339,11 @@ Starting from **version 3.0.4.0**, taosAdapter provides the parameter `smlAutoCr
The `smlAutoCreateDB` parameter only affects the following interfaces: The `smlAutoCreateDB` parameter only affects the following interfaces:
- InfluxDB v1 write interface - InfluxDB v1 write interface
- OpenTSDB JSON and telnet format write - OpenTSDB JSON and telnet format writing
- Telegraf data write - Telegraf data writing
- collectd data write - collectd data writing
- StatsD data write - StatsD data writing
- node_exporter data write - node_exporter data writing
**Parameter Description** **Parameter Description**

View File

@ -4,20 +4,20 @@ Method to configure taosAdapter to receive collectd data:
- Enable the configuration item in the taosAdapter configuration file (default location is /etc/taos/taosadapter.toml) - Enable the configuration item in the taosAdapter configuration file (default location is /etc/taos/taosadapter.toml)
```toml ```toml
... ...
[opentsdb_telnet] [opentsdb_telnet]
enable = true enable = true
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"] dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049] ports = [6046, 6047, 6048, 6049]
user = "root" user = "root"
password = "taosdata" password = "taosdata"
... ...
``` ```
The default database name written by taosAdapter is `collectd`, but you can also modify the dbs item in the taosAdapter configuration file to specify a different name. Fill in user and password with the actual TDengine configuration values. After modifying the configuration file, taosAdapter needs to be restarted. The default database name written by taosAdapter is `collectd`, but you can also modify the dbs item in the taosAdapter configuration file to specify a different name. Fill in user and password with the actual TDengine configuration values. After modifying the configuration file, taosAdapter needs to be restarted.
- You can also use taosAdapter command line parameters or set environment variables to start, to enable taosAdapter to receive collectd data, for more details please refer to the taosAdapter reference manual. - You can also use taosAdapter command line parameters or set environment variables to start, to enable taosAdapter to receive collectd data, for more details please refer to the taosAdapter reference manual.

View File

@ -4,20 +4,20 @@ Method to configure taosAdapter to receive icinga2 data:
- Enable the configuration item in the taosAdapter configuration file (default location /etc/taos/taosadapter.toml) - Enable the configuration item in the taosAdapter configuration file (default location /etc/taos/taosadapter.toml)
```toml ```toml
... ...
[opentsdb_telnet] [opentsdb_telnet]
enable = true enable = true
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"] dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049] ports = [6046, 6047, 6048, 6049]
user = "root" user = "root"
password = "taosdata" password = "taosdata"
... ...
``` ```
The default database name written by taosAdapter is `icinga2`, but you can also modify the dbs item in the taosAdapter configuration file to specify a different name. Fill in user and password with the actual TDengine configuration values. taosAdapter needs to be restarted after modifications. The default database name written by taosAdapter is `icinga2`, but you can also modify the dbs item in the taosAdapter configuration file to specify a different name. Fill in user and password with the actual TDengine configuration values. taosAdapter needs to be restarted after modifications.
- You can also use taosAdapter command line parameters or set environment variables to enable taosAdapter to receive icinga2 data, for more details please refer to the taosAdapter reference manual - You can also use taosAdapter command line parameters or set environment variables to enable taosAdapter to receive icinga2 data, for more details please refer to the taosAdapter reference manual

View File

@ -4,28 +4,28 @@ Method to configure taosAdapter to receive StatsD data:
- Enable the configuration item in the taosAdapter configuration file (default location /etc/taos/taosadapter.toml) - Enable the configuration item in the taosAdapter configuration file (default location /etc/taos/taosadapter.toml)
```toml ```toml
... ...
[statsd] [statsd]
enable = true enable = true
port = 6044 port = 6044
db = "statsd" db = "statsd"
user = "root" user = "root"
password = "taosdata" password = "taosdata"
worker = 10 worker = 10
gatherInterval = "5s" gatherInterval = "5s"
protocol = "udp" protocol = "udp"
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
allowPendingMessages = 50000 allowPendingMessages = 50000
deleteCounters = true deleteCounters = true
deleteGauges = true deleteGauges = true
deleteSets = true deleteSets = true
deleteTimings = true deleteTimings = true
... ...
``` ```
The default database name written by taosAdapter is `statsd`, but you can also modify the db item in the taosAdapter configuration file to specify a different name. Fill in the user and password with the actual TDengine configuration values. After modifying the configuration file, taosAdapter needs to be restarted. The default database name written by taosAdapter is `statsd`, but you can also modify the db item in the taosAdapter configuration file to specify a different name. Fill in the user and password with the actual TDengine configuration values. After modifying the configuration file, taosAdapter needs to be restarted.
- You can also use taosAdapter command line arguments or set environment variables to enable the taosAdapter to receive StatsD data. For more details, please refer to the taosAdapter reference manual. - You can also use taosAdapter command line arguments or set environment variables to enable the taosAdapter to receive StatsD data. For more details, please refer to the taosAdapter reference manual.

View File

@ -4,20 +4,20 @@ To configure taosAdapter to receive data from TCollector:
- Enable the configuration in the taosAdapter configuration file (default location /etc/taos/taosadapter.toml) - Enable the configuration in the taosAdapter configuration file (default location /etc/taos/taosadapter.toml)
```toml ```toml
... ...
[opentsdb_telnet] [opentsdb_telnet]
enable = true enable = true
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"] dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049] ports = [6046, 6047, 6048, 6049]
user = "root" user = "root"
password = "taosdata" password = "taosdata"
... ...
``` ```
The default database name that taosAdapter writes to is `tcollector`, but you can specify a different name by modifying the dbs option in the taosAdapter configuration file. Fill in the user and password with the actual values configured in TDengine. After modifying the configuration file, taosAdapter needs to be restarted. The default database name that taosAdapter writes to is `tcollector`, but you can specify a different name by modifying the dbs option in the taosAdapter configuration file. Fill in the user and password with the actual values configured in TDengine. After modifying the configuration file, taosAdapter needs to be restarted.
- You can also use taosAdapter command line arguments or set environment variables to enable the taosAdapter to receive tcollector data. For more details, please refer to the taosAdapter reference manual. - You can also use taosAdapter command line arguments or set environment variables to enable the taosAdapter to receive tcollector data. For more details, please refer to the taosAdapter reference manual.

View File

@ -367,7 +367,7 @@ taosAdapter 提供了参数 `restfulRowLimit`,用于控制 HTTP 接口返回
### 日志配置 ### 日志配置
1. 可以通过设置 --log.level 参数或者环境变量 TAOS_ADAPTER_LOG_LEVEL 来设置 taosAdapter 日志输出详细程度。有效值包括: panic、fatal、error、warn、warning、info、debug 以及 trace。 1. 可以通过设置 --log.level 参数或者环境变量 TAOS_ADAPTER_LOG_LEVEL 来设置 taosAdapter 日志输出详细程度。有效值包括panic、fatal、error、warn、warning、info、debug 以及 trace。
2. 从 **3.3.5.0 版本** 开始taosAdapter 支持通过 HTTP 接口动态修改日志级别。用户可以通过发送 HTTP PUT 请求到 /config 接口,动态调整日志级别。该接口的验证方式与 /rest/sql 接口相同,请求体中需传入 JSON 格式的配置项键值对。 2. 从 **3.3.5.0 版本** 开始taosAdapter 支持通过 HTTP 接口动态修改日志级别。用户可以通过发送 HTTP PUT 请求到 /config 接口,动态调整日志级别。该接口的验证方式与 /rest/sql 接口相同,请求体中需传入 JSON 格式的配置项键值对。
以下是通过 curl 命令将日志级别设置为 debug 的示例: 以下是通过 curl 命令将日志级别设置为 debug 的示例:

View File

@ -4,22 +4,22 @@
- 在 taosAdapter 配置文件(默认位置为 /etc/taos/taosadapter.toml中使能配置项 - 在 taosAdapter 配置文件(默认位置为 /etc/taos/taosadapter.toml中使能配置项
```toml ```toml
... ...
[opentsdb_telnet] [opentsdb_telnet]
enable = true enable = true
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"] dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049] ports = [6046, 6047, 6048, 6049]
user = "root" user = "root"
password = "taosdata" password = "taosdata"
... ...
``` ```
其中 taosAdapter 默认写入的数据库名称为 `collectd`,也可以修改 taosAdapter 配置文件 dbs 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过配置文件 taosAdapter 需重新启动。 其中 taosAdapter 默认写入的数据库名称为 `collectd`,也可以修改 taosAdapter 配置文件 dbs 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过配置文件 taosAdapter 需重新启动。
- 也可以使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 collectd 数据功能,具体细节请参考 taosAdapter 的参考手册 - 使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 collectd 数据功能,具体细节请参考 taosAdapter 的参考手册
#### 配置 collectd #### 配置 collectd

View File

@ -4,22 +4,22 @@
- 在 taosAdapter 配置文件(默认位置 /etc/taos/taosadapter.toml中使能配置项 - 在 taosAdapter 配置文件(默认位置 /etc/taos/taosadapter.toml中使能配置项
```toml ```toml
... ...
[opentsdb_telnet] [opentsdb_telnet]
enable = true enable = true
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"] dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049] ports = [6046, 6047, 6048, 6049]
user = "root" user = "root"
password = "taosdata" password = "taosdata"
... ...
``` ```
其中 taosAdapter 默认写入的数据库名称为 `icinga2`,也可以修改 taosAdapter 配置文件 dbs 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过 taosAdapter 需重新启动。 其中 taosAdapter 默认写入的数据库名称为 `icinga2`,也可以修改 taosAdapter 配置文件 dbs 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过 taosAdapter 需重新启动。
- 也可以使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 icinga2 数据功能,具体细节请参考 taosAdapter 的参考手册 - 使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 icinga2 数据功能,具体细节请参考 taosAdapter 的参考手册
#### 配置 icinga2 #### 配置 icinga2

View File

@ -4,30 +4,30 @@
- 在 taosAdapter 配置文件(默认位置 /etc/taos/taosadapter.toml中使能配置项 - 在 taosAdapter 配置文件(默认位置 /etc/taos/taosadapter.toml中使能配置项
```toml ```toml
... ...
[statsd] [statsd]
enable = true enable = true
port = 6044 port = 6044
db = "statsd" db = "statsd"
user = "root" user = "root"
password = "taosdata" password = "taosdata"
worker = 10 worker = 10
gatherInterval = "5s" gatherInterval = "5s"
protocol = "udp" protocol = "udp"
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
allowPendingMessages = 50000 allowPendingMessages = 50000
deleteCounters = true deleteCounters = true
deleteGauges = true deleteGauges = true
deleteSets = true deleteSets = true
deleteTimings = true deleteTimings = true
... ...
``` ```
其中 taosAdapter 默认写入的数据库名称为 `statsd`,也可以修改 taosAdapter 配置文件 db 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过配置文件 taosAdapter 需重新启动。 其中 taosAdapter 默认写入的数据库名称为 `statsd`,也可以修改 taosAdapter 配置文件 db 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过配置文件 taosAdapter 需重新启动。
- 也可以使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 StatsD 数据功能,具体细节请参考 taosAdapter 的参考手册 - 使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 StatsD 数据功能,具体细节请参考 taosAdapter 的参考手册
#### 配置 StatsD #### 配置 StatsD

View File

@ -5,22 +5,22 @@
- 在 taosAdapter 配置文件(默认位置 /etc/taos/taosadapter.toml中使能配置项 - 在 taosAdapter 配置文件(默认位置 /etc/taos/taosadapter.toml中使能配置项
```toml ```toml
... ...
[opentsdb_telnet] [opentsdb_telnet]
enable = true enable = true
maxTCPConnections = 250 maxTCPConnections = 250
tcpKeepAlive = false tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"] dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049] ports = [6046, 6047, 6048, 6049]
user = "root" user = "root"
password = "taosdata" password = "taosdata"
... ...
``` ```
其中 taosAdapter 默认写入的数据库名称为 `tcollector`,也可以修改 taosAdapter 配置文件 dbs 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过配置文件 taosAdapter 需重新启动。 其中 taosAdapter 默认写入的数据库名称为 `tcollector`,也可以修改 taosAdapter 配置文件 dbs 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过配置文件 taosAdapter 需重新启动。
- 也可以使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 tcollector 数据功能,具体细节请参考 taosAdapter 的参考手册 - 使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 tcollector 数据功能,具体细节请参考 taosAdapter 的参考手册
#### 配置 TCollector #### 配置 TCollector