http://gfllove.blog.163.com/blog/static/1515027201081455921397/

 

linux下 memcached-1.4.5 安装

2010-09-14 17:59:21|  分类: memcached |  标签:memcached   |字号 订阅

 
 linux下 memcached-1.4.5  安装

安装:libevent
下载地址:http://www.monkey.org /~provos/libevent/
./configure --prefix=/usr/local/libevent
make
make install

安装:memcached
错误:
安装包的时候运行./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent/ 时出现下面的提示:
checking build system type... Invalid configuration `i686-pc-linux-': machine `i686-pc-linux' not recognized
configure: error: /bin/sh config/config.sub i686-pc-linux- failed
解决方法:
./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent/ --build=i686-pc-linux-gnu

错误:
configure: error: no acceptable C compiler found in $PATH
解决方法:
yum install gcc

./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent/
make
make install


启动服务 :
memcached -d -m 10    -u root -l 192.168.40.4 -p 12000 -c 256 -P /tmp/memcached.pid  (完整启动)
memcached -d -m 1024    -u root  -p 55001 -c 2048   (默认启动)

 
参数说明:
-d 选项是启动一个守护进程
-m是分配给Memcache使用的内存数量,单位是MB,我这里是10MB
-u是运行Memcache的用户, 我这里是root
-l是监听的服务器IP地址
-p是设置Memcache监听的端口,最好是1024以上的端口
-c选项是最大运 行的并发连接数,默认是1024,按照你服务器的负载量来设定
-P是设置保存Memcache的pid文件
-vv 调试模式
 
 
 
 
 
 
 
 
 
 
 
 
 
-------------
sysbench也有类似 第一个错误提示,同样的解决办法