rhel5.7下安装gearmand及启动的方法
程序员文章站
2023-11-18 15:51:16
本文简述了在rhel5.7下安装gearmand及启动的方法,供大家学习参考!
首先,到官网https://launchpad.net/gearmand/下载gearma...
本文简述了在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.
下一篇: 实现core文件自动生成配置文件的方法
推荐阅读
-
rhel5.7下安装gearmand及启动的方法
-
Centos 6和Centos 7下服务启动方法及添加到开机启动项的方法
-
ubuntu下安装Python多版本的方法及注意事项
-
Windows下PHP安装路径配置错误导致Apache无法启动的解决方法
-
CentOS下Python3的安装及创建虚拟环境的方法
-
CentOS下编译安装nginx及配置缩略图插件的方法教程
-
linux下安装nodejs及npm的方法
-
ubuntu环境下安装memcache及启动的方法
-
linux下安装Python及Python安装工具包pip的方法
-
centos下docker安装及springboot远程发布docker的方法