安装memcached

[root@php-server ~]# yum install -y memcached.x86_64 #yum安装memcached
[root@php-server ~]# yum info memcached    #列出memcached的rpm包信息 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * atomic: mirrors.neusoft.edu.cn
 * base: centos.ustc.edu.cn
 * epel: mirror01.idc.hinet.net
 * extras: centos.ustc.edu.cn
 * updates: mirrors.sina.cn
 * webtatic: us-east.repo.webtatic.com
Installed Packages
Name        : memcached
Arch        : x86_64
Version     : 1.4.24
Release     : 5.el6.art
Size        : 200 k
Repo        : installed
From repo   : atomic
Summary     : High Performance, Distributed Memory Object Cache
URL         : http://www.memcached.org/
License     : BSD
Description : memcached is a high-performance, distributed memory object caching
            : system, generic in nature, but intended for use in speeding up dynamic
            : web applications by alleviating database load.  #这就是为什么memcached可以减轻databases的原因  [root@php-server ~]# rpm -ql memcached   #安装完memcached后,我们看下文件
/etc/rc.d/init.d/memcached                               #启动脚步
/etc/sysconfig/memcached                                 #配置文件
/usr/bin/memcached                                       #主程序文件目录位置
/usr/bin/memcached-tool                                  #工具程序文件目录位置
/usr/share/doc/memcached-1.4.24      #后面的就不介绍了
/usr/share/doc/memcached-1.4.24/AUTHORS
/usr/share/doc/memcached-1.4.24/CONTRIBUTORS
/usr/share/doc/memcached-1.4.24/COPYING
/usr/share/doc/memcached-1.4.24/ChangeLog
/usr/share/doc/memcached-1.4.24/NEWS
/usr/share/doc/memcached-1.4.24/new_lru.txt
/usr/share/doc/memcached-1.4.24/protocol.txt
/usr/share/doc/memcached-1.4.24/readme.txt
/usr/share/doc/memcached-1.4.24/threads.txt
/usr/share/man/man1/memcached.1.gz
/var/run/memcached
[root@php-server ~]# cat /etc/sysconfig/memcached 
PORT="11211"                      #memcached监听在哪个端口上
USER="memcached"                #运行memcached进程的用户
MAXCONN="1024"                #最大连接数
CACHESIZE="64"                   #缓存大小(实际生产不会只有64M)
OPTIONS=""                        #其他选项
[root@php-server ~]# /etc/init.d/memcached restart  #启动memcached服务
Starting memcached:                                        [  OK  ]
[root@php-server ~]# netstat -tunlp |grep memcached     
tcp        0      0 0.0.0.0:11211               0.0.0.0:*                   LISTEN      1672/memcached      
tcp        0      0 :::11211                    :::*                        LISTEN      1672/memcached      
udp        0      0 0.0.0.0:11211               0.0.0.0:*                               1672/memcached      
udp        0      0 :::11211                    :::*                                    1672/memcache