motop
項目下載地址:https://github.com/tart/motop
使用
1. 使用easy_install安裝
# 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
3. 協助
# motop -h
4. 監控多台
# 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
實際使用