未验证 提交 fd46c11f 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

docs: 3rd parties refine (#11633)

* docs: 3rd parties doc refine

[TD-14841]

* docs: refine 3rd parties doc

[TD-14841]

* docs: correct version number

[TD-14841]

* docs: fix docs format

[TD-14841]

* docs: fix 3rd parties doc format

[TD-14841]

* docs: refine 3rd parties docs

[TD-14841]

* docs: fix docs format

[TD-14841]

* refine 3rd parties docs
上级 eba0d7b0
......@@ -3,38 +3,8 @@ sidebar_label: Prometheus
title: Prometheus 远端读取/远端写入
---
Prometheus 是一款流行的开源监控告警系统。Prometheus 的 remote_read 和 remote_write 的接口提供监控数据的远端读写的能力。
import Prometheus from "../14-reference/_prometheus.mdx"
TDengine 新版本(2.4.0.0+)包含一个 taosAdapter 独立程序,负责接收包括 Prometheus 在内的多种应用的数据写入。只需要将 remote_read 和 remote_write url 指向 taosAdapter 对应的 url 同时设置 Basic 验证即可使用。
启动 taosAdapter 的命令为 `systemctl start taosadapter`。可以使用 `systemctl status taosadapter` 检查 taosAdapter 的运行状态。
- remote_read url : `http://host_to_taosAdapter:port(default 6041)/prometheus/v1/remote_read/:db`
- remote_write url : `http://host_to_taosAdapter:port(default 6041)/prometheus/v1/remote_write/:db`
Basic 验证:
- username: TDengine 连接用户名
- password: TDengine 连接密码
示例 prometheus.yml 如下:
```yaml
remote_write:
- url: "http://localhost:6041/prometheus/v1/remote_write/prometheus_data"
basic_auth:
username: root
password: taosdata
remote_read:
- url: "http://localhost:6041/prometheus/v1/remote_read/prometheus_data"
basic_auth:
username: root
password: taosdata
remote_timeout: 10s
read_recent: true
```
即可在 TDengine 中查询 metrics 数据库中 Prometheus 写入的数据。
<Prometheus />
taosAdapter 相关配置参数请参考 `taosadapter --help` 命令输出以及相关文档。
......@@ -3,31 +3,8 @@ sidebar_label: Telegraf
title: Telegraf 写入
---
Telegraf 是一款十分流行的指标采集开源软件。安装 Telegraf 请参考[官方文档](https://portal.influxdata.com/downloads/)
import Telegraf from "../14-reference/_telegraf.mdx"
TDengine 新版本(2.4.0.0+)包含一个 taosAdapter 独立程序,可以接收包括 Telegraf 在内的多种应用的数据写入。
启动 taosAdapter 的命令为 `systemctl start taosadapter`。可以使用 `systemctl status taosadapter` 检查 taosAdapter 的运行状态。
配置方法,在 /etc/telegraf/telegraf.conf 增加如下配置,其中 `database name` 请填写希望在 TDengine 保存 Telegraf 数据的数据库名,`TDengine server``cluster host``username``password` 填写 TDengine 集群中的实际配置:
```
[[outputs.http]]
url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=<database name>"
method = "POST"
timeout = "5s"
username = "<TDengine's username>"
password = "<TDengine's password>"
data_format = "influx"
influx_max_line_bytes = 250
```
然后重启 telegraf:
```
sudo systemctl restart telegraf
```
即可在 TDengine 中查询 metrics 数据库中 Telegraf 写入的数据。
<Telegraf />
taosAdapter 相关配置参数请参考 `taosadapter --help` 命令输出以及相关文档。
......@@ -5,11 +5,23 @@ title: collectd 写入
import CollectD from "../14-reference/_collectd.mdx"
collectd 是一款插件式架构的开源监控软件,它可以收集各种来源的指标,如操作系统,应用程序,日志文件和外部设备,并存储此信息或通过网络提供。安装 collectd 请参考[官方文档](https://collectd.org/download.shtml)
collectd 是一款插件式架构的开源监控软件,它可以收集各种来源的指标,如操作系统,应用程序,日志文件和外部设备,并存储此信息或通过网络提供。将 collectd 采集的数据存在到 TDengine 中可以充分利用 TDengine 对时序数据的高效存储和查询能力。安装 collectd 请参考[官方文档](https://collectd.org/download.shtml)
## 依赖配置
TDengine 新版本(2.4.0.0+)包含一个 taosAdapter 独立程序,可以接收包括 collectd 的多种应用的数据写入。
启动 taosAdapter 的命令为 `systemctl start taosadapter`,可以使用 `systemctl status taosadapter` 检查 taosAdapter 的运行状态。
启动 taosAdapter:
```
systemctl start taosadapter
```
检查 taosAdapter 的运行状态:
```
systemctl status taosadapter
```
<CollectD />
......
......@@ -4,6 +4,7 @@ description: "taosAdapter 是一个 TDengine 的配套工具,是 TDengine 集
sidebar_label: "taosAdapter"
---
import Prometheus from "./_prometheus.mdx"
import CollectD from "./_collectd.mdx"
import StatsD from "./_statsd.mdx"
import Icinga2 from "./_icinga2.mdx"
......@@ -176,7 +177,7 @@ AllowWebSockets
### TDengine RESTful 接口
您可以使用任何支持 http 协议的客户端通过访问 RESTful 接口地址 `http://<fqdn>:6041/<APIEndPoint>` 来写入数据到 TDengine 或从 TDengine 中查询数据。细节请参考[官方文档](https://www.taosdata.com/cn/documentation/connector#restful)。支持如下 EndPoint :
您可以使用任何支持 http 协议的客户端通过访问 RESTful 接口地址 `http://<fqdn>:6041/<APIEndPoint>` 来写入数据到 TDengine 或从 TDengine 中查询数据。细节请参考[官方文档](/reference/connector#restful)。支持如下 EndPoint :
```text
/rest/sql
......@@ -236,34 +237,7 @@ Prometheus 使用的由\*NIX 内核暴露的硬件和操作系统指标的输出
### prometheus
remote_read 和 remote_write 是 Prometheus 数据读写分离的集群方案。
只需要将 remote_read 和 remote_write url 指向 taosAdapter 对应的 url 同时设置 Basic 验证即可使用。
- remote_read url : `http://host_to_taosAdapter:port(default 6041)/prometheus/v1/remote_read/:db`
- remote_write url : `http://host_to_taosAdapter:port(default 6041)/prometheus/v1/remote_write/:db`
Basic 验证:
- username: TDengine 连接用户名
- password: TDengine 连接密码
示例 prometheus.yml 如下:
```yaml
remote_write:
- url: "http://localhost:6041/prometheus/v1/remote_write/prometheus_data"
basic_auth:
username: root
password: taosdata
remote_read:
- url: "http://localhost:6041/prometheus/v1/remote_read/prometheus_data"
basic_auth:
username: root
password: taosdata
remote_timeout: 10s
read_recent: true
```
<Prometheus />
## 内存使用优化方法
......
......@@ -16,24 +16,24 @@ taosdump 可以用数据库、超级表或普通表作为逻辑数据单元备
taosdump 是一个逻辑备份工具。它不打算或不应被期望用于备份任何原始数据、环境设置、
硬件信息、服务端配置或集群的拓扑结构。它使用
[Apache AVRO](https://avro.apache.org/)作为数据文件格式来存储备份数据。
[ Apache AVRO ](https://avro.apache.org/)作为数据文件格式来存储备份数据。
## 常用使用场景
### taosdump 备份数据
1. 指定 -A 或 --all-databases 参数指定所有数据库;
2. 使用 -D db1,db2,... 参数备份指定的多个数据库;
3. 使用 dbname stbname1 stbname2 tbname1 tbname2 ... 参数方式备份指定数据库中的某些个超级表或普通表,注意这种输入序列第一个参数为数据库名称,且只支持一个数据库,第二个和之后的参数为该数据库中的超级表或普通表名称,中间以空格分隔;
4. TDengine 服务器或集群通常会包含一个系统数据库,名为 log,这个数据库内的数据为 TDengine 自我运行的数据,taosdump 默认不会对 log 库进行备份。如果有特定需求对 log 库进行备份,可以使用 -a 或 --allow-sys 命令行参数。
5. taosdump 1.4.1 之后的版本提供 -n 参数和 -L 参数,用于备份数据时不使用转义字符和“宽容”模式,可以在表名、列名、标签名没使用转义字符的情况下减少备份数据时间和备份数据占用空间。如果不确定符合使用 -n 和 -L 条件时请使用默认参数进行“严格”模式进行备份。转义字符的说明请参考[官方文档](https://tdengine.com/docs/cn/v2.0/taos-sql)
6. taosdump 1.4.1 之后的版本提供 -I 参数,用于解析 avro 文件 schema 和数据,如果指定 -s 参数将只解析 schema。
7. taosdump 1.4.2 之后的备份使用 -B 参数指定的批次数,默认值为 16384,如果在某些环境下由于网络速度或磁盘性能不足导致 "Error actual dump .. batch .." 可以通过 -B 参数挑战为更小的值进行尝试。
1. 指定 `-A``--all-databases` 参数指定所有数据库;
2. 使用 `-D db1,db2,...` 参数备份指定的多个数据库;
3. 使用 `dbname stbname1 stbname2 tbname1 tbname2 ...` 参数方式备份指定数据库中的某些个超级表或普通表,注意这种输入序列第一个参数为数据库名称,且只支持一个数据库,第二个和之后的参数为该数据库中的超级表或普通表名称,中间以空格分隔;
4. TDengine 服务器或集群通常会包含一个系统数据库,名为 `log`,这个数据库内的数据为 TDengine 自我运行的数据,taosdump 默认不会对 log 库进行备份。如果有特定需求对 log 库进行备份,可以使用 `-a``--allow-sys` 命令行参数。
5. taosdump 1.4.1 之后的版本提供 `-n` 参数和 `-L` 参数,用于备份数据时不使用转义字符和“宽容”模式,可以在表名、列名、标签名没使用转义字符的情况下减少备份数据时间和备份数据占用空间。如果不确定符合使用 `-n``-L` 条件时请使用默认参数进行“严格”模式进行备份。转义字符的说明请参考[官方文档](/reference/taos-sql/escape)
6. taosdump 1.4.1 之后的版本提供 `-I` 参数,用于解析 avro 文件 schema 和数据,如果指定 `-s` 参数将只解析 schema。
7. taosdump 1.4.2 之后的备份使用 `-B` 参数指定的批次数,默认值为 16384,如果在某些环境下由于网络速度或磁盘性能不足导致 "Error actual dump .. batch .." 可以通过 `-B` 参数挑战为更小的值进行尝试。
### taosdump 恢复数据
1. -i 加上数据文件所在路径作为参数进行备份指定路径下的数据文件。如前面提及,不应该使用同一个目录备份不同数据集合,也不应该在同一路径多次备份同一数据集,否则备份数据会造成覆盖或多次备份。
2. taosdump 内部使用 TDengine stmt binding API 进行恢复数据的写入,为提高数据恢复性能,目前使用 16384 为一次写入批次。如果备份数据中有比较多列数据,可能会导致产生 "WAL size exceeds limit" 错误,此时可以通过使用 -B 参数调整为一个更小的值进行尝试。
1. `-i` 加上数据文件所在路径作为参数进行备份指定路径下的数据文件。如前面提及,不应该使用同一个目录备份不同数据集合,也不应该在同一路径多次备份同一数据集,否则备份数据会造成覆盖或多次备份。
2. taosdump 内部使用 TDengine stmt binding API 进行恢复数据的写入,为提高数据恢复性能,目前使用 16384 为一次写入批次。如果备份数据中有比较多列数据,可能会导致产生 "WAL size exceeds limit" 错误,此时可以通过使用 `-B` 参数调整为一个更小的值进行尝试。
## 详细命令行参数列表
......
#### 直接采集
## 配置 collectd
#
collectd 支持直接采集和 tsdb 写入两种方式。
### 直接采集方式
修改 collectd 配置文件 `/etc/collectd/collectd.conf`,taosAdapter 默认使用端口 6045 来接收 collectd 直接采集方式的数据。
......@@ -9,7 +13,7 @@ LoadPlugin network
</Plugin>
```
#### tsdb 写入方式
### tsdb 写入方式
修改 collectd 配置文件 `/etc/collectd/collectd.conf`,taosAdapter 默认使用端口 6047 来接收 collectd tsdb 写入方式的数据。
......@@ -31,3 +35,8 @@ LoadPlugin write_tsdb
```
systemctl restart collectd
```
## 验证方法
重启 collectd 后可通过查询 TDengine 中数据库 `collectd` 来验证 Telegraf 写入的数据。
## 配置方法
配置 taosAdapter 接收 icinga2 数据的方法:
- 参考链接 `https://icinga.com/docs/icinga-2/latest/doc/14-features/#opentsdb-writer` 使能 opentsdb-writer
......@@ -10,3 +12,8 @@ object OpenTsdbWriter "opentsdb" {
port = 6048
}
```
## 验证方法
重启 icinga2 后可通过查询 TDengine 中配置指定的数据库来验证 Telegraf 写入的数据。
Prometheus 是一款流行的开源监控告警系统。Prometheus 的数据可以通过 remote_write 接口存储到 TDengine 中,也可以通过 remote_read 接口来查询,充分利用 TDengine 对时序数据的高效存储和查询能力。
## 依赖配置
TDengine 新版本(2.4.0.0+)包含一个 taosAdapter 独立程序,负责接收包括 Prometheus 在内的多种应用的数据写入。只需要将 Prometheus 的 remote_read 和 remote_write url 指向 taosAdapter 对应的 url 同时设置 Basic 验证即可使用。taosAdapter 可以和 TDengine 部署在同一个系统中,也可以分离部署,taosAdapter 的详细使用方法请参考相关文档。
启动 taosAdapter:
```
systemctl start taosadapter
```
检查 taosAdapter 的运行状态:
```
systemctl status taosadapter
```
## 配置 Prometheus
编辑 Prometheus 配置文件 prometheus.yml 中下列行:
- remote_read url : `http://host_to_taosAdapter:port(default 6041)/prometheus/v1/remote_read/:db`
- remote_write url : `http://host_to_taosAdapter:port(default 6041)/prometheus/v1/remote_write/:db`
Basic 验证配置:
- username: TDengine 连接用户名
- password: TDengine 连接密码
示例 prometheus.yml 如下:
```yaml
remote_write:
- url: "http://localhost:6041/prometheus/v1/remote_write/prometheus_data"
basic_auth:
username: root
password: taosdata
remote_read:
- url: "http://localhost:6041/prometheus/v1/remote_read/prometheus_data"
basic_auth:
username: root
password: taosdata
remote_timeout: 10s
read_recent: true
```
## 验证方法
重启 Prometheus 后可通过查询 TDengine 中的 metrics 数据库来验证 Prometheus 写入的数据。
## 配置 StatsD
在 `config.js` 文件中增加如下内容后启动 StatsD,其中 host 和 port 请填写 TDengine 和 taosAdapter 配置的实际值:
```
......@@ -14,3 +17,8 @@ port: 8125
, repeater: [{ host: '127.0.0.1', port: 6044}]
}
```
## 验证方法
重启 StatsD 后可通过查询 TDengine 中配置指定的数据库来验证 Telegraf 写入的数据。
## 配置 TCollector
配置 taosAdapter 接收 TCollector 数据的方法:
- 使能 taosAdapter 配置项 `opentsdb_telnet.enable`
- 修改 TCollector 配置文件,修改 OpenTSDB 宿主机地址为 taosAdapter 被部署的地址,并修改端口号为 taosAdapter 使用的端口(默认 6049)。
## 验证方法
重启 TCollector 后可通过查询 TDengine 中配置指定的数据库来验证 Telegraf 写入的数据。
Telegraf 是一款十分流行的指标采集开源软件,将 Telegraf 的数据存在到 TDengine 中可以充分利用 TDengine 对时序数据的高效存储和查询能力。安装 Telegraf 请参考[官方文档](https://portal.influxdata.com/downloads/)。
## 依赖配置
TDengine 新版本(2.4.0.0+)包含一个 taosAdapter 独立程序,可以接收包括 Telegraf 在内的多种应用的数据写入。
启动 taosAdapter:
```
systemctl start taosadapter
```
检查 taosAdapter 的运行状态:
```
systemctl status taosadapter
```
## 配置 Telegraf
配置方法,在 `/etc/telegraf/telegraf.conf` 增加如下配置,其中 `database name` 请填写希望在 TDengine 保存 Telegraf 数据的数据库名,`TDengine server`、`cluster host`、`username` 和 `password` 填写 TDengine 集群中的实际配置:
示例 telegraf.conf 如下:
```
[[outputs.http]]
url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=<database name>"
method = "POST"
timeout = "5s"
username = "<TDengine's username>"
password = "<TDengine's password>"
data_format = "influx"
influx_max_line_bytes = 250
```
## 验证方法
重启 Telegraf 后可通过查询 TDengine 中配置指定的数据库来验证 Telegraf 写入的数据。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册