rhel5.7下安装gearmand及启动的方法

所属分类: 脚本专栏 / linux shell 阅读数: 1736
收藏 0 赞 0 分享

本文简述了在rhel5.7下安装gearmand及启动的方法,供大家学习参考!

首先,到官网https://launchpad.net/gearmand/下载gearmand的源码包,传到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安装:

再次执行以上的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 

再次执行上面的启动命令,至此即可启动gearmand.

更多精彩内容其他人还在看

php编译安装常见错误大全和解决方法

这篇文章主要介绍了php编译安装常见错误大全和解决方法,需要的朋友可以参考下
收藏 0 赞 0 分享

Linux base shell重定向详解

这篇文章主要介绍了Linux base shell重定向的相关资料,并用一个简明例子总结了常见用法(在第三节),需要的朋友可以参考下
收藏 0 赞 0 分享

Linux Shell 常见的命令行格式简明总结

这篇文章主要介绍了Linux Shell 常见的命令行格式简明总结,非常实用,需要的朋友可以参考下
收藏 0 赞 0 分享

Shell 命令替换的两种方式

这篇文章主要介绍了Shell 命令替换的两种方式,需要的朋友可以参考下
收藏 0 赞 0 分享

Python创建、删除桌面、启动组快捷方式的例子分享

这篇文章主要介绍了Python创建、删除桌面、启动组快捷方式的例子分享,需要的朋友可以参考下
收藏 0 赞 0 分享

shell基础学习中的字符串操作、for循环语句示例

这篇文章主要介绍了shell基础学习中的字符串操作、for循环语句示例
收藏 0 赞 0 分享

shell脚本中28个特殊字符的作用简明总结

这篇文章主要介绍了shell脚本中28个特殊字符的作用简明总结,需要的朋友可以参考下
收藏 0 赞 0 分享

linux shell流程控制语句实例讲解(if、for、while、case语句实例)

linux shell有一套自己的流程控制语句,其中包括条件语句(if),循环语句(for,while),选择语句(case)。下面我将通过例子介绍下,各个语句使用方法
收藏 0 赞 0 分享

分享一个实用的iptables脚本(各种过滤写法参考)

这篇文章主要介绍了分享一个实用的iptables脚本(各种过滤写法参考),需要的朋友可以参考下
收藏 0 赞 0 分享

shell脚本实现ssh自动登录功能分享

mac下没有找到好用的类似secureCRT,就自己写了个自动登录的脚本,分享一下,如果是新浪的,就基本不用修改代码就直接能用
收藏 0 赞 0 分享
查看更多