memcache 安装与简单使用

一. mac html

  brew install memcachedbash

 

二. win  ide

  win下安装memcachedmemcached

  telnet 链接 注意: telnet 127.0.0.1[空格,不是冒号]11211oop

三. Memcache 查看列出全部key方法spa

 

四.配置日志 参考连接日志

  memcache服务日志保存到日志文件中,则须要在启动参数中进行配置。code

  经过-h 查看memcached支持的参数:htm

[chenzhou@localhost ~]$ /usr/local/memcached/bin/memcached -h  
#其他的省略  
-v            verbose (print errors/warnings while in event loop)  
-vv           very verbose (also print client commands/reponses)  
-vvv          extremely verbose (also print internal state transitions)  

  vv等参数只能把日志信息输出在控制台。因此咱们须要对-vv参数的输出进行数据流重定向.blog

1 /usr/local/memcached/bin/memcached -d -m 2048 -p $1 -u root -vv >> /tmp/memcached.log 2>&1 
View Code  

  重点在最后的:-vv >> /tmp/memcached.log 2>&1

  -vv >> /tmp/memcached.log:表明把-vv的输出重定向到/tmp/memcached.log 文件中

  2>&1的意思是把错误日志也一块儿写入到该文件中

相关文章
相关标签/搜索