Home >Database >Redis >View Redis performance monitoring

View Redis performance monitoring

coldplay.xixi
coldplay.xixiforward
2021-03-10 11:03:362419browse

View Redis performance monitoring

redis_exporter prometheus grafana monitors Redis service indicators

    • 1.redis_exporter
    • 2.prometheus
    • 3.grafana

Recommended (free): redis

This article uses redis_exporter prometheus grafana to implement The reasons for monitoring the Redis service are: low cost, less manual intervention, direct download of the corresponding components, only need to add configurations to communicate with each other, and the visual indicators are relatively comprehensive.

The following is on a Linux machine with redis installed

1.redis_exporter

Download program compressed file

wget https://github.com/oliver006/redis_exporter/releases/download/v0.28.0/redis_exporter-v0.28.0.linux-amd64.tar.gz

Unzip

tar zxf redis_exporter-v0.28.0.linux-amd64.tar.gz

cd into the directory

cd redis_exporter-v1.15.0.linux-amd64

Directly run the redis_exporter program and add & to represent running in the background. The /redis_exporter & command accesses the localhost:6379 of this machine by default. You need to specify other machines. redis uses ./redis_exporter ip:port &

./redis_exporter &

2.prometheus

The first step is to download the file as usual, and the unzipped file (v2.7.1) can be modified To find the version that needs to be installed, you can click https://github.com/prometheus/prometheus/releases to find the corresponding version number

wget https://github.com/prometheus/prometheus/releases/download/v2.7.1/prometheus-2.7.1.linux-amd64.tar.gz
tar zxf prometheus-2.7.1.linux-amd64.tar.gz

cd into the directory and you will find a prometheus.yml configuration file. This configuration file Corresponding service name, monitoring address and port of each service.

vim prometheus.yml

Open the configuration file and add the configuration of redis_exporter communication

   - job_name: 'prometheus'
     static_configs:
     - targets: ['localhost:9090'] #程序在本机开通的端口号 默认9090
  - job_name: 'redis'
    static_configs:
    - targets:
      - "IP:9121" #(安装redis_exporter的IP)

Run ps: Check if there is any process occupying port 9090

./prometheus &

http://ip:9090/targets Check if Success
View Redis performance monitoring

3.grafana

No more nonsense

  wget https://dl.grafana.com/oss/release/grafana-6.0.0-beta1.linux-amd64.tar.gz
tar zxf grafana-6.0.0-beta1.linux-amd64.tar.gz
cd grafana-6.0.0-beta1
./grafana-server start

After startup: http://ip:300 Default User: admin, password: admin Then find data sources on the left
View Redis performance monitoring

Configure the Url corresponding to your program address
View Redis performance monitoring

The last step! Download the json template Import
https://grafana.com/api/dashboards/763/revisions/1/download

View Redis performance monitoring
Upload
View Redis performance monitoring
You can view it here Configure those service monitoring
View Redis performance monitoring

Monitoring page

View Redis performance monitoring

View Redis performance monitoring

##Today is New Year’s Eve, best wishes in advance Happy New Year everyone!

More related free learning recommendations: redis tutorial

The above is the detailed content of View Redis performance monitoring. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete