Memcache linux 安装

发布时间:2019-11-01 发布网站:大佬教程
大佬教程收集整理的这篇文章主要介绍了Memcache linux 安装大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

<span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium 'Times New Roman'; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="text-align: left; line-height: 21px; font-family: simsun; color: rgb(50,62,50); font-size: 14px" class="Apple-style-span">安装libevent: 

 <span class="Apple-converted-space"> 下载 http://www.monkey.org/~provos/libevent/  <span class="Apple-converted-space"> 安装:<font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#45818e"># tar zxvf libevent-1.2.tar.gz      <span class="Apple-converted-space">  <span class="Apple-converted-space"> # cd libevent-1.2      <span class="Apple-converted-space">  <span class="Apple-converted-space"> # ./configure –prefix=/usr        <span class="Apple-converted-space"> # make        <span class="Apple-converted-space"> # make install <span class="Apple-converted-space"> 测试:     <span class="Apple-converted-space"> <font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#45818e"># ls -al /usr/lib | grep libevent       <span class="Apple-converted-space"> lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent-1.2.so.1 -> libevent-1.2.so.1.0.3       <span class="Apple-converted-space"> -rwxr-xr-x 1 root root 263546 11?? 12 17:38 libevent-1.2.so.1.0.3       <span class="Apple-converted-space"> -rw-r–r– 1 root root 454156 11?? 12 17:38 libevent.a       <span class="Apple-converted-space"> -rwxr-xr-x 1 root root 811 11?? 12 17:38 libevent.la       <span class="Apple-converted-space"> lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent.so -> libevent-1.2.so.1.0.3<font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#45818e">安装服务器sudo apt-get install memcached$ memcached -d -m 50 -p 11211 -u root参数说明 -m 指定使用多少兆的缓存空间;-p 指定要监听的端口; -u 指定以哪个用户来运行安装php 模块sudo apt-get install php5-memcacheMemcache的参数说明:<span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal">-d  <span class="Apple-converted-space"> 选项是启动一个守护进程,-m <span class="Apple-converted-space"> 是分配给Memcache使用的内存数量,单位是MB,默认64MB
<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal">  <span class="Apple-converted-space"> -M <span class="Apple-converted-space"> return error on memory exhausted (rather than removing items)-u <span class="Apple-converted-space"> 是运行Memcache的用户,如果当前为root 的话,需要使用此参数指定用户。-l  <span class="Apple-converted-space"> 是监听的服务器IP地址,默认为所有网卡。-p <span class="Apple-converted-space"> 是设置Memcache的TCP监听的端口,最好是1024以上的端口-c <span class="Apple-converted-space"> 选项是最大运行的并发连接数,默认是1024-P <span class="Apple-converted-space"> 是设置保存Memcache的pid文件


<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal">  <span class="Apple-converted-space"> -f  <span class="Apple-converted-space">   <span class="Apple-converted-space"> chunk size growth factor (default: 1.25)


<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal">  <span class="Apple-converted-space"> -I  <span class="Apple-converted-space"> Override the size of each slab page. Adjusts max item size(1.4.2版本新增)


<p style="padding-bottom: 0px; line-height: 21px; border-right-width: 0px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; border-top-width: 0px; border-bottom-width: 0px; word-break: normal; border-left-width: 0px; padding-top: 0px"><span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal"> <span class="Apple-converted-space"> <span style="line-height: 19px; word-wrap: normal; font-size: small; word-break: normal">也可以启动多个守护进程,但是端口不能重复

大佬总结

以上是大佬教程为你收集整理的Memcache linux 安装全部内容,希望文章能够帮你解决Memcache linux 安装所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ群:277859234,请注明来意。
标签: