Prometheus监控mongo

安装mongo插件

1
2
3
4
5
6
7
8
9
yum -y install glide
git clone git@github.com:dcu/mongodb_exporter.git $GOPATH/src/github.com/dcu/mongodb_exporter
也可以去github上,下载源码,在编译安装
cd $GOPATH/src/github.com/dcu/mongodb_exporter
make build
./mongodb_exporter -h

注意:go环境需要提前安装好,可以编译也可以yum安装
如果不会编译,可以通知本人,给你发编译后的包

启动

1
nohup ./mongodb_exporter --mongodb.uri "mongodb://readonly:readonly@192.168.50.7:27017" &

上面是单点的,集群的话192.168.50.7:27017,192.168.50.8:27017 这样就可以

prometheus配置

1
2
3
4
5
6
- job_name: mongo_exporter
static_configs:
- targets:
- '192.168.50.7:9001'
labels:
service: mongo

导入模板

https://grafana.com/dashboards/2583

Donate
Prometheus监控elasticsearch
posted @   GaoYanbing  阅读(15)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示