標籤:監控 redis
redis-db-tools 是使用Python開發的。建議使用Python2.7.12,之前使用Python2.6.6啟動時報錯。
按照網上教程自行安裝Python,系統內容是centos。
Python 安裝好以後下載pip,http://www.python-libs.com/13205/item/detail.html
pip下載後進行安裝
#安裝piptar -zxvf pip-9.0.1.tar.gz cd pip-9.0.1python setup.py install
pip 安裝成功後,進入 /usr/local/python2.7/bin
使用命令 pip install rdbtools 安裝redis-db-tools
安裝 redis-py 用戶端 用於find memory by a single key,使用命令 pip install redis
至此,dbtool 安裝完畢了。
注意,使用時同樣需要在Python的安裝目錄。
具體使用規則和用例詳見:
https://github.com/sripathikrishnan/redis-rdb-tools
裡面有具體的使用手冊
匯出excel後的結果如下:
| database |
type |
key |
size_in_bytes |
encoding |
num_elements |
len_largest_element |
| 0 |
hash |
LAST_DRIVE_GREEN_LEADERBOARD_3 |
283 |
ziplist |
21 |
8 |
| 0 |
hash |
VALCAN_RAILWAYS_DATA_HASDED_DATA |
11448484 |
hashtable |
124187 |
127 |
| 0 |
hash |
VALCAN_BUSTOP_TRAIN_DATA |
232379812 |
hashtable |
53805 |
21008 |
| 0 |
hash |
LAST_DRIVE_GREEN_LEADERBOARD |
52644 |
hashtable |
711 |
8 |
| 0 |
hash |
VALCAN_RAILWAYS_DATA |
15302964 |
hashtable |
37231 |
10232 |
| 0 |
string |
WX_ACCESS_TOKEN |
256 |
string |
138 |
138 |
本文出自 “正氣大俠” 部落格,轉載請與作者聯絡!
使用redis-db-tools分析監控dump.rdb