本文簡(jiǎn)述了在rhel5.7下安裝gearmand及啟動(dòng)的方法,供大家學(xué)習(xí)參考!
首先,到官網(wǎng)https://launchpad.net/gearmand/下載gearmand的源碼包,傳到rhel5.7的系統(tǒng)上,并解壓。
運(yùn)行configure:
[@localhost gearmand-1.1.11]# ./configure --prefix=/usr/local/gearman --with-mysql --with-sqlite3=no
這時(shí)候會(huì)出現(xiàn)報(bào)如下錯(cuò)誤:
checking for Boost headers version >= 1.39.0... no
configure: error: cannot find Boost headers version >= 1.39.0
ok,http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download
此時(shí)需要下載boost,并解壓:
./bootstrap.sh --prefix=/usr/local/boost/
./b2 install
這個(gè)過程需要等待一段時(shí)間,詳情可參考官網(wǎng):dochttp://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html
安裝完成之后,回到gearman目錄,執(zhí)行如下命令:
CPPFLAGS=-I/usr/local/boost/include LDFLAGS=-L/usr/local/boost/lib ./configure --prefix=/usr/local/gearman --with-mysql --with-sqlite3=no
這時(shí)還會(huì)報(bào)如下錯(cuò)誤:
checking for gperf... no
configure: error: could not find gperf
緊接著執(zhí)行yum安裝:
再次執(zhí)行以上的configur,再?zèng)]有報(bào)錯(cuò)。OK,可以進(jìn)行編譯了。
在執(zhí)行make命令時(shí),報(bào)了很多的錯(cuò),其中看到有個(gè):
./libgearman-1.0/gearman.h:53:27: error: tr1/cinttypes: No such file or directory
可以推斷是gcc編譯器的問題,執(zhí)行命令:
yum install gcc44 gcc44-c++ libstdc++44-devel -y
安裝完畢之后執(zhí)行:
CXX=/usr/bin/g++44 CC=/usr/bin/gcc44 CPPFLAGS=-I/usr/local/boost/include LDFLAGS=-L/usr/local/boost/lib ./configure --prefix=/usr/local/gearman --with-mysql --with-sqlite3=no
至此,安裝成功,執(zhí)行以下命令啟動(dòng)(隊(duì)列持久化保存)
/usr/local/gearman/sbin/gearmand -p 4730 -L 0.0.0.0 --log-file=/tmp/gearmand-4730.log --pid-file=/tmp/gearmand-4730.pid -q MySQL --mysql-host=localhost --mysql-user=root --mysql-db=gearman --verbose DEBUG -d
啟動(dòng)時(shí),發(fā)現(xiàn)有報(bào)如下錯(cuò)誤:
/usr/local/gearman/sbin/gearmand: error while loading shared libraries: libboost_program_options.so.1.55.0: cannot open shared object file: No such file or directory
那么很明顯,是由于鏈接文件找不到的緣故所導(dǎo)致的。執(zhí)行如下命令:
vi /etc/ld.so.conf.d/gearman.conf
插入以下內(nèi)容,保存退出
/usr/local/boost/lib/
/usr/local/gearman/lib/
執(zhí)行命令
再次執(zhí)行上面的啟動(dòng)命令,至此即可啟動(dòng)gearmand.
您可能感興趣的文章:- php使用gearman進(jìn)行任務(wù)分發(fā)操作實(shí)例詳解
- python基于json文件實(shí)現(xiàn)的gearman任務(wù)自動(dòng)重啟代碼實(shí)例
- gearman中worker常駐后臺(tái),導(dǎo)致MySQL server has gone away的解決方法
- PHP使用gearman進(jìn)行異步的郵件或短信發(fā)送操作詳解
- gearman + mysql方式實(shí)現(xiàn)持久化操作示例
- gearman管理工具GearmanManager的安裝與php使用方法示例
- PHP并發(fā)多進(jìn)程處理利器Gearman使用介紹
- Gearman::XS在Centos下的編譯安裝方法
- gearman隊(duì)列持久化引發(fā)的問題及解決方法
- gearman的安裝啟動(dòng)及python API使用實(shí)例
- gearman中任務(wù)的優(yōu)先級(jí)和返回狀態(tài)實(shí)例分析