一、安装gcc
# yum -y install gcc
二、安装libevent
# wget http://www.monkey.org/~provos/libevent-2.0.12-stable.tar.gz
# tar zxf libevent-2.0.12-stable.tar.gz
# cd libevent-2.0.12-stable
#./configure --prefix=/usr/local/lib
四、下载安装最新版本:http://memcached.org/downloads
# wget http://memcached.org/files/memcached-1.4.20.tar.gz
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# yum -y install gcc
二、安装libevent
# wget http://www.monkey.org/~provos/libevent-2.0.12-stable.tar.gz
# tar zxf libevent-2.0.12-stable.tar.gz
# cd libevent-2.0.12-stable
#./configure --prefix=/usr/local/lib
# make && make install
三、安装make
# yum -y install make四、下载安装最新版本:http://memcached.org/downloads
# wget http://memcached.org/files/memcached-1.4.20.tar.gz
# cd memcached-1.4.20
./configure && make && make install。
在命令行输入:ls -al /usr/local/bin/mem*验证是否安装成功。
在命令行输入/usr/local/bin/memcached -d -m 10 -u root -p 12000 -c 256 -P /tmp/memcached.pid启动Memcache的服务器。
在命令行输入:ps -ef | grep 12000可以看到服务已经启动
六、测试memcached
# telnet 127.0.0.1 12677
出现以下信息表示启动成功Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.