Couldn't retrieve all the memcache keys via telnet client

时光怂恿深爱的人放手 提交于 2019-12-13 07:18:53

问题


I want to list all the keys stored in the memcached server.

I googled for the same, I got some python/php scripts that can list the same. I tested it but all went failed and none gave me full keys. I can see thousands of keys using telnet command

stats items

I used perl script that uses telnet to list keys, but that got failed too. I mean that script is listing keys but not all of them.

Do I need to reconfigure telnet ? Is there any other way ?


回答1:


memcache does not provide an api to exhaustively list all keys. "stats items" is as good as it gets to list the first 1M of keys. More info here: http://www.darkcoding.net/software/memcached-list-all-keys/

Not sure if that helps you but redis (which could be considered a superset of memcache) provides a more comprehensive API for key listing and searching. You might want to give it a try.




回答2:


It you use python-memcached, and would like to export all the items in memcache server, I summerized two methods to the problem in this question: Export all keys and values from memcached with python-memcache



来源:https://stackoverflow.com/questions/15040884/couldnt-retrieve-all-the-memcache-keys-via-telnet-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!