当前位置:首页 > 技术文章 > 系统架构 > 系统架构-memcached安装与配置
系统架构-memcached安装与配置
文章来源:本站原创  浏览次数:126  发布日期:2013-07-19

//memcached 安装
#yum -y install libevent libevent-devel
#whereis libevent
#tar zxvf memcached-1.4.15.tar.gz
#cd memcached-1.4.15
#./configure --prefix=/usr/web/memcached
#make && make install

   //开启防火墙 11211 端口
#vi /etc/sysconfig/iptables

   //启动  目标:使用11211端口、root用户、最大占用512M内存、1024个软连接,输出客户端请求,以守护进程方式运行
#/usr/web/memcached/bin/memcached -l 192.168.3.58 -p 11211 -d -m 32 -u root -P /tmp/memcached.pid
#netstat -tunpl |grep 11211
#netstat -anp|grep 11211

   //关闭
#kill 'cat /tmp/memcached.pid'
   //建立服务
#cp /tmp/memcached-1.4.15/scripts/memcached.sysv /etc/init.d/memcached
#chmod 755 /etc/init.d/memcached
   //修改  /etc/init.d/memcached 文件的配置信息
#vi /etc/init.d/memcached
   //加入系统服务
#chkconfig --add memcached  
#chkconfig --level 235 memcached on
#chkconfig --list memcached
#service memcached start
#ps aux|grep memcached
#service memcached stop


   //客户端下载地址 http://pecl.php.net/package/memcached
   //libmemcached 安装
#cd /tmp
#tar zxvf libmemcached-1.0.16.tar.gz
#cd /tmp/libmemcached-1.0.16
#./configure --prefix=/usr/web/libmemcached --with-memcached=/usr/web/memcached
#make && make install

   //安装igbinary 提高压缩效率
#cd /tmp  
#tar zxvf igbinary-1.1.1.tgz
#cd /tmp/igbinary-1.1.1
#/usr/web/php/bin/phpize
#./configure --with-php-config=/usr/web/php/bin/php-config --enable-igbinary
#make && make install
   //加上extension=/usr/web/php/lib/php/extensions/no-debug-non-zts-20100525/igbinary.so
#vi /usr/web/php/lib/php.ini

   //memcached-2.1.0 安装
#tar zxvf memcached-2.1.0.tgz
#cd /tmp/memcached-2.1.0
#/usr/web/php/bin/phpize
#./configure --enable-memcached-igbinary --enable-memcached-json --enable-memcached --with-php-config=/usr/web/php/bin/php-config --with-libmemcached-dir=/usr/web/libmemcached
#make && make install
   //加上extension=/usr/web/php/lib/php/extensions/no-debug-non-zts-20100525/memcached.so
#vi /usr/web/php/lib/php.ini
#service httpd restart

原文来自:系统架构-memcached安装与配置 http://www.redyun.net/technology/109.html

红云案例Case