重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

MongoDB监控方法总结

1).使用serverStatus在Shell中监控


使用mongo命令进入Shell客户端后使用命令:
>db.serverStatus();


主机名
>db.serverStatus().host 


锁信息
>db.serverStatus().locks


全局锁信息
>db.serverStatus().globalLock


内存信息
>db.serverStatus().mem


连接数信息
>db.serverStatus().connections


额外信息
>db.serverStatus().extra_info


索引统计信息
>db.serverStatus().indexCounters


后台刷新信息
>db.serverStatus().backgroundFlushing


游标信息
>db.serverStatus().cursors


网络信息
>db.serverStatus().network


副本集信息
>db.serverStatus().repl


副本集的操作计数器
>db.serverStatus().opcountersRepl


操作计数器
>db.serverStatus().opcounters


断言信息Asserts
>db.serverStatus().asserts


writeBacksQueued
>db.serverStatus().writeBacksQueued


持久化(dur)
>db.serverStatus().dur


记录状态信息
>db.serverStatus().recordStats


工作集配置
>db.serverStatus( { workingSet: 1 } ).workingSet


指标信息metrics
>db.serverStatus().metrics


想监控具体某个参数,把参数名放在db.serverStatus().之后即可。

2).使用mongostat在Shell中监控
serverStatus命令是静态的监控,MongoDB提供了动态的监控执行工具mongostat。mongostat会动态输出一些serverStatus提供的重要信息,每秒输出一次。mongostat的使用方式跟mongo客户端一样,需要在mongostat可执行文件下使用命令:
./ mongostat
如果MongoDB可执行文件Bin目录已经加入环境变量则直接使用:
mongostat


文章标题:MongoDB监控方法总结
标题URL:http://cqcxhl.com/article/jdeggp.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP