加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Memcache linux 安装

发布时间:2020-12-16 05:54:10 所属栏目:安全 来源:网络整理
导读: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-horizonta

<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">也可以启动多个守护进程,但是端口不能重复

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读