安装部署
libevent 稳定版
wget http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
memcached 稳定版
wget https://memcached.org/files/memcached-1.5.16.tar.gz
软件安装
Libevent安装
tar zxvf libevent-1.4.14b-stable.tar.gz
yum install make gcc gcc-c++
cd libevent-1.4.14b-stable
./configure --prefix=/usr/local/libevent/
make
make install
Memcached安装
tar -zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent/
make
make install
启动:
[root@localhost init.d]# /usr/local/memcached/bin/memcached -d -l 127.0.0.1 -p
11211 -u root -m 64 -c 1024 -P /var/run/memcached.pid
[root@localhost init.d]# ps -ef |grep memcached
root 16227 1 0 00:56 ? 00:00:00
/usr/local/memcached/bin/memcached -d -l 127.0.0.1 -p 11211 -u root -m 64 -c
1024 -P /var/run/memcached.pid
root 16238 1201 0 00:57 pts/0 00:00:00 grep --color=auto memcached
链接测试:
[root@localhost init.d]# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
stats ...
(quit)退出