CentOS上安装Memcached[转]

1.安装Memcached前需要先安装Libevent:# curl -O http://www.monkey.org/~provos/libevent-1.4.9-stable.tar.gz
# tar zxf libevent-1.4.9-stable.tar.gz
# cd libevent-1.4.9-stable
# ./configure
# make
# make install

 

2.接着安装Memcached:
# curl -O http://www.danga.com/memcached/dist/memcached-1.2.7.tar.gz
# tar zxf memcached-1.2.7.tar.gz
# cd memcached-1.2.7
# ./configure
# make
# make install

 

3.接着在当前用户的.bash_profile中添加

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH


4.运行

# memcached -m 512 -u nobody -vv

测试时候发现会出现以下错误信息:

“/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory”

错误的原因是未在系统中注册Libevent. 解决方法如下:

# vi /etc/ld.so.conf.d/libevent-i386.conf

在VI中输入以下一行内容:

/usr/local/lib/

最后不要忘了
# ldconfig

 

5.运行

# memcached -m 512 -u nobody -vv

……….

<6 server listening
<7 server listening
<8 send buffer was 109568, now 268435456
<8 server listening (udp)
<9 send buffer was 109568, now 268435456
<9 server listening (udp)

Memcached运行正常。

原文:http://www.cnblogs.com/inrie/archive/2009/04/12/1434018.html

Leave a Comment