一.Gearman
1.Gearman是一个分发任务的程序框架.
2.体系:
a.client:发送一个job
b.server:找到合适的worker,把job交给该worker
c.worker:处理job
二.安装Gearmand服务
1.Gearman
a.官网
http://gearman.org/
b.官网下载:
https://launchpad.net/gearmand
2.安装依赖库
# yum install -y boost boost-devel gperf libevent-devel libuuid-devel
ps:要求boost版本至少大于1.39,系统之前安装的是1.3;所以需要升级
3.升级boost到1.55.0
a.下载boost_1_55_0.tar.bz2
http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.55.0%2F&ts=1385953406&use_mirror=softlayer-ams
b.解压
c. 安装
./bootstrap.sh
./b2
./b2 install
4.安装Gearman
a.解压
b.编译
./configure --prefix=/usr/local/gearmand --with-boost=/usr/local/boost/ --with-boost-libdir=/usr/local/boost/lib
c.make
出现错误:error: cinttypes: No such file or directory
安装:gcc44等
yum install gcc44 gcc44-c++ libstdc++44-devel -y
在/etc/profile中加入
export CC=/usr/bin/gcc44 or export CC=/usr/bin/gcc
export CXX=/u