Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Building performance Monitoring platform with Grafana+Telegraf+InfluxDB

Shulou Source: shulou.com Published: 2022-06-03 05:13:16 11月24日 Update

One: the principle of realization

The performance monitoring service and timing database are pre-deployed on the server under test, and the performance chart is generated in the form of web. At the same time, the performance data archiving and query service is realized, which saves testing time.

It consists of three open source modules:

Data visualization module: Grafana

Data collection module: Telegraf

Data enclosure: InfluxDB

Grafana is deployed on the monitoring server (usually native), and Telegraf and InfuxDB are deployed on the server under test.

Telegraf collects CPU, memory and network data, writes it to time series database InfluxDB,Grafana, reads InfluxDB data and displays it graphically.

Second: the construction process

Related documentation: https://github.com/influxdata/telegraf

Download grafanawindows-x64.rar, telegraf-1.5.1-1.i386.rpm, influxdb-1.5.1.i386.rpm, and note 32-bit or 64-bit.

1. Upload Telegraf and InfluxDB to the server under test, and install:

Rpm-ivh telegraf-1.5.1-1.i386.rpm

Rpm-ivh influxdb-1.5.1.i386.rpm

Find telegraf.conf:find /-name telegraf.conf

Configure telegraf.conf:vi / etc/telegraf/telegraf.conf:- [agent] interval = "2s" # collect data every 2 seconds

Telegraf collects global CPU and memory of the system by default.

Start the service:

Service telegraf start

Service influxdbstart

two。 Extract the Grafana package locally

Double-click grafana-server.exe to start

Enter http://localhost:3000 default admin, admin

Configure grafana:

Add data source: log in to grafana, create a new data source in the upper left menu, and configure the relevant information

After saving, view

Add Dashboards: add multiple panel panels, configure CPU, memory and other data items

Save

You can set the start and end time

You can also set how often it is refreshed.

After the setting is finished, you can save it. Each time you come in, it is set up last time.

Add another panel for memory

Edit:

Just save it.

Add another panel for the network

First, vi / etc/telegraf/telegraf.conf, remove the comments and restart telegraf?

The others are the same as above, and finally saved.

Mainly monitor the above three: cpu, memory and network

In addition, grafana can not only monitor java servers, but also monitor redis, nginx servers, and even jmeter response time, tps and so on. Baidu can expand the use of grafana later. Including operations such as connecting to databases other than telegraf.

Tags: Data service server monitoring memory module configuration performance database network panel three data source timing time information global principle at the same time graphics Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL vpn Shulou Tech Info MariaDB Docker