日期:2014-05-16  浏览次数:20676 次

memcached linux 安装

一、memcached的编译安装
准备:
Memcached下载地址:http://www.danga.com/memcached/
libevent下载地址:http://monkey.org/~provos/libevent/

安装步骤:
1.下载libevent & memcached源码包<?XML:NAMESPACE PREFIX = O />

??? libevent-1.3.tar.gz
??? memcached-1.2.2.tar.gz


2.解压缩libevent-1.3.tar.gz,编译安装

??? # tar zxvf? libevent-1.3.tar.gz
??? # cd libevent-1.3
??? # ./configure --prefix=/usr/local/libevent
??? # make ; make install

?

测试libevent是否安装成功:

???? # ls -al /usr/lib | grep libevent

? lrwxrwxrwx 1 root root 21 11??? 12 17:38 libevent-1.2.so.1 -> libevent-1.2.so.1.0.3

?-rwxr-xr-x 1root root 263546? 11?? 12 17:38 libevent-1.2.so.1.0.3

?-rw-r–r– 1 root root 454156 11?? 12 17:38 libevent.a

?-rwxr-xr-x 1 root root 811 11?? 12 17:38 libevent.la

?lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent.so -> libevent-1.2.so.1.0.3????


3.解压缩memcached-1.2.2.tar.gz,编译安装

??? # tar zxvf memcached-1.2.2.tar.gz
??? # cd memcached-1.2.2
??? # ./configure --prefix=/usr/local/memchached --with-libevent=/usr/local/libevent
??? # make;make install

?

测试是否成功安装memcached:

? # ls -al /usr/local/bin/mem*

?-rwxr-xr-x 1 root root 137986 11?? 12 17:39 /usr/local/bin/memcached

?-rwxr-xr-x 1 root root 140179 11?? 12 17:39 /usr/local/bin/memcached-debug


4.作软连接,否则运行memcached的时候将找不到libevent模块

??? # ln -s /usr/local/libevent/lib/libevent-1.3.so.1 /usr/lib


5.启动memcached

??? # /usr/local/memcached/bin/memcached -d -m 256 -p 11211 -u root

?

?


----------------------承接java 项目
java web ,
java 中间件开发
电话 13534066735
QQ?? 239052343