1. 程式人生 > >在Linux下編譯安裝memcached

在Linux下編譯安裝memcached

linux memcache

一.在編譯安裝之前,先安裝系統所需要的相關庫文件

#yum -y install gcc gcc-c++ make cmake libtool autoconf libaio


二.下載相應的依賴庫和memcached源碼包

1.從http://libevent.org/下載libevent的stable版本


#wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz

#wget http://www.memcached.org/files/memcached-1.5.0.tar.gz


2.編譯安裝libevent

#tar -zxvf libevent-2.1.8-stable.tar.gz

#cd libevent-2.1.8-stable

#./configure --prefix=/usr/local/libevent

#make && make install


註意:在虛擬機下練習編譯,一個容易碰到的問題,虛擬機時間不對,導致gcc編譯過程中檢測時間不對,一直處於編譯過程中。

解決的方法:

#date -s "yyyy-mm-dd H:i:s"

#clock -w #把時間寫入cmos


3.編譯安裝memcache

#tar -zxvf memcached-1.5.0.tar.gz

#cd memcached-1.5.0

#./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent/ #指定libevent的安裝目錄

#make && make install


4.啟動memched

#cd /usr/local/memcached/bin

#./memcached -m 64 -p 11211 -u nobody -d


本文出自 “marks” 博客,請務必保留此出處http://2477785.blog.51cto.com/2467785/1954351

在Linux下編譯安裝memcached