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

docs: TDinsight English doc (#12759)

* docs: reference doc in English

[TD-15603]

* docs: reference docs in English

[TD-15603]

* docs: refine reference English docs

[TD-15603]

* docs: refine reference docs

* docs: refine refince docs

* docs: refine reference doc

* docs: refine reference doc

* docs: refine reference doc

* docs: refine reference doc

* docs: refine reference doc

* docs: fix typo

* docs: add TDinsight English doc

[TD-15603]
上级 e1290608
...@@ -82,7 +82,7 @@ Usage: ...@@ -82,7 +82,7 @@ Usage:
./TDinsight.sh -h|--help ./TDinsight.sh -h|--help
./TDinsight.sh -n <ds-name> -a <api-url> -u <user> -p <password> ./TDinsight.sh -n <ds-name> -a <api-url> -u <user> -p <password>
Install and configure TDinsight dashboard in Grafana on ubuntu 18.04/20.04 system. Install and configure TDinsight dashboard in Grafana on Ubuntu 18.04/20.04 system.
-h, -help, --help Display help -h, -help, --help Display help
...@@ -99,7 +99,7 @@ Install and configure TDinsight dashboard in Grafana on ubuntu 18.04/20.04 syste ...@@ -99,7 +99,7 @@ Install and configure TDinsight dashboard in Grafana on ubuntu 18.04/20.04 syste
-u, --tdengine-user <string> TDengine user name. [default: root] -u, --tdengine-user <string> TDengine user name. [default: root]
-p, --tdengine-password <string> TDengine password. [default: taosdata] -p, --tdengine-password <string> TDengine password. [default: taosdata]
-i, --tdinsight-uid <string> Replace with a non-space ascii code as the dashboard id. [default: tdinsight] -i, --tdinsight-uid <string> Replace with a non-space ASCII code as the dashboard id. [default: tdinsight]
-t, --tdinsight-title <string> Dashboard title. [default: TDinsight] -t, --tdinsight-title <string> Dashboard title. [default: TDinsight]
-e, --tdinsight-editable If the provisioning dashboard could be editable. [default: false] -e, --tdinsight-editable If the provisioning dashboard could be editable. [default: false]
...@@ -114,7 +114,7 @@ Aliyun SMS as Notifier: ...@@ -114,7 +114,7 @@ Aliyun SMS as Notifier:
-K, --sms-access-key-secret <string> Aliyun sms access key secret -K, --sms-access-key-secret <string> Aliyun sms access key secret
-S, --sms-sign-name <string> Sign name -S, --sms-sign-name <string> Sign name
-C, --sms-template-code <string> Template code -C, --sms-template-code <string> Template code
-T, --sms-template-param <string> Template param, a escaped json string like '{"alarm_level":"%s","time":"%s","name":"%s","content":"%s"}' -T, --sms-template-param <string> Template param, a escaped JSON string like '{"alarm_level":"%s","time":"%s","name":"%s","content":"%s"}'
-B, --sms-phone-numbers <string> Comma-separated numbers list, eg "189xxxxxxxx,132xxxxxxxx" -B, --sms-phone-numbers <string> Comma-separated numbers list, eg "189xxxxxxxx,132xxxxxxxx"
-L, --sms-listen-addr <string> [default: 127.0.0.1:9100] -L, --sms-listen-addr <string> [default: 127.0.0.1:9100]
``` ```
...@@ -262,7 +262,7 @@ sudo systemctl enable grafana-server ...@@ -262,7 +262,7 @@ sudo systemctl enable grafana-server
## TDinsight 仪表盘详细信息 ## TDinsight 仪表盘详细信息
TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes, vnodes](https://www.taosdata.com/cn/documentation/architecture#cluster)或数据库的使用情况和状态。 TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mnodes, vnodes](https://www.taosdata.com/cn/documentation/architecture#cluster)或数据库的使用情况和状态。
指标详情如下: 指标详情如下:
...@@ -281,7 +281,7 @@ TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes ...@@ -281,7 +281,7 @@ TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes
- **Connections** - 当前连接个数。 - **Connections** - 当前连接个数。
- **DNodes/MNodes/VGroups/VNodes**:每种资源的总数和存活数。 - **DNodes/MNodes/VGroups/VNodes**:每种资源的总数和存活数。
- **DNodes/MNodes/VGroups/VNodes Alive Percent**:每种资源的存活数/总数的比例,启用告警规则,并在资源存活率(1 分钟内平均健康资源比例)不足 100%时触发。 - **DNodes/MNodes/VGroups/VNodes Alive Percent**:每种资源的存活数/总数的比例,启用告警规则,并在资源存活率(1 分钟内平均健康资源比例)不足 100%时触发。
- **Messuring Points Used**:启用告警规则的测点数用量(社区版无数据,默认情况下是健康的)。 - **Measuring Points Used**:启用告警规则的测点数用量(社区版无数据,默认情况下是健康的)。
- **Grants Expire Time**:启用告警规则的企业版过期时间(社区版无数据,默认情况是健康的)。 - **Grants Expire Time**:启用告警规则的企业版过期时间(社区版无数据,默认情况是健康的)。
- **Error Rate**:启用警报的集群总合错误率(每秒平均错误数)。 - **Error Rate**:启用警报的集群总合错误率(每秒平均错误数)。
- **Variables**`show variables` 表格展示。 - **Variables**`show variables` 表格展示。
...@@ -349,7 +349,7 @@ TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes ...@@ -349,7 +349,7 @@ TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes
目前只报告每分钟登录次数。 目前只报告每分钟登录次数。
### TaosAdapter ### taosAdapter
![taosadapter](./assets/TDinsight-8-taosadapter.png) ![taosadapter](./assets/TDinsight-8-taosadapter.png)
...@@ -360,7 +360,7 @@ TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes ...@@ -360,7 +360,7 @@ TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes
3. **Memory Used**: taosAdapter 内存使用情况 3. **Memory Used**: taosAdapter 内存使用情况
4. **latency_quantile(ms)**: (1, 2, 5, 9, 99)阶段的分位数 4. **latency_quantile(ms)**: (1, 2, 5, 9, 99)阶段的分位数
5. **top 3 failed request endpoint**: 按终端分组,请求失败排名前三的数据 5. **top 3 failed request endpoint**: 按终端分组,请求失败排名前三的数据
6. **CPU Used**: taosAdapter cpu 使用情况 6. **CPU Used**: taosAdapter CPU 使用情况
## 升级 ## 升级
......
--- ---
title: TDinsight - 基于Grafana的TDengine零依赖监控解决方案 title: TDinsight - Grafana-based Zero-Dependency Monitoring Solution for TDengine
sidebar_label: TDinsight sidebar_label: TDinsight
--- ---
TDinsight 是使用 [TDengine] 原生监控数据库和 [Grafana] 对 TDengine 进行监控的解决方案。 TDinsight is a solution for monitoring TDengine using the [TDengine] native monitoring database and [Grafana].
TDengine 启动后,会自动创建一个监测数据库 log,并自动将服务器的 CPU、内存、硬盘空间、带宽、请求数、磁盘读写速度、慢查询等信息定时写入该数据库,并对重要的系统操作(比如登录、创建、删除数据库等)以及各种错误报警信息进行记录。通过 [Grafana] 和 [TDengine 数据源插件](https://github.com/taosdata/grafanaplugin/releases),TDinsight 将集群状态、节点信息、插入及查询请求、资源使用情况等进行可视化展示,同时还支持 vnode、dnode、mnode 节点状态异常告警,为开发者实时监控 TDengine 集群运行状态提供了便利。本文将指导用户安装 Grafana 服务器并通过 `TDinsight.sh` 安装脚本自动安装 TDengine 数据源插件及部署 TDinsight 可视化面板。 After TDengine starts, it will automatically create a monitoring database log. TDengine will automatically write many metrics in specific intervals into the log database. The metrics may include the server's CPU, memory, hard disk space, network bandwidth, number of requests, disk read/write speed, slow queries, and other information, and record important system operations (such as login, database creation, database deletion, etc.), and various error alarms. With [Grafana] and [TDengine Data Source Plugin](https://github.com/taosdata/grafanaplugin/releases), TDinsight could visualize cluster status, node information, insertion and query requests, resource usage, etc., and also supports vnode, dnode, and mnode status, exception alerts, and support developers with the convenience of monitoring TDengine cluster operation status in real-time. This article will guide users to install the Grafana server, automatically install the TDengine data source plug-in, and deploy the TDinsight visualization panel through `TDinsight.sh` installation script.
## 系统要求 ## System Requirements
要部署 TDinsight,需要一个单节点的 TDengine 服务器或一个多节点的 [TDengine] 集群,以及一个[Grafana]服务器。此仪表盘需要 TDengine 2.3.3.0 及以上,并启用 `log` 数据库(`monitor = 1`)。 To deploy TDinsight, a single-node TDengine server or a multi-nodes TDengine cluster and a [Grafana] server are required. This dashboard requires TDengine 2.3.3.0 and above, with the `log` database enabled (`monitor = 1`).
## 安装 Grafana ## Installing Grafana
我们建议在此处使用最新的[Grafana] 7 或 8 版本。您可以在任何[支持的操作系统](https://grafana.com/docs/grafana/latest/installation/requirements/#supported-operating-systems)中,按照 [Grafana 官方文档安装说明](https://grafana.com/docs/grafana/latest/installation/) 安装 [Grafana]。 We recommend using the latest [Grafana] version 7 or 8 here. You can install Grafana on any [supported operating system](https://grafana.com/docs/grafana/latest/installation/requirements/#supported-operating-systems) by following the [official Grafana documentation Instructions](https://grafana.com/docs/grafana/latest/installation/) to install [Grafana].
### 在 Debian 或 Ubuntu 上安装 Grafana ### Installing Grafana on Debian or Ubuntu
对于 Debian 或 Ubuntu 操作系统,建议使用 Grafana 镜像仓库。使用如下命令从零开始安装: For Debian or Ubuntu operating systems, we recommend the Grafana image repository and Use the following command to install from scratch.
```bash ```bash
sudo apt-get install -y apt-transport-https sudo apt-get install -y apt-transport-https
...@@ -30,9 +30,9 @@ sudo apt-get update ...@@ -30,9 +30,9 @@ sudo apt-get update
sudo apt-get install grafana sudo apt-get install grafana
``` ```
### 在 CentOS / RHEL 上安装 Grafana ### Install Grafana on CentOS / RHEL
您可以从官方 YUM 镜像仓库安装。 You can install it from its official YUM repository.
```bash ```bash
sudo tee /etc/yum.repos.d/grafana.repo << EOF sudo tee /etc/yum.repos.d/grafana.repo << EOF
...@@ -49,7 +49,7 @@ EOF ...@@ -49,7 +49,7 @@ EOF
sudo yum install grafana sudo yum install grafana
``` ```
或者用 RPM 安装: Or install its RPM package.
```bash ```bash
wget https://dl.grafana.com/oss/release/grafana-7.5.11-1.x86_64.rpm wget https://dl.grafana.com/oss/release/grafana-7.5.11-1.x86_64.rpm
...@@ -59,22 +59,22 @@ sudo yum install \ ...@@ -59,22 +59,22 @@ sudo yum install \
https://dl.grafana.com/oss/release/grafana-7.5.11-1.x86_64.rpm https://dl.grafana.com/oss/release/grafana-7.5.11-1.x86_64.rpm
``` ```
## 自动部署 TDinsight ## Automated deployment of TDinsight
我们提供了一个自动化安装脚本 [`TDinsight.sh`](https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh) 脚本以便用户快速进行安装配置。 We provide an automated installation script [`TDinsight.sh`](https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh) script to allow users to configure the installation quickly.
您可以通过 `wget` 或其他工具下载该脚本: You can download the script via `wget` or other tools:
```bash ``bash
wget https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh wget https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh
chmod +x TDinsight.sh chmod +x TDinsight.sh
``` ```
这个脚本会自动下载最新的[Grafana TDengine 数据源插件](https://github.com/taosdata/grafanaplugin/releases/latest)[TDinsight 仪表盘](https://grafana.com/grafana/dashboards/15167) ,将命令行选项中的可配置参数转为 [Grafana Provisioning](https://grafana.com/docs/grafana/latest/administration/provisioning/) 配置文件,以进行自动化部署及更新等操作。利用该脚本提供的告警设置选项,你还可以获得内置的阿里云短信告警通知支持。 This script will automatically download the latest [Grafana TDengine data source plugin](https://github.com/taosdata/grafanaplugin/releases/latest) and [TDinsight dashboard](https://grafana.com/) grafana/dashboards/15167) with configurable parameters from the command-line options to the [Grafana Provisioning](https://grafana.com/docs/grafana/latest/administration/provisioning /) configuration file to automate deployment and updates, etc. With the alert setting options provided by this script, you can also get built-in support for AliCloud SMS alert notifications.
假设您在同一台主机上使用 TDengine 和 Grafana 的默认服务。运行 `./TDinsight.sh` 并打开 Grafana 浏览器窗口就可以看到 TDinsight 仪表盘了。 Assume you use TDengine and Grafana's default services on the same host. Run `. /TDinsight.sh` and open the Grafana browser window to see the TDinsight dashboard.
下面是 TDinsight.sh 的用法说明: The following is a description of TDinsight.sh usage.
```bash ```bash
Usage: Usage:
...@@ -82,7 +82,7 @@ Usage: ...@@ -82,7 +82,7 @@ Usage:
./TDinsight.sh -h|--help ./TDinsight.sh -h|--help
./TDinsight.sh -n <ds-name> -a <api-url> -u <user> -p <password> ./TDinsight.sh -n <ds-name> -a <api-url> -u <user> -p <password>
Install and configure TDinsight dashboard in Grafana on ubuntu 18.04/20.04 system. Install and configure TDinsight dashboard in Grafana on Ubuntu 18.04/20.04 system.
-h, -help, --help Display help -h, -help, --help Display help
...@@ -92,21 +92,21 @@ Install and configure TDinsight dashboard in Grafana on ubuntu 18.04/20.04 syste ...@@ -92,21 +92,21 @@ Install and configure TDinsight dashboard in Grafana on ubuntu 18.04/20.04 syste
-P, --grafana-provisioning-dir <dir> Grafana provisioning directory, [default: /etc/grafana/provisioning/] -P, --grafana-provisioning-dir <dir> Grafana provisioning directory, [default: /etc/grafana/provisioning/]
-G, --grafana-plugins-dir <dir> Grafana plugins directory, [default: /var/lib/grafana/plugins] -G, --grafana-plugins-dir <dir> Grafana plugins directory, [default: /var/lib/grafana/plugins]
-O, --grafana-org-id <number> Grafana orgnization id. [default: 1] -O, --grafana-org-id <number> Grafana organization id. [default: 1]
-n, --tdengine-ds-name <string> TDengine datasource name, no space. [default: TDengine] -n, --tdengine-ds-name <string> TDengine datasource name, no space. [default: TDengine]
-a, --tdengine-api <url> TDengine REST API endpoint. [default: http://127.0.0.1:6041] -a, --tdengine-api <url> TDengine REST API endpoint. [default: http://127.0.0.1:6041]
-u, --tdengine-user <string> TDengine user name. [default: root] -u, --tdengine-user <string> TDengine user name. [default: root]
-p, --tdengine-password <string> TDengine password. [default: taosdata] -p, --tdengine-password <string> TDengine password. [default: taosdata]
-i, --tdinsight-uid <string> Replace with a non-space ascii code as the dashboard id. [default: tdinsight] -i, --tdinsight-uid <string> Replace with a non-space ASCII code as the dashboard id. [default: tdinsight]
-t, --tdinsight-title <string> Dashboard title. [default: TDinsight] -t, --tdinsight-title <string> Dashboard title. [default: TDinsight]
-e, --tdinsight-editable If the provisioning dashboard could be editable. [default: false] -e, --tdinsight-editable If the provisioning dashboard could be editable. [default: false]
-E, --external-notifier <string> Apply external notifier uid to TDinsight dashboard. -E, --external-notifier <string> Apply external notifier uid to TDinsight dashboard.
Aliyun SMS as Notifier: Aliyun SMS as Notifier:
-s, --sms-enabled To enable tdengine-datasource plugin builtin aliyun sms webhook. -s, --sms-enabled To enable tdengine-datasource plugin builtin Aliyun SMS webhook.
-N, --sms-notifier-name <string> Provisioning notifier name.[default: TDinsight Builtin SMS] -N, --sms-notifier-name <string> Provisioning notifier name.[default: TDinsight Builtin SMS]
-U, --sms-notifier-uid <string> Provisioning notifier uid, use lowercase notifier name by default. -U, --sms-notifier-uid <string> Provisioning notifier uid, use lowercase notifier name by default.
-D, --sms-notifier-is-default Set notifier as default. -D, --sms-notifier-is-default Set notifier as default.
...@@ -114,86 +114,86 @@ Aliyun SMS as Notifier: ...@@ -114,86 +114,86 @@ Aliyun SMS as Notifier:
-K, --sms-access-key-secret <string> Aliyun sms access key secret -K, --sms-access-key-secret <string> Aliyun sms access key secret
-S, --sms-sign-name <string> Sign name -S, --sms-sign-name <string> Sign name
-C, --sms-template-code <string> Template code -C, --sms-template-code <string> Template code
-T, --sms-template-param <string> Template param, a escaped json string like '{"alarm_level":"%s","time":"%s","name":"%s","content":"%s"}' -T, --sms-template-param <string> Template param, a escaped JSON string like '{"alarm_level":"%s","time":"%s","name":"%s","content":"%s"}'
-B, --sms-phone-numbers <string> Comma-separated numbers list, eg "189xxxxxxxx,132xxxxxxxx" -B, --sms-phone-numbers <string> Comma-separated numbers list, eg "189xxxxxxxx,132xxxxxxxx"
-L, --sms-listen-addr <string> [default: 127.0.0.1:9100] -L, --sms-listen-addr <string> [default: 127.0.0.1:9100]
``` ```
大多数命令行选项都可以通过环境变量获得同样的效果。 Most command-line options can take effect the same as environment variables.
| 短选项 | 长选项 | 环境变量 | 说明 | | Short Options | Long Options | Environment Variables | Description |
| ------ | -------------------------- | ---------------------------- | --------------------------------------------------------------------------- | | ------ | -------------------------- | ---------------------------- | ------------------------------------------------------------------ --------- |
| -v | --plugin-version | TDENGINE_PLUGIN_VERSION | TDengine 数据源插件版本,默认使用最新版。 | | -v | --plugin-version | TDENGINE_PLUGIN_VERSION | The TDengine data source plugin version, the latest version is used by default. | -P
| -P | --grafana-provisioning-dir | GF_PROVISIONING_DIR | Grafana 配置目录,默认为`/etc/grafana/provisioning/` | | -P | --grafana-provisioning-dir | GF_PROVISIONING_DIR | The Grafana configuration directory, defaults to `/etc/grafana/provisioning/` |
| -G | --grafana-plugins-dir | GF_PLUGINS_DIR | Grafana 插件目录,默认为`/var/lib/grafana/plugins`。 | | -G | --grafana-plugins-dir | GF_PLUGINS_DIR | The Grafana plugin directory, defaults to `/var/lib/grafana/plugins`. | -O
| -O | --grafana-org-id | GF_ORG_ID | Grafana 组织 ID,默认为 1。 | | -O | --grafana-org-id | GF_ORG_ID | The Grafana organization ID, default is 1. |
| -n | --tdengine-ds-name | TDENGINE_DS_NAME | TDengine 数据源名称,默认为 TDengine。 | | -n | --tdengine-ds-name | TDENGINE_DS_NAME | The name of the TDengine data source, defaults to TDengine. | -a | --tdengine-ds-name | The name of the TDengine data source, defaults to TDengine.
| -a | --tdengine-api | TDENGINE_API | TDengine REST API 端点。默认为`http://127.0.0.1:6041`。 | | -a | --tdengine-api | TDENGINE_API | The TDengine REST API endpoint. Defaults to `http://127.0.0.1:6041`. | -u
| -u | --tdengine-user | TDENGINE_USER | TDengine 用户名。 [默认值:root] | | -u | --tdengine-user | TDENGINE_USER | TDengine username. [default: root] |
| -p | --tdengine-密码 | TDENGINE_PASSWORD | TDengine 密码。 [默认:taosdata] | | -p | --tdengine-password | TDENGINE_PASSWORD | TDengine password. [default: tadosdata] | -i | --tdengine-password
| -i | --tdinsight-uid | TDINSIGHT_DASHBOARD_UID | TDinsight 仪表盘`uid`。 [默认值:tdinsight] | | -i | --tdinsight-uid | TDINSIGHT_DASHBOARD_UID | TDinsight `uid` of the dashboard. [default: tdinsight] |
| -t | --tdinsight-title | TDINSIGHT_DASHBOARD_TITLE | TDinsight 仪表盘标题。 [默认:TDinsight] | | -t | --tdinsight-title | TDINSIGHT_DASHBOARD_TITLE | TDinsight dashboard title. [Default: TDinsight] | -e | -tdinsight-title
| -e | --tdinsight-可编辑 | TDINSIGHT_DASHBOARD_EDITABLE | 如果配置仪表盘可以编辑。 [默认值:false] | | -e | --tdinsight-editable | TDINSIGHT_DASHBOARD_EDITABLE | If the dashboard is configured to be editable. [Default: false] | -e | --external
| -E | --external-notifier | EXTERNAL_NOTIFIER | 将外部通知程序 uid 应用于 TDinsight 仪表盘。 | | -E | --external-notifier | EXTERNAL_NOTIFIER | Apply the external notifier uid to the TDinsight dashboard. | -s
| -s | --sms-enabled | SMS_ENABLED | 启用阿里云短信 webhook 内置的 tdengine-datasource 插件。 | | -s | --sms-enabled | SMS_ENABLED | Enable the tdengine-datasource plugin built into Aliyun SMS webhook. | -s
| -N | --sms-notifier-name | SMS_NOTIFIER_NAME | 供应通知程序名称。[默认:`TDinsight Builtin SMS`] | | -N | --sms-notifier-name | SMS_NOTIFIER_NAME | The name of the provisioning notifier. [Default: `TDinsight Builtin SMS`] | -U
| -U | --sms-notifier-uid | SMS_NOTIFIER_UID | "Notification Channel" `uid`,默认使用程序名称的小写,其他字符用 “-” 代替。 | | -U | --sms-notifier-uid | SMS_NOTIFIER_UID | "Notification Channel" `uid`, lowercase of the program name is used by default, other characters are replaced by "-". |-sms
| -D | --sms-notifier-is-default | SMS_NOTIFIER_IS_DEFAULT | 将内置短信通知设置为默认值。 | | -D | --sms-notifier-is-default | SMS_NOTIFIER_IS_DEFAULT | Set built-in SMS notification to default value. |-sms-notifier-is-default
| -I | --sms-access-key-id | SMS_ACCESS_KEY_ID | 阿里云短信访问密钥 id | | -I | --sms-access-key-id | SMS_ACCESS_KEY_ID | Aliyun SMS access key id |
| -K | --sms-access-key-secret | SMS_ACCESS_KEY_SECRET | 阿里云短信访问秘钥 | | -K | --sms-access-key-secret | SMS_ACCESS_KEY_SECRET | 阿里云SMS-access-secret-key |
| -S | --sms-sign-name | SMS_SIGN_NAME | 签名 | | -S | --sms-sign-name | SMS_SIGN_NAME | Signature |
| -C | --sms-template-code | SMS_TEMPLATE_CODE | 模板代码 | | -C | --sms-template-code | SMS_TEMPLATE_CODE | Template code |
| -T | --sms-template-param | SMS_TEMPLATE_PARAM | 模板参数的 JSON 模板 | | -T | --sms-template-param | SMS_TEMPLATE_PARAM | JSON template for template parameters |
| -B | --sms-phone-numbers | SMS_PHONE_NUMBERS | 逗号分隔的手机号列表,例如`"189xxxxxxxx,132xxxxxxxx"` | | -B | --sms-phone-numbers | SMS_PHONE_NUMBERS | A comma-separated list of phone numbers, e.g. `"189xxxxxxxx,132xxxxxxxx"` |
| -L | --sms-listen-addr | SMS_LISTEN_ADDR | 内置 sms webhook 监听地址,默认为`127.0.0.1:9100` | | -L | --sms-listen-addr | SMS_LISTEN_ADDR | Built-in sms webhook listener address, default is `127.0.0.1:9100` |
假设您在主机 `tdengine` 上启动 TDengine 数据库,HTTP API 端口为 `6041`,用户为 `root1`,密码为 `pass5ord`。执行脚本: Suppose you start a TDengine database on host `tdengine` with HTTP API port `6041`, user `root1`, and password `pass5ord`. Execute the script.
```bash ```bash
sudo ./TDinsight.sh -a http://tdengine:6041 -u root1 -p pass5ord sudo . /TDinsight.sh -a http://tdengine:6041 -u root1 -p pass5ord
``` ```
我们提供了一个“-E”选项,用于从命令行配置 TDinsight 使用现有的通知通道(Notification Channel)。假设你的 Grafana 用户和密码是 `admin:admin`,使用以下命令获取已有的通知通道的`uid` We provide a "-E" option to configure TDinsight to use the existing Notification Channel from the command line. Assuming your Grafana user and password is `admin:admin`, use the following command to get the `uid` of an existing notification channel.
```bash ``bash
curl --no-progress-meter -u admin:admin http://localhost:3000/api/alert-notifications | jq curl --no-progress-meter -u admin:admin http://localhost:3000/api/alert-notifications | jq
``` ```
使用上面获取的 `uid` 值作为 `-E` 输入。 Use the `uid` value obtained above as `-E` input.
```bash ```bash
sudo ./TDinsight.sh -a http://tdengine:6041 -u root1 -p pass5ord -E existing-notifier sudo ./TDinsight.sh -a http://tdengine:6041 -u root1 -p pass5ord -E existing-notifier
``` ```
如果你想使用[阿里云短信](https://www.aliyun.com/product/sms)服务作为通知渠道,你应该使用`-s`标志启用并添加以下参数: If you want to use the [AliCloud SMS](https://www.aliyun.com/product/sms) service as a notification channel, you should enable it with the `-s` flag add the following parameters.
- `-N`:Notification Channel 名,默认为`TDinsight Builtin SMS` - `-N`: Notification Channel name, default is `TDinsight Builtin SMS`.
- `-U`:Channel uid,默认是 `name` 的小写,任何其他字符都替换为 - ,对于默认的 `-N`,其 uid 为 `tdinsight-builtin-sms` - `-U`: Channel uid, default is lowercase of `name`, any other character is replaced with -, for the default `-N`, its uid is `tdinsight-builtin-sms`.
- `-I`:阿里云短信访问密钥 id。 - `-I`: Aliyun SMS access key id.
- `-K`:阿里云短信访问秘钥。 - `-K`: Aliyun SMS access secret key.
- `-S`:阿里云短信签名。 - `-S`: Aliyun SMS signature.
- `-C`:阿里云短信模板 ID。 - `-C`: Aliyun SMS template id.
- `-T`:阿里云短信模板参数,为 JSON 格式模板,示例如下 `'{"alarm_level":"%s","time":"%s","name":"%s","content":"%s "}'`。有四个参数:告警级别、时间、名称和告警内容。 - `-T`: Aliyun SMS template parameters, for JSON format template, example is as follows `'{"alarm_level":"%s", "time":"%s", "name":"%s", "content":"%s"}'`. There are four parameters: alarm level, time, name and alarm content.
- `-B`:电话号码列表,以逗号`,`分隔。 - `-B`: a list of phone numbers, separated by a comma `,`.
如果要监控多个 TDengine 集群,则需要设置多个 TDinsight 仪表盘。设置非默认 TDinsight 需要进行一些更改: `-n` `-i` `-t` 选项需要更改为非默认名称,如果使用 内置短信告警功能,`-N``-L` 也应该改变。 If you want to monitor multiple TDengine clusters, you need to set up numerous TDinsight dashboards. Setting up non-default TDinsight requires some changes: the `-n` `-i` `-t` options need to be changed to non-default names, and `-N` and `-L` should also be changed if using the built-in SMS alerting feature.
```bash ```bash
sudo ./TDengine.sh -n TDengine-Env1 -a http://another:6041 -u root -p taosdata -i tdinsight-env1 -t 'TDinsight Env1' sudo . /TDengine.sh -n TDengine-Env1 -a http://another:6041 -u root -p taosdata -i tdinsight-env1 -t 'TDinsight Env1'
# 如果使用内置短信通知 # If using built-in SMS notifications
sudo ./TDengine.sh -n TDengine-Env1 -a http://another:6041 -u root -p taosdata -i tdinsight-env1 -t 'TDinsight Env1' \ sudo . /TDengine.sh -n TDengine-Env1 -a http://another:6041 -u root -p taosdata -i tdinsight-env1 -t 'TDinsight Env1' \
-s -N 'Env1 SMS' -I xx -K xx -S xx -C SMS_XX -T '' -B 00000000000 -L 127.0.0.01:10611 -s -N 'Env1 SMS' -I xx -K xx -S xx -C SMS_XX -T '' -B 00000000000 -L 127.0.0.01:10611
``` ``''
请注意,配置数据源、通知 Channel 和仪表盘在前端是不可更改的。您应该再次通过此脚本更新配置或手动更改 `/etc/grafana/provisioning` 目录(这是 Grafana 的默认目录,根据需要使用`-P`选项更改)中的配置文件。 Please note that the configuration data source, notification channel, and dashboard are not changeable on the front end. You should update the configuration again via this script or manually change the configuration file in the `/etc/grafana/provisioning` directory (this is the default directory for Grafana, use the `-P` option to change it as needed).
特别地,当您使用 Grafana Cloud 或其他组织时,`-O` 可用于设置组织 ID。 `-G` 可指定 Grafana 插件安装目录。 `-e` 参数将仪表盘设置为可编辑。 Specifically, `-O` can be used to set the organization ID when you are using Grafana Cloud or another organization. `-G` specifies the Grafana plugin installation directory. The `-e` parameter sets the dashboard to be editable.
## 手动设置 TDinsight ## Set up TDinsight manually
### 安装 TDengine 数据源插件 ### Install the TDengine data source plugin
从 GitHub 安装 TDengine 最新版数据源插件。 Install the latest version of the TDengine Data Source plugin from GitHub.
```bash ```bash
get_latest_release() { get_latest_release() {
...@@ -207,196 +207,196 @@ sudo grafana-cli \ ...@@ -207,196 +207,196 @@ sudo grafana-cli \
plugins install tdengine-datasource plugins install tdengine-datasource
``` ```
### 配置 Grafana :::note
The 3.1.6 and earlier version plugins require the following setting in the configuration file `/etc/grafana/grafana.ini` to enable unsigned plugins.
将以下设置添加到配置文件 `/etc/grafana/grafana.ini`,以启用未签名插件。 ``ini
```ini
[plugins] [plugins]
allow_loading_unsigned_plugins = tdengine-datasource allow_loading_unsigned_plugins = tdengine-datasource
``` ```
:::
### 启动 Grafana 服务 ### Start the Grafana service
```bash ```bash
sudo systemctl start grafana-server sudo systemctl start grafana-server
sudo systemctl enable grafana-server sudo systemctl enable grafana-server
``` ```
### 登录到 Grafana ### Logging into Grafana
在 Web 浏览器中打开默认的 Grafana 网址:`http://localhost:3000` Open the default Grafana URL in a web browser: ``http://localhost:3000``.
默认用户名/密码都是 `admin`。Grafana 会要求在首次登录后更改密码。 The default username/password is `admin`. Grafana will require a password change after the first login.
### 添加 TDengine 数据源 ### Adding a TDengine Data Source
指向 **Configurations** -> **Data Sources** 菜单,然后点击 **Add data source** 按钮。 Point to the **Configurations** -> **Data Sources** menu, and click the **Add data source** button.
![添加数据源按钮](./assets/howto-add-datasource-button.png) ! [Add data source button](. /assets/howto-add-datasource-button.png)
搜索并选择**TDengine** Search for and select **TDengine**.
![添加数据源](./assets/howto-add-datasource-tdengine.png) ! [Add datasource](. /assets/howto-add-datasource-tdengine.png)
配置 TDengine 数据源。 Configure the TDengine datasource.
![数据源配置](./assets/howto-add-datasource.png) ! [Datasource Configuration](. /assets/howto-add-datasource.png)
保存并测试,正常情况下会报告 'TDengine Data source is working'。 Save and test. It will report 'TDengine Data source is working' under normal circumstances.
![数据源测试](./assets/howto-add-datasource-test.png) ! [datasource test](. /assets/howto-add-datasource-test.png)
### 导入仪表盘 ### Importing dashboards
指向 **+** / **Create** - **import**(或 `/dashboard/import` url)。 Point to **+** / **Create** - **import** (or `/dashboard/import` url).
![导入仪表盘和配置](./assets/import_dashboard.png) ! [Import Dashboard and Configuration](. /assets/import_dashboard.png)
**Import via grafana.com** 位置键入仪表盘 ID `15167`**Load** Type the dashboard ID `15167` in the **Import via grafana.com** location and **Load**.
![通过 grafana.com 导入](./assets/import-dashboard-15167.png) ! [Import via grafana.com](. /assets/import-dashboard-15167.png)
导入完成后,TDinsight 的完整页面视图如下所示。 Once the import is complete, the full page view of TDinsight is shown below.
![显示](./assets/TDinsight-full.png) ! [show](. /assets/TDinsight-full.png)
## TDinsight 仪表盘详细信息 ## TDinsight dashboard details
TDinsight 仪表盘旨在提供 TDengine 相关资源使用情况[dnodes, mdodes, vnodes](https://www.taosdata.com/cn/documentation/architecture#cluster)或数据库的使用情况和状态。 The TDinsight dashboard is designed to provide the usage and status of TDengine-related resources [dnodes, mnodes, vnodes](https://www.taosdata.com/cn/documentation/architecture#cluster) or databases.
指标详情如下: Details of the metrics are as follows.
### 集群状态 ### Cluster Status
![tdinsight-mnodes-overview](./assets/TDinsight-1-cluster-status.png) ! [tdinsight-mnodes-overview](. /assets/TDinsight-1-cluster-status.png)
这部分包括集群当前信息和状态,告警信息也在此处(从左到右,从上到下)。 This section contains the current information and status of the cluster, the alert information is also here (from left to right, top to bottom).
- **First EP**:当前 TDengine 集群中的`firstEp`设置。 - **First EP**: the `firstEp` setting in the current TDengine cluster.
- **Version**:TDengine 服务器版本(master mnode)。 - **Version**: TDengine server version (master mnode).
- **Master Uptime**: 当前 Master MNode 被选举为 Master 后经过的时间。 - **Master Uptime**: The time elapsed since the current Master MNode was elected as Master.
- **Expire Time** - 企业版过期时间。 - **Expire Time** - Enterprise version expiration time.
- **Used Measuring Points** - 企业版已使用的测点数。 - **Used Measuring Points** - The number of measuring points used by the Enterprise Edition.
- **Databases** - 数据库个数。 - **Databases** - The number of databases.
- **Connections** - 当前连接个数。 - **Connections** - The number of current connections.
- **DNodes/MNodes/VGroups/VNodes**:每种资源的总数和存活数。 - **DNodes/MNodes/VGroups/VNodes** - Total number of each resource and the number of survivors.
- **DNodes/MNodes/VGroups/VNodes Alive Percent**:每种资源的存活数/总数的比例,启用告警规则,并在资源存活率(1 分钟内平均健康资源比例)不足 100%时触发。 - **DNodes/MNodes/VGroups/VNodes Alive Percent**: The ratio of the number of alive/total for each resource, enabling the alert rule and triggering it when the resource liveness rate (the average percentage of healthy resources in 1 minute) is less than 100%.
- **Messuring Points Used**:启用告警规则的测点数用量(社区版无数据,默认情况下是健康的)。 - **Measuring Points Used**: The number of measuring points used to enable the alert rule (no data available in the community version, healthy by default).
- **Grants Expire Time**:启用告警规则的企业版过期时间(社区版无数据,默认情况是健康的)。 - **Grants Expire Time**: the expiration time of the enterprise version of the enabled alert rule (no data available for the community version, healthy by default).
- **Error Rate**:启用警报的集群总合错误率(每秒平均错误数)。 - **Error Rate**: Aggregate error rate (average number of errors per second) for alert-enabled clusters.
- **Variables**`show variables` 表格展示。 - **Variables**: `show variables` table display.
### DNodes 状态 ### DNodes Status
![tdinsight-mnodes-overview](./assets/TDinsight-2-dnodes.png) ! [tdinsight-mnodes-overview](. /assets/TDinsight-2-dnodes.png)
- **DNodes Status**`show dnodes` 的简单表格视图。 - **DNodes Status**: simple table view of `show dnodes`.
- **DNodes Lifetime**:从创建 dnode 开始经过的时间。 - **DNodes Lifetime**: the time elapsed since the dnode was created.
- **DNodes Number**:DNodes 数量变化。 - **DNodes Number**: the number of DNodes changes.
- **Offline Reason**:如果有任何 dnode 状态为离线,则以饼图形式展示离线原因。 - **Offline Reason**: if any dnode status is offline, the reason for offline is shown as a pie chart.
### MNode 概述 ### MNode Overview
![tdinsight-mnodes-overview](./assets/TDinsight-3-mnodes.png) ! [tdinsight-mnodes-overview](. /assets/TDinsight-3-mnodes.png)
1. **MNodes Status**`show mnodes` 的简单表格视图。 1. **MNodes Status**: a simple table view of `show mnodes`. 2.
2. **MNodes Number**:类似于`DNodes Number`,MNodes 数量变化。 2. **MNodes Number**: similar to `DNodes Number`, the number of MNodes changes.
### 请求 ### Request
![tdinsight-requests](./assets/TDinsight-4-requests.png) ! [tdinsight-requests](. /assets/TDinsight-4-requests.png)
1. **Requests Rate(Inserts per Second)**:平均每秒插入次数。 1. **Requests Rate(Inserts per Second)**: average number of inserts per second.
2. **Requests (Selects)**:查询请求数及变化率(count of second)。 2. **Requests (Selects)**: number of query requests and change rate (count of second).
3. **Requests (HTTP)**:HTTP 请求数和请求速率(count of second)。 3. **Requests (HTTP)**: number of HTTP requests and request rate (count of second).
### 数据库 ### Database
![tdinsight-database](./assets/TDinsight-5-database.png) ! [tdinsight-database](. /assets/TDinsight-5-database.png)
数据库使用情况,对变量 `$database` 的每个值即每个数据库进行重复多行展示。 Database usage, repeated for each value of the variable `$database` i.e. multiple rows per database.
1. **STables**:超级表数量。 1. **STables**: number of super tables. 2.
2. **Total Tables**:所有表数量。 2. **Total Tables**: number of all tables. 3.
3. **Sub Tables**:所有超级表子表的数量。 3. **Sub Tables**: the number of all super table sub-tables. 4.
4. **Tables**:所有普通表数量随时间变化图。 4. **Tables**: graph of all normal table numbers over time.
5. **Tables Number Foreach VGroups**:每个 VGroups 包含的表数量。 5. **Tables Number Foreach VGroups**: The number of tables contained in each VGroups.
### DNode 资源使用情况 ### DNode Resource Usage
![dnode-usage](./assets/TDinsight-6-dnode-usage.png) ! [dnode-usage](. /assets/TDinsight-6-dnode-usage.png)
数据节点资源使用情况展示,对变量 `$fqdn` 即每个数据节点进行重复多行展示。包括: Data node resource usage display with repeated multiple rows for the variable `$fqdn` i.e., each data node. Includes.
1. **Uptime**:从创建 dnode 开始经过的时间。 1. **Uptime**: the time elapsed since the dnode was created.
2. **Has MNodes?**:当前 dnode 是否为 mnode。 2. **Has MNodes?**: whether the current dnode is a mnode. 3.
3. **CPU Cores**:CPU 核数。 3. **CPU Cores**: the number of CPU cores. 4.
4. **VNodes Number**:当前 dnode 的 VNodes 数量。 4. **VNodes Number**: the number of VNodes in the current dnode. 5.
5. **VNodes Masters**:处于 master 角色的 vnode 数量。 5. **VNodes Masters**: the number of vnodes in the master role. 6.
6. **Current CPU Usage of taosd**:taosd 进程的 CPU 使用率。 6. **Current CPU Usage of taosd**: CPU usage rate of taosd processes.
7. **Current Memory Usage of taosd**:taosd 进程的内存使用情况。 7. **Current Memory Usage of taosd**: memory usage of taosd processes.
8. **Disk Used**:taosd 数据目录的总磁盘使用百分比。 8. **Disk Used**: The total disk usage percentage of the taosd data directory.
9. **CPU Usage**:进程和系统 CPU 使用率。 9. **CPU Usage**: Process and system CPU usage. 10.
10. **RAM Usage**:RAM 使用指标时间序列视图。 10. **RAM Usage**: Time series view of RAM usage metrics.
11. **Disk Used**:多级存储下每个级别使用的磁盘(默认为 level0 级)。 11. **Disk Used**: Disks used at each level of multi-level storage (default is level0).
12. **Disk Increasing Rate per Minute**:每分钟磁盘用量增加或减少的百分比。 12. **Disk Increasing Rate per Minute**: Percentage increase or decrease in disk usage per minute.
13. **Disk IO**:磁盘 IO 速率。 13. **Disk IO**: Disk IO rate. 14.
14. **Net IO**:网络 IO,除本机网络之外的总合网络 IO 速率。 14. **Net IO**: Network IO, the aggregate network IO rate in addition to the local network.
### 登录历史 ### Login History
![登录历史](./assets/TDinsight-7-login-history.png) ! [Login History](. /assets/TDinsight-7-login-history.png)
目前只报告每分钟登录次数。 Currently, only the number of logins per minute is reported.
### TaosAdapter ### taosAdapter
![taosadapter](./assets/TDinsight-8-taosadaper.png) ![taosadapter](./assets/TDinsight-8-taosadapter.png)
包含 taosAdapter 请求统计和状态详情。包括: Support taosAdapter request statistics and status details. Includes.
1. **http_request**: 包含总请求数,请求失败数以及正在处理的请求数 1. **http_request**: contains the total number of requests, the number of failed requests, and the number of requests being processed
2. **top 3 request endpoint**: 按终端分组,请求排名前三的数据 2. **top 3 request endpoint**: data of the top 3 requests by endpoint group
3. **Memory Used**: taosAdapter 内存使用情况 3. **Memory Used**: taosAdapter memory usage
4. **latency_quantile(ms)**: (1, 2, 5, 9, 99)阶段的分位数 4. **latency_quantile(ms)**: quantile of (1, 2, 5, 9, 99) stages
5. **top 3 failed request endpoint**: 按终端分组,请求失败排名前三的数据 5. **top 3 failed request endpoint**: data of the top 3 failed requests by endpoint grouping
6. **CPU Used**: taosAdapter cpu 使用情况 6. **CPU Used**: taosAdapter CPU usage
## 升级 ## Upgrade
通过 `TDinsight.sh` 脚本安装的 TDinsight,可以通过重新运行该脚本就可以升级到最新的 Grafana 插件和 TDinsight Dashboard。 TDinsight installed via the `TDinsight.sh` script can be upgraded to the latest Grafana plugin and TDinsight Dashboard by re-running the script.
手动安装的情况下,可按照上述步骤自行安装新的 Grafana 插件和 Dashboard。 In the case of a manual installation, follow the steps above to install the new Grafana plugin and Dashboard yourself.
## 卸载 ## Uninstall
通过 `TDinsight.sh` 脚本安装的 TDinsight,可以使用命令行 `TDinsight.sh -R` 清理相关资源。 TDinsight installed via the `TDinsight.sh` script can be cleaned up using the command line `TDinsight.sh -R` to clean up the associated resources.
手动安装时,要完全卸载 TDinsight,需要清理以下内容: To completely uninstall TDinsight during a manual installation, you need to clean up the following.
1. Grafana 中的 TDinsight Dashboard。 1. the TDinsight Dashboard in Grafana.
2. Grafana 中的 Data Source 数据源。 2. the Data Source in Grafana. 3.
3. 从插件安装目录删除 `tdengine-datasource` 插件。 3. remove the `tdengine-datasource` plugin from the plugin installation directory.
## 整合的 Docker 示例 ## Integrated Docker Example
```bash ```bash
git clone --depth 1 https://github.com/taosdata/grafanaplugin.git git clone --depth 1 https://github.com/taosdata/grafanaplugin.git
cd grafanaplugin cd grafanaplugin
``` ```
根据需要在 `docker-compose.yml` 文件中修改: Change as needed in the ``docker-compose.yml`` file to
```yaml ```yaml
version: "3.7" version: '3.7'
services: services:
grafana: grafana:
image: grafana/grafana:7.5.10 image: grafana/grafana:7.5.10
volumes: volumes:
- ./dist:/var/lib/grafana/plugins/tdengine-datasource - . /dist:/var/lib/grafana/plugins/tdengine-datasource
- ./grafana/grafana.ini:/etc/grafana/grafana.ini - . /grafana/grafana.ini:/etc/grafana/grafana.ini
- ./grafana/provisioning/:/etc/grafana/provisioning/ - . /grafana/provisioning/:/etc/grafana/provisioning/
- grafana-data:/var/lib/grafana - grafana-data:/var/lib/grafana
environment: environment:
TDENGINE_API: ${TDENGINE_API} TDENGINE_API: ${TDENGINE_API}
...@@ -406,7 +406,7 @@ services: ...@@ -406,7 +406,7 @@ services:
SMS_ACCESS_KEY_SECRET: ${SMS_ACCESS_KEY_SECRET} SMS_ACCESS_KEY_SECRET: ${SMS_ACCESS_KEY_SECRET}
SMS_SIGN_NAME: ${SMS_SIGN_NAME} SMS_SIGN_NAME: ${SMS_SIGN_NAME}
SMS_TEMPLATE_CODE: ${SMS_TEMPLATE_CODE} SMS_TEMPLATE_CODE: ${SMS_TEMPLATE_CODE}
SMS_TEMPLATE_PARAM: "${SMS_TEMPLATE_PARAM}" SMS_TEMPLATE_PARAM: '${SMS_TEMPLATE_PARAM}'
SMS_PHONE_NUMBERS: $SMS_PHONE_NUMBERS SMS_PHONE_NUMBERS: $SMS_PHONE_NUMBERS
SMS_LISTEN_ADDR: ${SMS_LISTEN_ADDR} SMS_LISTEN_ADDR: ${SMS_LISTEN_ADDR}
ports: ports:
...@@ -415,13 +415,13 @@ volumes: ...@@ -415,13 +415,13 @@ volumes:
grafana-data: grafana-data:
``` ```
替换`docker-compose.yml`中的环境变量或保存环境变量到`.env`文件,然后用`docker-compose up`启动 Grafana。`docker-compose` 工具的具体用法参见 [Docker Compose Reference](https://docs.docker.com/compose/) Replace the environment variables in `docker-compose.yml` or save the environment variables to the `.env` file, then start Grafana with `docker-compose up`. See [Docker Compose Reference]( https://docs.docker.com/compose/)
```bash ``bash
docker-compose up -d docker-compose up -d
``` ```
TDinsight 已经通过 Provisioning 部署完毕,请到 http://localhost:3000/d/tdinsight/ 查看仪表盘。 Then the TDinsight was deployed via Provisioning. Go to http://localhost:3000/d/tdinsight/ to view the dashboard.
[grafana]: https://grafana.com [grafana]: https://grafana.com
[tdengine]: https://www.taosdata.com [tdengine]: https://www.taosdata.com
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册