Prometheus监控Memcached

这里只是对prometheus监控Memcached的配置过程做个记录,方便以后查阅。

1.下载memcached_exporter

1
https://github.com/prometheus/memcached_exporter

2.配置memcached_exporter

1
2
tar xf downloads/memcached_exporter-0.5.0.linux-amd64.tar.gz
mv -f downloads/memcached_exporter-0.5.0.linux-amd64 memcached_exporter

3.启动memcached_exporter

1
/work/admin/memcached_exporter/memcached_exporter

4.prometheus配置

1
2
3
4
5
6
7
8
9
10
- job_name: 'memcache'
static_configs:
- targets: ['192.168.4.57:9100']
labels: {cluster: 'product',type: 'basic',env: 'memcache',job: 'memcache1',export: 'memcache'}
- targets: ['192.168.4.57:9150']
labels: {cluster: 'product',type: 'middle',env: 'memcache',job: 'memcache1',export: 'memcached_exporter'}
- targets: ['192.168.1.232:9100']
labels: {cluster: 'product',type: 'basic',env: 'memcache',job: 'memcache2',export: 'memcache'}
- targets: ['192.168.1.232:9150']
labels: {cluster: 'product',type: 'middle',env: 'memcache',job: 'memcache2',export: 'memcached_exporter'}

重启prometheus

如果开启了api管理功能,可以如下方式热加载配置

1
curl -X POST http://127.0.0.1:9090/-/reload

5.grafana出图

推荐使用6551

效果如下

-------------本文结束感谢您的阅读-------------