1、下载memcached-1.2.1.tar.gz和libevent-1.3b.tar.gz;
2、安装libevent
tar xvfz libevent-1.3b.tar.gz
cd libevent-1.3b
./configure && make
make install
3、安装memcache
tar xvfz memcached-1.2.1.tar.gz
cd memcached-1.2.1
./configure
make && make install
4、将libevent安装的/usr/local/lib输出到引用库路径
# vi ~/.bash_profile
加入如下一行:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
5、启动(安装后位置:/usr/local/bin/memcached)
memcached -d -m 128 -l 192.168.0.50 -p 11211 -u root
即以root用户,分配最大2GM内存启动memcache
memcached -d -m 128 -l 192.168.0.50 -p 11212 -u root
在另外一个端口11212启动另外一个memcache实例
阅读(1061) | 评论(0) | 转发(0) |