SUSE LINIUX 安装Memcached

阅读更多

下载预备软件:

mcached 下载地址: http://www.danga.com/memcached/

bevent 下载地址: http://www.monkey.org/~provos/libevent/

 

操作系统:SUSE Linux 9 64位

memcached需要libevent的支持,我们需要先安装libevent

先安装 libevent
再安装 Memcached 主程序
源码下载:(最新版)
libevent官网:http://monkey.org/~provos/libevent/
Memcached官网:http://www.danga.com/memcached
# wget http://monkey.org/~provos/libevent-1.4.12-stable.tar.gz
# wget http://memcached.googlecode.com/files/memcached-1.4.2.tar.gz

 

安装libevent
shell>tar –zxvf libevent-1.4.8-stable.tar.gz   //解压源文件包

shell>cd libevent-1.4.8-stable   //进入解压后的目录

shell>./configure --prefix=/usr/local/libevent               //译后生成的目标文件夹

shell>make

shell>make install

 

 

安装memcached
shell>tar –zxvf memcached-1.2.6.tar.gz   //解压源文件包

shell>cd memcached-1.2.6   //进入解压后的目录

shell>./configure --with-libevent=/usr/local/libevent --prefix=/usr/local/memcached   //设置libevent的位置和编译后生成的目标文件夹

shell>make

shell>make install

 

启动memcached
shell>cd =/usr/local/memcached/bin

shell>./memcached –d –p 9999 –m 128

 

 运行memcached时报错

/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

 

通过使用exportlibevent的路径加入 LD_LIBRARY_PATH,命令如下:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: =/usr/local/libevent/lib

 

 

 关注基本选项
-p              监听的TCP端口 (缺省: 11211)
-d                         以守护进程方式运行Memcached
-u     运行Memcached的账户,非root用户
-m             最大的内存使用, 单位是MB,缺省是 64 MB
-c               软连接数量, 缺省是 1024
-v                          输出警告和错误信息
-vv                        打印客户端的请求和返回信息
-h                          打印帮助信息
-i                           打印memcached和libevent的版权信息

 

测试:

Ps aux | grep memcached
Telnet 127.0.0.1 11211

 

你可能感兴趣的:(memcached,SuSE,Linux,软件测试)