centos memcached安装手册:

一、安装libevent函数库

libevent各版本地址:http://libevent.org/old-releases.html

在此我安装当前最稳定版本:libevent-2.0.21

  1. 下载:
    1
    
    #wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz 
    
  2. 解压:
    1
    
    #tar -zxvf libevent-2.0.21-stable.tar.gz 
    

3 配置及编译安装:

1
2
3
4
 cd ibevent-2.0.21-stable
 ./configure --prefix=/usr/local/services/libevent-2.0.21-stable 
 make -j 8
 make install
  1. 检查是否安装成功:
    1
    
    #ls -al /usr/local/services/libevent-2.0.21-stable/lib | grep libevent
    

二、安装memcached

memcached各版本下载址:https://github.com/memcached/memcached/wiki/ReleaseNotes

或者:wget http://memcached.org/latest

在此我安装当前最稳定版本: memcache-1.5.9

  1. 下载:#wget http://memcached.org/files/memcached-1.5.9.tar.gz
  2. 解压:#tar -zxvf memcached-1.5.9.tar.gz
  3. 配置及编译安装:
1
2
3
4
5
6
7
8
yum install libevent-devel  cyrus-sasl-devel cyrus-sasl-lib #安装依赖,可以不装
./configure \
-with-libevent=/usr/local/services/libevent-2.0.21-stable/ \
--prefix=/usr/local/services/memcached-1.5.9 \
--enable-64bit \
--enable-sasl --enable-sasl-pwdb
make -j 8
make install
  1. 启动脚本start.sh:
1
2
#!/bin/sh
bin/memcached -d -m 1024M -u nobody -l 0.0.0.0 -p 11211 -c 1024 -P /usr/local/services/memcached-1.5.9/memcached.pid
  1. 开机启动脚本处理: