centos安装gearman

centos安装gearman

post by rocdk890 / 2012-8-4 1:11 Saturday linux技术
发表评论
 
今天公司让我在服务器上安装gearman,服务器环境是lamp,那gearman是什么?其实这个gearman是一个处理分布式过程通信的健壮系统.它提供了一个通用的应用程序框架,主要用来把任务转发给到其他机器或进程.使用Gearman 能让程序实现并行工作、负载均衡和跨语言调用.它能够用于不同类型的应用程序,从高可用的web站点到数据库复制传输.
系统:centos 5.5
需要的软件包:boost_1_50_0.tar.gz gearman-1.0.2.tgz gearmand-0.34.tar.gz
1.安装boost
如果不安装boost的话,是安装不上gearmand和gearman的.
wget -c http://download.slogra.com/gearman/boost_1_50_0.tar.gz
tar zxf boost_1_50_0.tar.gz && cd boost_1_50_0
./bootstrap.sh --prefix=/usr/local/boost
点击查看原图
如出现上图,则输入命令:
./b2 install
这一步安装等待的时间比较久,各位可以去喝个茶,休息休息下.
点击查看原图
如没有问题,在/etc/profile里的最下方加入:
export CPPFLAGS=-I/usr/local/boost/include
export LDFLAGS=-L/usr/local/boost/lib
保存退出后运行
source /etc/profile
好了,boost就安装成功了.

2.安装gearmand
wget -c http://download.slogra.com/gearman/gearmand-0.34.tar.gz
tar zxf gearmand-0.34.tar.gz && cd gearmand-0.34
./configure --prefix=/usr/local/gearman

如果出现configure: error: Unable to find libevent,则输入命令:
yum -y install libevent libevent-devel
然后重新configure.
没有问题后再执行
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
然后在环境变量里加入:
export CC=/usr/bin/gcc44 or export CC=/usr/bin/gcc
export CXX=/usr/bin/g++44
保存退出后执行:
source /etc/profile
删除gearmand-0.34文件夹重新进行编译.
重新进行编译后执行make这步,如图
点击查看原图
没有报错的话才能继续执行
make install
如果没有报错的话,那么恭喜你可以继续安装gearman了.

3.安装gearman
gearman是要整合到php中,所以你必须得有lamp环境.我服务器上已经有lamp环境,所以接下来就直接进行安装.
wget -c http://download.slogra.com/gearman/gearman-1.0.2.tgz
tar zxf gearman-1.0.2.tgz && cd gearman-1.0.2
/usr/local/php/bin/phpize
./configure --with-gearman=/usr/local/gearman/ --with-php-config=/usr/local/php/bin/php-config
make && make install
没有报错的话,去php.ini添加扩展语句
vi /etc/php.ini
extension=gearman.so
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"

重启httpd
service httpd restart
好了,到此就全部安装成功.

转载于:https://www.cnblogs.com/weixiahzixia/p/3853494.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值