---------------------------------------------------------------
1. yum install gcc-c++
4:解压,编译memcache。
# cd ../
# mkdir memcached
# tar -zxvf memcached-1.4.15.tar.gz
# cd memcached-1.4.15
# ./configure --prefix=/data/opt/memcached/memcached --with-libevent=/data/opt/memcached/libevent
# make && make install
---------------------------------------------------------------
Memcache安装:
1:下载libevent与memcache软件包。
libevent下载地址:http://monkey.org/~provos/libevent/
memcache下载地址:http://memcached.org/
2:解压,编译libevent。
# makdir libevent
# tar -zxvf libevent-2.1.3-alpha.tar.gz
# cd libevent-2.1.3-alpha
# ./configure -prefix=/data/opt/memcached/libevent
# make && make install
3:解压,编译memcache。
# mkdir memcached
# cd ../
# tar -zxvf memcached-1.4.15.tar.gz
# cd memcached-1.4.15.tar.gz
# ./configure --prefix=/data/opt/memcached/ --with-libevent=/data/opt/memcached/libevent
# make && make install
4:开启memcache,并连接测试:
以守护进程模式启动memcache
# /usr/local/bin/bin/memcached -d -l 192.168.189.129 -p 11211 -m 2048 -u root
环境变量设置
export MEM_HOME=/data/opt/memcached
export PATH=$MEM_HOME/bin:$PATH
memcached -d -m 1024 -u root -c 1024 -p 11213 -P /tmp/memcached2.pid