mongo集群的监控(一)

由于工作中总是遇到一些私有化部署和不同环境的mongo server异常,为了统一方便的监控其运行情况,我筛选了多个工具,最终选择了motop。

motop是一款用python编写的实时监控工具,可以同时对多个MongoDB服务器进行监控。显示当前操作。

项目地址:https://github.com/tart/motop

easy_install方式安装:

easy_install motop

查看帮助

motop -h

 

主要用法解析

motop [host, host2, host3....]

需要验证则用admin账号(数据库的root权限账号和密码)

motop [host] -u [user_name] -p [password]

# 监控预发布环境。

motop xxx.xxx.xxx.xxx -u admin -p xxxxx

# 监控测试服

motop xxx.xx.xxx.xxx -u admin2 -p xxxxxx

多个授权验证的mongo的监控可以写入配置文档,motop.conf如下:

[TestMongoDBServer]

address=xxx.xxx.xxx.xx

username=admin

password=xxxxx

[PreStagingMongoDBServer]

address=xx.xxx.xxx.xxx

username=xxx

password=xxxx

motop -c /path/to/motop.conf

运行效果如下图:

 

这样可以方便地实时监控多集群mongo server的情况,感觉类似于linux的top效果。它的配置参数中也可以增加对复制集的配置,灵活性比较强,适合运维监控使用。

猜你喜欢

转载自www.cnblogs.com/freephp/p/10367268.html