本篇内容主要讲解“使用命令行连接并查看memcached数据的方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“使用命令行连接并查看memcached数据的方法”吧!
首先连接memcached
telnet 127.0.0.0 11211
然后列出所有items
stats items
结果如下
STAT items:5:number 3
STAT items:5:number_hot 0
STAT items:5:number_warm 0
STAT items:5:number_cold 3
STAT items:5:age_hot 0
STAT items:5:age_warm 0
STAT items:5:age 81407
STAT items:5:mem_requested 720
STAT items:5:evicted 0
STAT items:5:evicted_nonzero 0
STAT items:5:evicted_time 0
STAT items:5:outofmemory 0
STAT items:5:tailrepairs 0
STAT items:5:reclaimed 5
STAT items:5:expired_unfetched 4
STAT items:5:evicted_unfetched 0
STAT items:5:evicted_active 0
STAT items:5:crawler_reclaimed 1
STAT items:5:crawler_items_checked 170
STAT items:5:lrutail_reflocked 16
STAT items:5:moves_to_cold 29
STAT items:5:moves_to_warm 20
STAT items:5:moves_within_lru 25
STAT items:5:direct_reclaims 0
STAT items:5:hits_to_hot 0
STAT items:5:hits_to_warm 25
STAT items:5:hits_to_cold 24
STAT items:5:hits_to_temp 0
STAT items:15:number 1
STAT items:15:number_hot 0
STAT items:15:number_warm 0
STAT items:15:number_cold 1
STAT items:15:age_hot 0
STAT items:15:age_warm 0
STAT items:15:age 30
STAT items:15:mem_requested 1950
STAT items:15:evicted 0
STAT items:15:evicted_nonzero 0
STAT items:15:evicted_time 0
STAT items:15:outofmemory 0
STAT items:15:tailrepairs 0
STAT items:15:reclaimed 10
STAT items:15:expired_unfetched 0
STAT items:15:evicted_unfetched 0
STAT items:15:evicted_active 0
STAT items:15:crawler_reclaimed 0
STAT items:15:crawler_items_checked 6
STAT items:15:lrutail_reflocked 128
STAT items:15:moves_to_cold 185
STAT items:15:moves_to_warm 174
STAT items:15:moves_within_lru 0
STAT items:15:direct_reclaims 0
STAT items:15:hits_to_hot 1
STAT items:15:hits_to_warm 0
STAT items:15:hits_to_cold 184
STAT items:15:hits_to_temp 0
然后通过itemid获取item下的所有key
例如获取itemid为5的所有key(5是id,0是获取所有)
stat cachedump 5 0
结果:
ITEM 02a576f1b8416724f119693470f713b9 [145 b; 1571811395 s] ITEM 0180882b03dc215c916481cfd46ffe71 [145 b; 1571801564 s] ITEM 6c2f83523dc06bb029bb2981940d5a40 [145 b; 1571730004 s]
最后通过get命令获取指定key的数据
get 02a576f1b8416724f119693470f713b9
通过该命令就可以获取到指定key的数据了
到此,相信大家对“使用命令行连接并查看memcached数据的方法”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。