CentOS或Redhat上装memcached (包括64位系统)

需要注意到是CentOS就自带了一个libevent,但是版本老,跟现在memcached不兼容了。装完后会提示这个错误:

error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

所以在装之前,先yum remove libevent

然后再wget最新版本的(我的是1.4.9)再./configure --prefix=/usr/local 再make & make install

装好之后再去vim /etc/ld.so.conf.d/libevent-i386.conf(x64下是libevent-x86_64.conf)添加/usr/local/lib然后:x退出vim,执行ldconfig

这样装好的memcached再运行就没问题了,使用./configuration –with-libevent=/usr/local –enable-threads (x64要添加 --enable-64bit)即可。memcached默认的-f为1.25,可以设置为1.75。

memcached -vv -u root -p 11211 -m 800m -c 10240 -f 1.5 -d -P /tmp/m1.pid

永久关闭防火墙(放在内网访问)
chkconfig --level 35 iptables off

如果用外网

# iptables -F
# iptables -P INPUT DROP
# iptables -A INPUT -p tcp -s 192.168.0.2 --dport 11211 -j ACCEPT
# iptables -A INPUT -p udp -s 192.168.0.2 --dport 11211 -j ACCEPT

转载于:https://www.cnblogs.com/fanweixiao/archive/2009/04/12/1434291.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值