This is the 23rd day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

1. Introduction

Prometheus + Grafana is a monitoring platform solution. It can monitor Linux servers, nginx, RabbitMQ, Springboot projects, etc.

Prometheus assigns a probe to the middleware or system being monitored (with a friend installed) and provides an interface to provide monitoring data externally.

Grafana is primarily a display page, with a large number of panels and the ability to freely access JSON files, which is pretty cool. After connecting to Prometheus, grafana called the interface provided by Prometheus to obtain data, filled it into the template, and displayed it.

2. Download

Due to network reasons, I will provide the address of the network disk by myself. Prometheus links: pan.baidu.com/s/13VVo3oAC… Extraction code: RFO0

Go link: pan.baidu.com/s/1Z8b_xzgT… Extraction code: 2J3V

Grafana links: pan.baidu.com/s/11QJa4Cjj… Extraction code: AZ3W

3. Install the go

1. Decompress the installation package

tar -C /usr/local/ -xvf go111.4..linux-amd64.tar.gz
Copy the code

2. Configure environment variables

vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
source /etc/profile
Copy the code

3. Verify

go version
Copy the code

4. Install the Prometheus

1. Install

tar -C /usr/local/ -xvf prometheus-2.6. 0.linux-amd64.tar.gz
ln -sv /usr/local/prometheus-2.6. 0.linux-amd64/ /usr/local/Prometheus
Copy the code

2. Start

Prometheus, the default configuration file, vim/usr/local/Prometheus/Prometheus yml (background) by default.

/usr/local/Prometheus/prometheus --config.file=/usr/local/Prometheus/prometheus.yml &
Copy the code

3. Verify

To open the Prometheus monitoring page, open port 9090.

5. Install Grafana

1. Install (only use this method to install otherwise the Grafana command is not useful)

rpm -ivh --nodeps grafana-7.1. 5-1.x86_64.rpm
Copy the code

2. Start

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server.service
sudo /bin/systemctl start grafana-server.service
Copy the code

3. Visit grafana

The default user name and password are admin. The first login will require you to change the default login password. The following page is displayed: Installation successful.