`
xiaoyu966
  • 浏览: 254645 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

rhel5.7下安装gearmand-1.1.11并启动

阅读更多

============================================================================

原创作品,允许转载。转载时请务必以超链接形式标明原始出处、以及本声明。

请注明转自:http://yunjianfei.iteye.com/blog/

============================================================================       

 

废话不多说,首先,去https://launchpad.net/gearmand/  下载gearmand-1.1.11的源码包,copy到rhel5.7的系统上,并解压。

 

运行configure

[@localhost gearmand-1.1.11]# ./configure --prefix=/usr/local/gearman  --with-mysql --with-sqlite3=no

 

 

报如下错误:

 

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

 

下载boost,并解压(好大个儿。。)

 

./bootstrap.sh --prefix=/usr/local/boost/ 
./b2 install  

 这个过程需要很久,耐心等待即可。参考官网dochttp://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html

 

安装完成之后,回到gearman目录,执行

CPPFLAGS=-I/usr/local/boost/include LDFLAGS=-L/usr/local/boost/lib ./configure --prefix=/usr/local/gearman  --with-mysql --with-sqlite3=no

 报如下错误

checking for gperf... no
configure: error: could not find gperf

 执行yum安装

yum install gperf mysql-devel -y

 

再次执行以上的configur,再没有报错。OK,可以进行编译了。

执行make命令时,报了很多的错,看到有个:

./libgearman-1.0/gearman.h:53:27: error: tr1/cinttypes: No such file or directory

可以推断是gcc编译器的问题,执行命令:

yum install gcc44 gcc44-c++ libstdc++44-devel -y

 安装完毕之后执行:

 

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 

 

 make && make install

 

至此,安装成功,执行以下命令启动(队列持久化保存)

/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
 

 启动时,发现有报如下错误:

/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

 很明显,是因为链接文件找不到的缘故。执行如下命令

vi /etc/ld.so.conf.d/gearman.conf

 插入以下内容,保存退出

/usr/local/boost/lib/
/usr/local/gearman/lib/

 执行命令

ldconfig

 再次执行上面的启动命令,即可启动

0
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics