---
title: "Gearman框架的研究(二)"
author: "prettyzhou"
date: "2013-04-25T16:04:50Z"
tags: []
categories: ["企业架构"]
slug: "gearman"
draft: false
lastmod: "2013-04-27T14:47:31Z"
id: 1853546
url: "https://prettyzhou.iteye.com/blog/1853546"
---

Gearman在Linux上环境搭建以及注意事项

 

本文只陈述gearman框架的搭建过程，相关的知识点可以去http://gearman.org

  

&lt;!--\[if !supportLists]--&gt;1.  Linux版本以及Gearman版本

分别在Centos 6.3和Ubuntu12.04上部署Gearman环境,Gearman此处下载的为gearmand-1.1.6.tar.gz版本

&lt;!--\[if !supportLists]--&gt;2.    &lt;!--\[endif]--&gt;安装步骤:

(1).**sudo apt-get install gearman-job-server        //Ubuntu12.04**

**yum install gearmand-server                   //Centos**

**通过apt-get的方式肯能比较费时间，并且安装的不是最新版本的**

**也可以下载下来tar包直接进行安装**

```
tar xzf gearmand-X.Y.tar.gz
```

```
cd gearmand-X.Y
```

```
./configure
```

```
Make
```

```
make install
```

(2).安装过程可能遇到的问题

could not find toolset name:

需要安装gcc-c++，yum install gcc-c++

cannot find Boost headers version &gt;= 1.39.0 需要安装boost-devel-1.41.0，

yum install boost-devel-1.41.0

yum install libevent-devel

(ubuntu解决方法为:

sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent)

 

 

make的时候报的-std=c99错误：

gedit Makefile   //在2053行处加上 –std=c99

&lt;!--\[if !supportLists]--&gt;3.    &lt;!--\[endif]--&gt;(1).启动Gearman

geramand –d

(2). 启动过程可能遇到的问题

启动过程中会报找不到日志文件的错误:

can not find /usr/local/var/log/gearman.log

解决方法:

建立相应的文件目录:sudo mkdir /usr/local/var/log

并将此文件的权限设为777：sudo chmod 777 –R /usr/local/var/log/