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
页:
[1]