安装步骤:
1. 下载libevent & memcached 源码包
分别把memcached和libevent下载回来,放到 /tmp 目录下:
# cd /tmp
# wget http://memcached.org/files/memcached-1.4.20.tar.gz
# wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
2.安装libevent
# tar zxvf libevent-2.0.21-stable.tar.gz
# cd libevent-2.0.21-stable
# ./configure -prefix=/usr
# make
#make install
如果提示make command not found 请先安装,命令是
#yum -y install gcc automake autoconf libtool make
3.测试libevent是否安装成功:
# ls -al /usr/lib | grep libevent
4.安装memcached,同时需要安装中指定libevent的安装位置:
# cd /tmp
# tar zxvf memcached-1.2.0.tar.gz
# cd memcached-1.2.0
# ./configure -with-libevent=/usr
# make
# make install
5.测试是否成功安装memcached:
# ls -al /usr/local/bin/mem
6启动memcached
# /usr/local/bin/memcached -p 11211 -m 512m -d -u root