How to monitor mongodb replica set using prometheus


监控mongodb replica set其实有很多方式:

  • Using zabbix template to view mongodb data(zabbix+grafana)
  • Mongodb官方自己的,不过现在收费了
  • Prometheus通过mongodb-exporter收集数据,然后使用Grafana展示数据(prometheus+grafana)
  • etc...

Install prometheus

  • See detail from official: https://prometheus.io/docs/introduction/first_steps/
  • How to install prometheus on docker on ubuntu14.04: https://www.digitalocean.com/community/tutorials/how-to-install-prometheus-using-docker-on-ubuntu-14-04
  • pull docker images from: https://store.docker.com/community/images/prom/prometheus

simple configure file

➜  prometheus-2.3.1.linux-amd64 cat prometheus.yml|awk '{if($0 !~ /^$/ && $0 !~ /^#/) {print $0}}'
global:scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.# scrape_timeout is set to the global default (10s).
alerting:alertmanagers:- static_configs:- targets:# - alertmanager:9093
rule_files:# - "first_rules.yml"# - "second_rules.yml"
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: ['localhost:9090']- job_name: 'node-exporter'static_configs:- targets: ['localhost:9100']- job_name: 'mongodb-exporter'static_configs:- targets: ['localhost:9001']

Install Node-exporter

  • exporters and intergrations: https://prometheus.io/docs/instrumenting/exporters/

Install mongodb-exporter

  • exporters and intergrations: https://prometheus.io/docs/instrumenting/exporters/
  • mongodb-exporter: https://github.com/dcu/mongodb_exporter
  • download mongodb-exporter release: https://github.com/dcu/mongodb_exporter/releases/download/v1.0.0/mongodb_exporter-linux-amd64

run mongodb-exporter

➜  prometheus ./mongodb_exporter -mongodb.uri mongodb://192.168.152.128:27017,192.168.152.128:27018,192.168.152.128:27019
Listening on :9001 (scheme=HTTP, secured=no, clientValidation=no)

you also can run the multi MongoDB-exporter process to get the metrics of simple MongoDB instance. if so. you should add multi job_name in prometheus.yml. you can monitor every simple MongoDB instance details in grafana by setting dashboard variables.

Insatll Grafana

  • see official docs: http://docs.grafana.org/installation/debian/

Configure DashBoard

  • download grafana dashboard template json file: https://grafana.com/api/dashboards/2583/revisions/2/download

转载于:https://blog.51cto.com/bkmaster/2138711

How to monitor mongodb replica set using prometheu相关推荐

  1. (1)解锁MongoDB replica set核心姿势

    本文倒腾目前大热的MongoDB Replica Set集群,在倒腾的同时串讲一些 MongoDB特性. 副本集Replica Set是一个术语,定义具有多节点的数据库集群,这些节点具有主从复制(ma ...

  2. Mongodb Replica Configure

    Mongodb Replica Configure      我在配置replica的时候,文档中也把官网的中一些重要解释放在里面了但是并没有用中文做必要的解释,不过都是很容易理解的.说一下环境,这里 ...

  3. replica文件服务器,mongodb replica set 配置高性能多服务器详解

    mongodb的多服务器配置,以前写过一篇文章,是master-slave模式的,请参考:详解mongodb 主从配置.master-slave模式,不能自动实现故障转移和恢复.所以推荐大家使用mon ...

  4. Centos7 deploy mongoDB Replica set

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.     概述: 主节点(Primary) 在复制集中,主节点是唯一能够接收写请求的节点.Mon ...

  5. replica文件服务器,MongoDB_mongodb replica set 配置高性能多服务器详解,mongodb的多服务器配置,以前写 - phpStudy...

    mongodb replica set 配置高性能多服务器详解 mongodb的多服务器配置,以前写过一篇文章,是master-slave模式的,请参考:详解mongodb 主从配置.master-s ...

  6. mongodb 集群shard_mongodb replica set shard 分片 高可用 集群

    mongodb采用的分片原理,其实很简单,说白了就是,一个蛋糕特别大,需要非常非常大的盒子才能装下,就算装下了存储也不方便,所以把大蛋糕切成小蛋糕进行存储.这种思想在其他应用或数据库中也有应用.例如: ...

  7. mongodb之配置

    前言 最新版本支持yaml格式的配置文件,只支持空格,不能使用tab 详细配置说明 #系统日志配置 systemLog:destination: filepath: /var/log/mongodb/ ...

  8. 孤儿文档是怎样产生的(MongoDB orphaned document)

    使用MongoDB的开发人员应该都听说过孤儿文档(orphaned document)这回事儿,可谓闻着沉默,遇者流泪.本文基于MongoDB3.0来看看怎么产生一个orphaned document ...

  9. C# 驱动连接 MongoDB ReplSet

    前言 接上一篇:MongoDB 复制集(Replica Set) 配置(Windows 版) 当配置好 MongoDB 的复制集(Replica Set)之后,肯定要做的就是应用程序连接 MongoD ...

  10. mongodb 分片群集配置 及数据迁移

    配置mongodb分片群集(sharding cluster) Sharding cluster介绍 这是一种可以水平扩展的模式,在数据量很大时特给力,实际大规模应用一般会采用这种架构去构建monod ...

最新文章

  1. dev treeview控件_在Winform开发框架中使用DevExpress的TreeList和TreeListLookupEdit控件
  2. Y君:天天增删改查,又能怎么样?
  3. 1600802071
  4. Jupyter Notebook已出现“返祖现象”,这款工具让你在终端里使用它
  5. Linux内核启动速度优化,嵌入式Linux启动时间优化的秘密之五-Bootloader
  6. 【Android 应用开发】Android之Bluetooth编程
  7. 安装好的nginx安装新的模块
  8. propertychange input change
  9. MySQL服务读取参数文件my.cnf的规律研究探索
  10. C++_IO类型_文件输入输出流_字符串流
  11. java 使用适当的签名_关于数字签名和policy文件设置!
  12. php.ini $ phphome,shell 脚本安装PHP扩展的简单方法
  13. BZOJ_1626_[Usaco2007_Dec]_Building_Roads_修建道路_(Kruskal)
  14. C# label控件竖直显示 label控件垂直显示
  15. snmp trap日志
  16. python 柱状图和折线图放在一起_Excel怎样把柱状图和折线图放在一起(超详细)...
  17. 物联网终端安全系列(之二) -- 物联网终端安全需求分析
  18. 初中数学知识点总结_初中数学知识点
  19. Linux从入门到实战 ---- 磁盘分区
  20. 递归算法转化为非递归算法

热门文章

  1. css 动画 animate
  2. 书籍-分布式系统常用技术及案例分析
  3. Python的文件读取操作
  4. sql两张表,分组或row_number()取最新的记录SQL
  5. c#winform选择文件,文件夹,打开指定目录方法
  6. PHP 调用阿里云短信服务API操作短信模板(增删改查)
  7. Golang sha256 加密,PHP hash_hmac(‘sha256‘, $string, $key)加密,Js CryptoJS.HmacSHA256(string, key) 加密
  8. TP 打开 显示错误信息
  9. SVN统计一段时间的日志
  10. 编译lame报错:lame_init_old找不到