环境准备:
Ubuntu 14.04
memcached 1.4.X :http://memcached.org/
1.下载后,我们解压源码
分别执行以下命令:
wget http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure && make && make test && sudo make install
提示:memecached需要
Debian/Ubuntu: apt-get install libevent-dev Redhat/Centos: yum install libevent-devel
2.安装好以后,我们在/usr/local/bin/memcached下就能找到memcached 的执行文件
gm@gm-ThinkPad:/usr/local/memcached-1.4.24/scripts$ /usr/local/bin/memcached -d -m 10 -u root -l 127.0.0.1 -p 11211 -c 256 -P /tmp/memcached.pid
启动后,我们可以通过telnet连接上memcached。
gm@gm-ThinkPad:/usr/local/memcached-1.4.24/scripts$ telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
set
ERROR
set good 32 0 10
helloworld
STORED
gets good
VALUE good 32 10 1
helloworld
END