1、软件包下载
下载Memercached For Windows:http://download.csdn.net/detail/bbirdsky/7395123
2、安装步骤
1、解压到指定目录,如:E:\memcached
2、用cmd打开命令窗口,转到解压的目录,输入 “memcached -d install”
如果在没有安装过的情况下,出现"failed to install service or service already installed"错误,可能是cmd.exe需要用管理员身份运行。
3、查看是否安装成功,输入memcached –h,出现窗口说明已经安装成功。
4、默认参数说明
-p 监听的端口
-l 连接的IP地址, 默认是本机
-d start 启动memcached服务
-d restart 重起memcached服务
-d stop|shutdown 关闭正在运行的memcached服务
-d install 安装memcached服务
-d uninstall 卸载memcached服
-u 以的身份运行 (仅在以root运行的时候有效
-m 最大内存使用,单位MB。默认64M
-M 内存耗尽时返回错误,而不是删除
-c 最大同时连接数,默认是102
-f 块大小增长因子,默认是1.2
-n 最小分配空间,key+value+flags默认是4
-h 显示帮助
启动服务,执行memcached -d start
5、telnet测试是否正常运行 telnet 127.0.0.1 11211
6、进入后先按ctrl+]启动回示功能,否则无法看到输入信息。
7、stats命令查看运行状态如下图:
8、注意:如果提示telnet命令不存在,需要去控件面板开启windows的tel服务功能,
win7的开启tel功能操作步骤是:【控制面板】->【程序和功能】->【打开或关闭window功能】,
然后找到并勾选tel相关即可。其他window系统步骤类似。
9、修改参数,windows下需要通过修改注册表信息进行设置,打开注册表,找
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached
在其中有一个“ImagePath”项,值为:
"D:\memcached\memcached.exe" -d runservice
在后面加上“-m 1024 -c 2048 -p 11210”。等即可。重启服务后生效。
转载自:http://jingyan.baidu.com/article/c85b7a640fbfd5003bac9500.html