memcached is a
distributed
cache system by
LiveJournal
developed by Brad Fitzpatrick, but are used by many websites. This is a set
of open source
software
, to authorize release BSD license.
memcached lack of
certification
and
safety
regulation, which represents memcached server should be placed in the
firewall
after.
The memcached
API
using thirty-two bit
cyclic redundancy check
(CRC-32) calculated
key
, the data dispersed in different machines. When the table is full, the new data will be the next
LRU
mechanism replaced. Because usually just as memcached caching system, so use memcached application when you write the slower systems (such as the back-end
database
requires extra code to update data in memcached).
1, the remote connection telnet
1 [root@webtest ~]# telnet 192.168.50.110 11211 2 Trying 192.168.50.110... 3 Connected to 192.168.50.110. 4 Escape character is '^]'.
Description: CentOS operating system not installed by default telnet, need to use yum install yum install
2. List all keys
. 1 stats items // use this command to list all Keys 2 STAT items: . 7 : Number 78 . 3 STAT items: . 7 : Age 3929945 . 4 STAT items: . 7 : evicted 0 . 5 STAT items: . 7 : evicted_nonzero 0 . 6 STAT items: . 7 : evicted_time 0 . 7 STAT items: . 7 : OutOfMemory 0 . 8 STAT items: . 7 : tailrepairs 0 . 9 STAT items: . 7 : Reclaimed 0 10 STAT items:7:expired_unfetched 0 11 STAT items:7:evicted_unfetched 0 12 STAT items:7:crawler_reclaimed 0 13 STAT items:7:crawler_items_checked 0 14 STAT items:7:lrutail_reflocked 0 15 STAT items:9:number 1 16 STAT items:9:age 93 17 STAT items:9:evicted 0 18 STAT items:9:evicted_nonzero 0 19 END
3, by acquiring key itemid
A command key value obtained by stats cachedump id 0. 0 indicates List All
. 1 stats cachedump . 7 0 // by this command to obtain 2 the ITEM 15711150681vc [ 254 B; 1474710873 S] . 3 the ITEM 14444234444vc [ 232 B; 1474710873 S] . 4 the ITEM 14444444491vc [ 232 B; 1474710873 S] . 5 the ITEM 14444444490vc [ 232 B; 1474710873 S] . 6 the ITEM 17701325929vc [ 232 B; 1,474,710,873 S] . 7 the ITEM 14020161027vc [ 232 B; 1,474,710,873 S] . 8 ITEM 14020161026vc [232 b; 1474710873 s] 9 ITEM 14020161025vc [232 b; 1474710873 s] 10 ITEM 14020161024vc [232 b; 1474710873 s] 11 ITEM 14020161023vc [232 b; 1474710873 s] 12 ITEM 14020161109vc [232 b; 1474710873 s] 13 ITEM 14020161108vc [232 b; 1474710873 s] 14 END
4, to obtain the value of key commands get get get by key value
1 get 15711150681vc // value of get command to get the key 2 of VALUE 15711150681vc 0 254 3 ¬ 첲 java.util.HashMap ہ V`σF 4 loadFactorI thresholdxp? @ 5 ttempAccessTokent (CYQtGf- 1478588852030Nh2QGuzV_15711150681t 6 verifyCodet594447sendTimesrjava.lang.Long;䑌# ݂ Jvaluexrjava.lang. Number¬ 7 ɂxpXB§? the X- 8 END
Reference links
http://www.darkcoding.net/software/memcached-list-all-keys/
https://blog.csdn.net/bjnihao/article/details/53097160