温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

rhel5.7下如何安装及启动gearmand

发布时间:2021-09-30 14:09:45 来源:亿速云 阅读:115 作者:iii 栏目:开发技术

本篇内容介绍了“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.

“rhel5.7下如何安装及启动gearmand”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI