首页 > 系统服务 > 详细

Memcached基本操作

时间:2016-02-28 01:12:27      阅读:221      评论:0      收藏:0      [点我收藏+]

1 、连接memcached

[root@localhost ~]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.

2、退出

[root@localhost ~]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.
quit
Connection closed by foreign host.
[root@localhost ~]#

2、设置

[root@localhost ~]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.
set key1 0 300 2 #key1:表示键值       0: 标记      300:过期时间      2:大小双字节
12  #存的值
STORED #表示存储好了

get key1 #取
VALUE key1 0 2
12
END

3、查看chunk

[root@localhost ~]# memcached-tool  127.0.0.1:11211 display
  #  Item_Size  Max_age   Pages   Count   Full?  Evicted Evict_Time OOM
  1      96B      1819s       1       1      no        0        0    0


Memcached基本操作

原文:http://caimengzhi.blog.51cto.com/9787265/1745572

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!