问题描述
我想列出存储在内存缓存服务器中的所有密钥.
I want to list all the keys stored in the memcached server.
我用谷歌搜索了相同的内容,我得到了一些可以列出相同内容的python/php脚本.我测试了一下,但是一切都失败了,没有一个给我完整的密钥.我可以使用telnet命令看到数千个按键
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
我使用了Perl脚本,该脚本使用telnet列出密钥,但是也失败了.我的意思是脚本在列出密钥,但不是全部.
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.
我需要重新配置telnet吗?还有其他方法吗?
Do I need to reconfigure telnet ? Is there any other way ?
推荐答案
memcache没有提供用于详尽列出所有键的api. 统计项"与列出前1M个密钥一样好.此处的更多信息: http://www.darkcoding.net/software/memcached-列出所有键/
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/
不确定是否可以帮到您,但是redis(可以将其视为memcache的超集)为密钥列表和搜索提供了更全面的API.您可能需要尝试一下.
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.
这篇关于无法通过telnet客户端检索所有的Memcache密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!