#!/bin/bash ip=`/sbin/ifconfig |grep "Bcast"|awk ‘{print $2}‘|awk -F : ‘{print $2}‘|head -n 1` cd /root/soft/memcached #安装libevent tar zxvf libevent-2.0.12-stable.tar.gz cd libevent-2.0.12-stable ./configure --prefix=/usr/local/libevent make && make install cd /root/soft/memcached #安装memcached tar zxvf memcached-1.4.5.tar.gz cd memcached-1.4.5 ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent make && make install ln -s /usr/local/memcached/bin/memcached /usr/bin/memcached cp /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib/ cp /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib64/ #启动memached /usr/local/memcached/bin/memcached -d -l $ip -p 11211 -u root -m 500 -c 30000
注:Memcached版本为:1.4.5 软件包请自行下载!
本文出自 “成都@阿状” 博客,请务必保留此出处http://azhuang.blog.51cto.com/9176790/1551559
原文地址:http://azhuang.blog.51cto.com/9176790/1551559