挂载光盘
mkdir -p /media/cdrom
mount /dev/cdrom /media/cdrom
设置yum
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo_bak
vi CentOS-Media.repo
将
gpgcheck=1
enabled=0
更改为
gpgcheck=0
enabled=1
yum -y install gcc gcc-c++
yum -y install make
首先服务端要安装libevent和memcached
将这两个文件上传到服务器(或者在线下载)
解压缩两个压缩包
tar zxvf libevent-1.4.14b-stable.tar.gz
tar zxvf memcached-1.4.0.tar.gz
先安装libevent
cd libevent-1.4.14b-stable
./configure
make
make install
cd ../memcached-1.4.0
./configure
make
make install
ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib/libevent-1.4.so.2
启动
/usr/local/bin/memcached -d -m 10 -l 192.168.1.244 -p 11211 -u root -P /tmp/mecache.pid
(注意这个ip写成自己的ip)