您好,登錄后才能下訂單哦!
本篇內容主要講解“使用命令行連接并查看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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。