前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >监控使用说明 | 如何使用 Apache IoTDB 分布式系统监控模块

监控使用说明 | 如何使用 Apache IoTDB 分布式系统监控模块

作者头像
Apache IoTDB
发布2023-03-21 20:01:07
5950
发布2023-03-21 20:01:07
举报
文章被收录于专栏:Apache IoTDBApache IoTDB

本篇作者:

IoTDB 社区 -- 张洪胤

从 Apache IoTDB 0.13.0 版本开始,我们引入了

系统监控模块,可以完成对 Apache IoTDB 的

重要运行指标进行监控,本文介绍了如何在

Apache IoTDB 分布式开启系统监控模块,

并且使用 Prometheus + Grafana

的方式完成对系统监控指标的可视化。

1

软件配置信息

1. Apache IoTDB:1.0 版本及以上,可以前往官网下载:

https://iotdb.apache.org/Download/

2. Prometheus:2.30.3 版本及以上,可以前往官网下载:

https://prometheus.io/download/

3. Grafana:8.4.2 版本及以上,可以前往官网下载:

https://grafana.com/grafana/download

2

集群基础信息

本文在一台机器上启动 1 个 ConfigNode

和 1 个 DataNode 来搭建最简单的

Apache IoTDB 分布式集群,后续可以

根据自己的需求调整 ConfigNode

和 DataNode 的数量,相关的配置是类似的。

本文搭建的集群的基本配置信息如下表所示:

3

启动 Apache IoTDB

分布式集群

3.1

启动 Apache IoTDB

ConfigNode

1. 进入 apache-iotdb-1.0.0-all-bin 包

2. 修改配置文件

conf/iotdb-confignode.properties,

修改如下配置,其他配置保持不变:

代码语言:javascript
复制
cn_metric_reporter_list=PROMETHEUS
cn_metric_level=IMPORTANT
cn_metric_prometheus_reporter_port=9091

3. 运行脚本启动 ConfigNode:

./sbin/start-confignode.sh,

出现如下提示则为启动成功:

4. 在浏览器进入

http://localhost:9091/metrics

网址,可以查看到如下的监控项信息:

3.2

启动 Apache IoTDB

DataNode

1. 进入 apache-iotdb-1.0.0-all-bin 包

2. 修改配置文件

conf/iotdb-datanode.properties,

修改如下配置,其他配置保持不变:

代码语言:javascript
复制
dn_metric_reporter_list=PROMETHEUS
dn_metric_level=IMPORTANT
dn_metric_prometheus_reporter_port=9093

3. 运行脚本启动 DataNode:

./sbin/start-datanode.sh,

出现如下提示则为启动成功:

4. 在浏览器进入

http://localhost:9093/metrics

网址,可以查看到如下的监控项信息:

4

配置 Prometheus

进行监控指标采集

1. 下载 Prometheus 的二进制包到本地,解压后进入对应文件夹:

代码语言:javascript
复制
tar xvfz prometheus-*.tar.gz
cd prometheus-*

2. 首先,我们修改 Prometheus 的配置文件

prometheus.yml 如下:

a. 新增 confignode 任务收集

ConfigNode 的监控数据

b. 新增 datanode 任务收集

DataNode 的监控数据

代码语言:javascript
复制
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: "prometheus"
    static_configs:
    - targets: ["localhost:9090"]
  - job_name: "confignode"
    static_configs:
    - targets: ["localhost:9091"]
    honor_labels: true
  - job_name: "datanode"
    static_configs:
    - targets: ["localhost:9093"]
    honor_labels: true

3. 启动 Promethues

代码语言:javascript
复制
./prometheus --config.file=prometheus.yml

4. 在浏览器中输入 http://localhost:9090,

进入Prometheus

5. 查看配置是否成功:我们点击进入 Status

下的 Target 界面

6. 当我们看到如下图 State 均为 Up 时

表示配置成功并已经联通,点击左侧链接可以跳转到网页监控。

5

使用 Grafana

进行数据可视化

5.1

Grafana 安装、配置

与启动

1. 下载 Grafana 的二进制包到本地,

解压后进入对应文件夹:

代码语言:javascript
复制
tar -zxvf grafana-*.tar.gz
cd grafana-*

2. 启动 Grafana 并进入:

代码语言:javascript
复制
./bin/grafana-server web

3. 在浏览器中输入 http://localhost:3000,

进入 Grafana,默认初始用户名和密码

均为 admin。

4. 首先我们在 Configuration 中

配置 Data Source 为 Prometheus

5. 在配置 Data Source 时注意

Prometheus 所在的URL,配置好后

点击Save & Test 出现

Data source is working 提示

则为配置成功

5.2

使用官方提供的

Dashboard 进行数据可视化

5.2.1 Grafana Dashboard Json

获取方式

1. 从 GitHub 官网下载:

a. Apache IoTDB ConfigNode

Dashboard:

https://github.com/apache/iotdb/

blob/master/docs/UserGuide/Monitor-

Alert/Apache-IoTDB-ConfigNode

-Dashboard.json

b. Apache IoTDB DataNode

Dashboard:

https://github.com/apache/iotdb/

blob/master/docs/UserGuide/Monitor-

Alert/Apache-IoTDB-DataNode-

Dashboard.json

2. 从 Grafana 官网获取:

https://grafana.com/grafana/dashboards/

?search=Apache+IoTDB

5.2.2 导入 Grafana Dashboard

并使用

1. 进入 Grafana,选择 Dashboards 的 Browse

2. 点击右侧 Import 按钮

3. 选择一种方式导入 Dashboard:

a. 上传本地已下载的 Dashboard

的 Json 文件

b. 输入 Grafana 官网获取到的

Dashboard 的 URL 或者 ID

c. 将 Dashboard 的 Json 文件内容

直接粘贴进入

4. 选择 Dashboard 的 Prometheus

为刚刚配置好的 Data Source,

然后点击 Import

5. 之后进入 Dashboard,选择 job

为 ConfigNode,就看到如下的监控面板:

6. 同样地,我们可以导入

Apache DataNode Dashboard,

选择 job 为 DataNode,

就看到如下的监控面板:

5.3

创建新的 Dashboard

进行数据可视化

1. 首先创建 Dashboard,然后创建 Panel

2. 之后就可以在面板根据自己的需求对监控相关的数据进行可视化

(所有相关的监控指标可以先在 job 中选择

confignode/datanode 筛选)

3. 选择关注的监控指标可视化完成后,我们就得到了这样的面板:

后续我们还会继续分享 Apache IoTDB

监控模块,敬请期待!

6

用户手册

https://iotdb.apache.org/zh/UserGuide/

Master/Monitor-Alert/Metric-Tool.html

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2023-02-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Apache IoTDB 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Prometheus 监控服务
Prometheus 监控服务(TencentCloud Managed Service for Prometheus,TMP)是基于开源 Prometheus 构建的高可用、全托管的服务,与腾讯云容器服务(TKE)高度集成,兼容开源生态丰富多样的应用组件,结合腾讯云可观测平台-告警管理和 Prometheus Alertmanager 能力,为您提供免搭建的高效运维能力,减少开发及运维成本。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档