motop
mongodb实时监控工具,可以同时对多个MongoDB服务器进行监控。显示当前操作。
项目地址:https://github.com/tart/motop
使用
1. 使用easy_install安装
# wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
# easy_install motop
1
2
# wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
# easy_install motop
2. 源码安装
# wget https://github.com/tart/motop/archive/master.zip
# unzip master.zip
# ./setup.py install
1
2
3
# wget https://github.com/tart/motop/archive/master.zip
# unzip master.zip
# ./setup.py install
3. 帮助
# motop -h
1
# motop -h
4. 监控多台
# motop 192.168.124.50 192.158.124.51
1
# motop 192.168.124.50 192.158.124.51
动作
q Quit
p Pause
e Explain the query
k Kill operation using "mongo" executable
K Kill operations older than given seconds using "mongo" executable
r Try to reconnect to disconnected servers
R Try to reconnect to all servers
依赖包
python 2.6 或以上
pymongo 2.0 或以上
配置(选项)
配置文件可以创建在/etc/motop.conf。可以有多个配置短,每一节都可以包含以下参数:
address: 服务器的地址(必需)
username: 登陆用户名
password:登陆用户密码
status:显示状态(默认开启)
replicationInfo :显示复制状态(默认值:开启)
replicaSet :显示副本集的状态(默认值:开启)
operations:显示操作(默认值:开启)
replicationOperations :不断展现主和从的复制操作(默认值:开启)
“DEFAULT”是特殊的部分。本节参数可以设置为默认。
配置实例如下:
[MongoDB01]
address=10.42.2.121
replicationOperations=off
[MongoDB02]
address=10.42.2.122
[MongoDB03]
address=10.42.2.123
[MongoDB04]
address=10.42.2.124
username=foo
password=bar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[MongoDB01]
address=10.42.2.121
replicationOperations=off
[MongoDB02]
address=10.42.2.122
[MongoDB03]
address=10.42.2.123
[MongoDB04]
address=10.42.2.124
username=foo
password=bar
实际使用