1.下載redis_exporter安裝包(linux版)到 /opt/minitor/redis_exporter 。
下載地址:https://download.csdn.net/download/a15565772151/11111943
可以私聊我一下我發你資源
2.運行 tar -zxvf redis_exporter-v0.13.linux-amd64.tar.gz ,解壓文件到當前目錄。
3.執行 vim /opt/minitor/prometheus/prometheus.yml,添加以下配置文件(紅色部分):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from
this
config.
- job_name:
'prometheus'
# metrics_path defaults to
'/metrics'
# scheme defaults to
'http'
.
static_configs:
- targets: [
'ip:9090'
]
labels:
instance: prometheus
- job_name: redis
static_configs:
- targets: [
'ip:9121'
]
labels:
instance: redis
|
4.啟動 redis_exporter
1
|
nohup ./redis_exporter -redis.addr ip:端口 -redis.password
"密碼"
&
|
5.去prometheus中查看redis的狀態
6.在grafana中查看配置狀態(推薦使用763)
7.效果圖如下: