02-collectd.md 5.9 KB
Newer Older
D
dingbo 已提交
1 2
---
sidebar_label: TDengine + collectd/StatsD + Grafana
3
title: Quickly build an IT DevOps visualization system using TDengine + collectd/StatsD + Grafana
D
dingbo 已提交
4 5
---

6
## Background
D
dingbo 已提交
7

8
TDengine is a big data platform designed and optimized for IoT (Internet of Things), Vehicle Telematics, Industrial Internet, IT DevOps, etc. by TAOSData. Since it opened its source code in July 2019, it has won the favor of a large number of time-series data developers with its innovative data modeling design, convenient installation, easy-to-use programming interface, and powerful data writing and query performance.
D
dingbo 已提交
9

10
IT DevOps metric data usually are time sensitive, for example:
D
dingbo 已提交
11

12 13
- System resource metrics: CPU, memory, IO, bandwidth, etc.
- Software system metrics: health status, number of connections, number of requests, number of timeouts, number of errors, response time, service type, and other business-related metrics.
D
dingbo 已提交
14

15 16
The current mainstream IT DevOps visualization system usually contains a data collection module, a data persistent module, and a visual display module. collectd/StatsD, as an old-fashion open source data collection tool, has a wide user base. However, collectd/StatsD has limited functionality, and often needs to be combined with Telegraf, Grafana, and a time-series database to build a complete monitoring system.
The new version of TDengine supports multiple data protocols and can accept data from collectd and StatsD directly, and provides Grafana dashboard for graphical display.
D
dingbo 已提交
17

18
This article introduces how to quickly build an IT DevOps visualization system based on TDengine + collectd / StatsD + Grafana without writing even a single line of code but by simply modifying a few lines of configuration files. The architecture is shown in the following figure.
D
dingbo 已提交
19

D
dingbo 已提交
20
![IT-DevOps-Solutions-Collectd-StatsD.png](./IT-DevOps-Solutions-Collectd-StatsD.png)
D
dingbo 已提交
21

22
## Installation Steps
D
dingbo 已提交
23

24
To install collectd, StatsD, Grafana, and TDengine, please refer to the official documentation.
D
dingbo 已提交
25

26
### Installing collectd
D
dingbo 已提交
27

28
Please refer to the [official documentation](https://collectd.org/documentation.shtml).
D
dingbo 已提交
29

30
### Installing StatsD
D
dingbo 已提交
31

32
Please refer to the [official documentation](https://github.com/statsd/statsd).
D
dingbo 已提交
33

34
### Install Grafana
D
dingbo 已提交
35

36
Please refer to the [official documentation](https://grafana.com/grafana/download).
D
dingbo 已提交
37

38
### Install TDengine
D
dingbo 已提交
39

40
Download the latest TDengine-server 2.4.0.x or above from the [Downloads](http://taosdata.com/cn/all-downloads/) page on the TAOSData website and install it.
D
dingbo 已提交
41

42
## Data Connection Setup
D
dingbo 已提交
43

44
### Copy the TDengine plugin to the grafana plugin directory
D
dingbo 已提交
45 46 47 48 49 50 51 52 53

```bash
1. wget -c https://github.com/taosdata/grafanaplugin/releases/download/v3.1.3/tdengine-datasource-3.1.3.zip
2. sudo unzip tdengine-datasource-3.1.3.zip -d /var/lib/grafana/plugins/
3. sudo chown grafana:grafana -R /var/lib/grafana/plugins/tdengine
4. echo -e "[plugins]\nallow_loading_unsigned_plugins = tdengine-datasource\n" | sudo tee -a /etc/grafana/grafana.ini
5. sudo systemctl restart grafana-server.service
```

54
### Configure collectd
D
dingbo 已提交
55

56
Add the following to the `/etc/collectd/collectd.conf` file, where the `host` and `port` should be the actual values of the TDengine and taosAdapter configurations.
D
dingbo 已提交
57

58
```text
D
dingbo 已提交
59 60 61 62 63 64 65 66
LoadPlugin network
<Plugin network>
  Server "<TDengine cluster/server host>" "<port for collectd>"
</Plugin>

sudo systemctl start collectd
```

67
### Configure StatsD
D
dingbo 已提交
68

69
Start StatsD after adding the following to the `config.js` file, where the `host` and `port` are the actual values of the TDengine and taosAdapter configurations.
D
dingbo 已提交
70

71 72 73
```text
backends section add ". /backends/repeater"
Add { host:'<TDengine server/cluster host>', port: <port for StatsD>} to the repeater section
D
dingbo 已提交
74 75
```

76 77 78 79
### Importing the Dashboard

Use a web browser to access the server running Grafana on port 3000 `host:3000` to log into the Grafana interface with the initial system username and password of `admin/admin`.
Click on the gear icon on the left and select `Plugins`, you should find the TDengine data source plugin icon.
D
dingbo 已提交
80

81 82 83 84 85
#### Importing the collectd dashboard

Download the dashboard json from `https://github.com/taosdata/grafanaplugin/blob/master/examples/collectd/grafana/dashboards/collect-metrics-with-tdengine-v0.1.0.json`, click the plus icon on the left and select Import, follow the instructions to import the JSON file. After that, you can see
The dashboard can be seen in the following screen.

D
dingbo 已提交
86
![IT-DevOps-Solutions-collectd-dashboard.png](./IT-DevOps-Solutions-collectd-dashboard.png)
D
dingbo 已提交
87

88
#### import collectd dashboard
D
dingbo 已提交
89

90 91
Download the dashboard json file from `https://github.com/taosdata/grafanaplugin/blob/master/examples/collectd/grafana/dashboards/collect-metrics-with-tdengine-v0.1.0.json`. Download the dashboard json file, click the plus icon on the left side and select `Import`, and follow the interface prompts to select the JSON file to import. After that, you can see
dashboard with the following interface.
D
dingbo 已提交
92

D
dingbo 已提交
93
![IT-DevOps-Solutions-collectd-dashboard.png](./IT-DevOps-Solutions-collectd-dashboard.png)
D
dingbo 已提交
94

95
#### Importing the StatsD dashboard
D
dingbo 已提交
96

97
Download the dashboard json from `https://github.com/taosdata/grafanaplugin/blob/master/examples/statsd/dashboards/statsd-with-tdengine-v0.1.0.json`. Click on the plus icon on the left and select `Import`, and follow the interface prompts to import the JSON file. You will then see the dashboard in the following screen.
D
dingbo 已提交
98
![IT-DevOps-Solutions-statsd-dashboard.png](./IT-DevOps-Solutions-statsd-dashboard.png)
D
dingbo 已提交
99

100
## Wrap-up
D
dingbo 已提交
101

102
TDengine, as an emerging time-series big data platform, has the advantages of high performance, high reliability, easy management and easy maintenance. Thanks to the new schemaless protocol parsing function in TDengine version 2.4.0.0 and the powerful ecological software adaptation capability, users can build an efficient and easy-to-use IT DevOps visualization system or adapt to an existing system in just a few minutes.
D
dingbo 已提交
103

104
For TDengine's powerful data writing and querying performance and other features, please refer to the official documentation and successful product implementation cases.