Monitoring Board Install and Deploy

From the Apache IoTDB 1.0 version, we introduced the system monitoring module, you can complete the Apache IoTDB important operational indicators for monitoring, this article describes how to open the system monitoring module in the Apache IoTDB distribution, and the use of Prometheus + Grafana way to complete the visualisation of the system monitoring indicators.

pre-preparation

software requirement

  1. Apache IoTDB: version 1.0 and above, download from the official website: https://iotdb.apache.org/Download/Monitoring-Board-Install-and-Deploy - 图1open in new window
  2. Prometheus: version 2.30.3 and above, download from the official website: https://prometheus.io/download/Monitoring-Board-Install-and-Deploy - 图2open in new window
  3. Grafana: version 8.4.2 and above, download from the official website: https://grafana.com/grafana/downloadMonitoring-Board-Install-and-Deploy - 图3open in new window
  4. IoTDB-Grafana installer: Grafana Kanban is an IoTDB Enterprise Edition tool, and you may contact your sales for the relevant installer.

cluster requirement

Make sure that the IoTDB cluster is started before doing the following.

clarification

This doc will build the monitoring dashboard on one machine (1 ConfigNode and 1 DataNode) environment, other cluster configurations are similar, users can adjust the configuration according to their own cluster situation (the number of ConfigNode and DataNode). The basic configuration information of the cluster built in this paper is shown in the table below.

NODETYPENODEIPMonitor PusherMonitor LevelMonitor Port
ConfigNode127.0.0.1PROMETHEUSIMPORTANT9091
DataNode127.0.0.1PROMETHEUSIMPORTANT9093

configure Prometheus capture monitoring metrics

  1. Download the installation package. Download the Prometheus binary package locally, unzip it and go to the corresponding folder:
  1. tar xvfz prometheus-*.tar.gz
  2. cd prometheus-*
  1. Modify the configuration. Modify the Prometheus configuration file prometheus.yml as follows:
    a. Added confignode task to collect monitoring data from ConfigNode
    b. Add datanode task to collect monitoring data from DataNode
  1. global:
  2. scrape_interval: 15s
  3. scrape_configs:
  4. - job_name: "prometheus"
  5. static_configs:
  6. - targets: ["localhost:9090"]
  7. - job_name: "confignode"
  8. static_configs:
  9. - targets: ["localhost:9091"]
  10. honor_labels: true
  11. - job_name: "datanode"
  12. static_configs:
  13. - targets: ["localhost:9093"]
  14. honor_labels: true
  1. Start Promethues. the default expiration time for Prometheus monitoring data is 15d. in production environments, it is recommended to adjust the expiration time to 180d or more in order to track historical monitoring data for a longer period of time, as shown in the following startup command:
  1. ./prometheus --config.file=prometheus.yml --storage.tsdb.retention.time=180d
  1. Confirm the startup is successful. Enter http://localhost:9090Monitoring-Board-Install-and-Deploy - 图4open in new window in the browser to enter Prometheus, click to enter the Target interface under Status (Figure 1 below), when you see State are Up, it means the configuration is successful and connected (Figure 2 below), click the link on the left side to jump to the webpage monitoring.

Monitoring-Board-Install-and-Deploy - 图5
Monitoring-Board-Install-and-Deploy - 图6

Using Grafana to View Monitoring Data

Step1:Grafana Installation, Configuration and Startup

  1. Download the binary package of Grafana locally, unzip it and go to the corresponding folder:
  1. tar -zxvf grafana-*.tar.gz
  2. cd grafana-*
  1. Start Grafana and enter:
  1. ./bin/grafana-server web
  1. Enter http://localhost:3000Monitoring-Board-Install-and-Deploy - 图7open in new window in your browser to access Grafana, the default initial username and password are both admin.
  2. First we configure the Data Source in Configuration to be Prometheus.

Monitoring-Board-Install-and-Deploy - 图8

  1. When configuring the Data Source, pay attention to the URL where Prometheus is located, and click Save & Test after configuration, the Data source is working prompt appears, then the configuration is successful.

Monitoring-Board-Install-and-Deploy - 图9

Step2:Use the official Grafana dashboard provided by IoTDB

  1. Enter Grafana,click Browse of Dashboards

Monitoring-Board-Install-and-Deploy - 图10

  1. Click the Import button on the right

Monitoring-Board-Install-and-Deploy - 图11

  1. Select a way to import Dashboard
    a. Upload the Json file of the downloaded Dashboard locally
    b. Enter the URL or ID of the Dashboard obtained from the Grafana website
    c. Paste the contents of the Dashboard’s Json file

Monitoring-Board-Install-and-Deploy - 图12

  1. Select Prometheus in the Dashboard as the Data Source you just configured and click Import

Monitoring-Board-Install-and-Deploy - 图13

  1. Then enter Dashboard,select job to be ConfigNode,then following monitoring dashboard will be seen:

Monitoring-Board-Install-and-Deploy - 图14

  1. Similarly, we can import the Apache DataNode Dashboard, select job as DataNode,then following monitoring dashboard will be seen:

Monitoring-Board-Install-and-Deploy - 图15

Step3:Creating a new Dashboard for data visualisation

  1. First create the Dashboard, then create the Panel.

Monitoring-Board-Install-and-Deploy - 图16

  1. After that, you can visualize the monitoring-related data in the panel according to your needs (all relevant monitoring metrics can be filtered by selecting confignode/datanode in the job first).

Monitoring-Board-Install-and-Deploy - 图17

  1. Once the visualisation of the monitoring metrics selected for attention is complete, we get a panel like this:

Monitoring-Board-Install-and-Deploy - 图18