设为首页 收藏本站
查看: 706|回复: 0

[经验分享] #Memcached系列#(2)在Windows环境下安装Memcached

[复制链接]

尚未签到

发表于 2018-6-20 10:36:18 | 显示全部楼层 |阅读模式
  本篇文章主要是讲如何在Windows操作系统上安装Memcached。
  原文地址:Installing Memcached on Windows
  在上一篇文章当中,主要先简述了一下Object Caching存在的缺点,接着又说明了一下Memcached可以避免这些缺点,最后,说Memcached的分为两部分:Memcached Server和Memcached Client两部分。本文,就是讲述Memcached Server如何安装。
  值得注意的是,Memcached的windows binary主要有两个主要来源:Jellycan和Northscale。之所以强调这个问题,是因为今天上午和下午一直没有安装成功,到后来才发现有这个差异,发现这个差异之后,才安装成功了。
  【Memcached的简介】Memcached is a high performance, in-memory key-value store or caching system. Its main purpose is to speed up web applications by caching database queries, contents, or other computed results.
  【Memcached的由来】Memcached is originally a linux application, but since it is open-source, it has been compiled for windows. 【Memcached的两个主要来源】There are two major sources for the pre-built windows binary: Jellycan and Northscale, and both versions can be used. The following are the download links for the memcached windows binaries:
  http://code.jellycan.com/files/memcached-1.2.5-win32-bin.zip
  http://code.jellycan.com/files/memcached-1.2.6-win32-bin.zip
  http://downloads.northscale.com/memcached-win32-1.4.4-14.zip
  http://downloads.northscale.com/memcached-win64-1.4.4-14.zip
  http://downloads.northscale.com/memcached-1.4.5-x86.zip
  http://downloads.northscale.com/memcached-1.4.5-amd64.zip
  在本文的结尾处,有这6个版本的打包附件,还有一个地址:http://blog.elijaa.org/2010/10/15/memcached-for-windows/
  【在1.4.5之前的版本,可以将Memcached安装为Windows的服务】In versions earlier than 1.4.5, memcached can install itself as a service. 【在1.4.5之后,Memcached就不能再安装为Windows服务了】However, the ability to run memcached as a service is removed since version 1.4.5. 【因此,安装步骤也分为两部分】Therefore, the installation steps are divided into two categories, part A for memcached prior to version 1.4.5. and part B for memcached version 1.4.5 and later.
A) Installation of memcached < 1.4.5:

  •   Extract the memcached windows binary to any directroy.
  •   In versions earlier than 1.4.5, memcached can install itself as a service. Run a command prompt with elevated privileges, and type:
    c:\memcached\memcached.exe -d install  * Replace c:\memcached\memcached.exe with the actual path of your installation.
  •   Then, start or stop the memcached service with the following command:
    c:\memcached\memcached.exe -d start  
    c:\memcached\memcached.exe -d stop
  •   To change the configuration of memcached, run regedit.exe and navigate to the key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached". Suppose you wish to increase the memory limit of memcached, edit the value of ImagePath to the following:
    "c:\memcached\memcached.exe" -d runservice -m 512  * Besides '-m 512', you may also append other memcached parameters to the path. Run "c:\memcached\memcached.exe -h" to view the list of available parameters.
  •   Meanwhile, to uninstall the memcached serivce, run the following command:
    c:\memcached\memcached.exe -d uninstall
B) Installation of memcached >= 1.4.5:

  •   Extract the memcached windows binary to any directroy.
  •   In version 1.4.5 or later, memcached cannot run as a service. It must be started as a normal process using the task scheduler. To configure the memcached process to run automatically every time windows start, run a command prompt and type the following:
    schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"  * Replace c:\memcached\memcached.exe with the actual path of your installation.
      ** Besides '-m 512', you may also append other memcached parameters to the path. Run "c:\memcached\memcached.exe -h" to view the list of available parameters.
  •   Meanwhile, to remove the scheduled memcached task, run the following command:
    schtasks /delete /tn memcached
  补充一下常用设置
  常用设置:
  -p <num>          监听的端口
  -l <ip_addr>      连接的IP地址, 默认是本机
  -d start          启动memcached服务
  -d restart        重起memcached服务
  -d stop|shutdown  关闭正在运行的memcached服务
  -d install        安装memcached服务
  -d uninstall      卸载memcached服务
  -u <username>     以<username>的身份运行 (仅在以root运行的时候有效)
  -m <num>          最大内存使用,单位MB。默认64MB
  -M                内存耗尽时返回错误,而不是删除项
  -c <num>          最大同时连接数,默认是1024
  -f <factor>       块大小增长因子,默认是1.25
  -n <bytes>        最小分配空间,key+value+flags默认是48
  -h                显示帮助
Memcached statistics
  To view the statistics for memcached, bring up a telnet connection to memcached by the command:
telnet 127.0.0.1 11211  Then, type statsand enter.
  Here is an explanation of the different memcached stats.
NameTypeMeaningNameTypeMeaningpid32uProcess>Source: https://github.com/memcached/memcached/blob/master/doc/protocol.txt  还有一个地方可以下载:http://blog.elijaa.org/2010/10/15/memcached-for-windows/
  This post contains various binaries versions of Memcached for Windows as finding some of them may be difficult.
Memcached 1.2.X
  Memcached 1.2.4 for Windows (32 Bits) : memcached 1.2.4 win32.zip
  Memcached 1.2.5 for Windows (32 Bits) : memcached 1.2.5 win32.zip
  Memcached 1.2.6 for Windows (32 Bits) : memcached 1.2.6 win32.zip
Memcached 1.4.X
  Memcached 1.4.2 for Windows (32 Bits) : memcached 1.4.2 win32.zip
  Memcached 1.4.4 for Windows (32 Bits) : memcached 1.4.4 win32.rar
  Memcached 1.4.5 for Windows (32 Bits) : memcached 1.4.5 win32.zip
  Memcached 1.4.5 for Windows (64 Bits) : memcached 1.4.5 win64.zip
Credits
  All credits goes to Jellycan for 1.2.5 and 1.2.6 and Northscale (now Membase) for 1.4.X.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-526249-1-1.html 上篇帖子: Windows Container On Azure-KAKA 下篇帖子: Powershell 更新 Nagios Windows客户端
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表