prometheus+redis_exporter+grafana

鑑於上一篇隨筆已經寫了如何搭建prometheus故此篇附上鍊接:https://www.cnblogs.com/lc226/p/11222048.html,同時省略了一些基礎步驟html

一.安裝redis_exporter

下載能夠去git上下或者https://www.cnblogs.com/lc226/p/11222048.html去個人隨筆找,有連接git

這裏是監控的單機redisweb

1.解壓後直接 nohup ./redis_exporter -redis.addr 172.16.16.74 & redis

-redis.addr:指明一個或多個 Redis 節點的地址,多個節點使用逗號分隔,默認爲 localhost:6379
-redis.password:驗證 Redis 時使用的密碼;
-redis.file:包含一個或多個redis 節點的文件路徑,每行一個節點,此選項與 -redis.addr 互斥。
-web.listen-address:監聽的地址和端口,默認爲 0.0.0.0:9121ide

2.tail -f nohup.out 測試

3.訪問指標 http://172.16.16.80:9121/metricsthis

 

二.配置prometheus.yml

 

這裏仍是要注意格式問題。htm

- job_name: 'redis'
metrics_path: "/metrics"
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['localhost:9121']blog

 

 

三.grafana展現

 

 能夠看到db0裏面有一個keyget

這裏能夠測試隨筆添加一個key

 

 

 

 能夠看到key增加了一個

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息