murshed ahmmad khan (usamurai) on May 1st, 2013
  • Sumo

What is Gearman

Installing Gearman on CentOS 6.2

The latest Gearman version available in the EPEL repository is not always up to date. The latest version of Gearman at this moment is 1.1.6. So, here is the procedure to install the Latest version from source. It’s easy to install but I’ve run into some problems while installing that in an amazon EC2 large instance. So added the troubleshooting parts too.

Install Gearman’s dependencies

Use yum to install the dependencies that Gearman needs:

yum install uuid-devel libuuid libuuid-devel uuid boost-devel libevent libevent-devel

Download the latest gearmand source

Download the latest Gearman version from Launchpad. I’ve picked Gearman 1.1.6

# cd /usr/share/
# wget https://launchpad.net/gearmand/1.2/1.1.6/+download/gearmand-1.1.6.tar.gz

Untar, compile and install

Now unpack it (gearmand version 1.1.6 in this example):

# tar -xvzf gearmand-1.1.6.tar.gz

and then compile and install it:

# cd gearmand-1.1.6

# ./configure && make && make test && make install

That’s all, gearman is installed and ready to use.

Build Troubleshoot:

Unfortunately, for my case it shows couple of errors and then terminated. Here is how I resolved that.

1. While configuring, i’ve got the following error:

checking for the toolset name used by Boost for g++… configure: WARNING: could not figure out which toolset name to use for g++

checking for Boost headers version >= 1.39.0… no
configure: error: cannot find Boost headers version >= 1.39.0

Solution: The reason is either you don’t have the “boost-devel” package installed, but I had already installed it before in the first phase (yum install boost-devel). For my case, it seems that I didn’t install g++ (found in the gcc-c++ package). So Installing the gcc-c++ package fixed the issue. ref: Building Gearman 0.27 on CentOS 6

# yum install gcc-c++

2. Now it proceeds further but throws error while running “make”, while compiling the libhostile.c file:

libhostile/function.c: In function ‘print_function_cache_usage’:
libhostile/function.c:54:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
libhostile/function.c:54:3: note: use option -std=c99 or -std=gnu99 to compile your code
CC libhostile/libhostile_libhostile_la-poll.lo
make[1]: *** [libhostile/libhostile_libhostile_la-function.lo] Error 1
make[1]: *** Waiting for unfinished jobs….
libhostile/poll.c: In function ‘poll’:
libhostile/poll.c:93:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
libhostile/poll.c:93:9: note: use option -std=c99 or -std=gnu99 to compile your code
make[1]: *** [libhostile/libhostile_libhostile_la-poll.lo] Error 1
make[1]: Leaving directory `/usr/share/gearmand-1.1.6′
make: *** [all] Error 2

The solution was hard to find, but as it suggests it is failing because the -std=c99 is required. The libhostile C code requires C99. There are some bug reports for this, but forcing the CFLAGS environment variable will fix this.

Solution: Run ./configure –help, you will see a list of configurable variables.

[.. gearmand-1.1.6]# ./configure –help

Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory

I tried to specify gnu99 library,
# CFLAGS=-std=gnu99 ./configure && make && make test && make install

or you can also use c99, and it works:

# CFLAGS=-std=c99 ./configure && make && make test && make install

ref: libpq configuration on ubuntu

3. Finally I ran into the mysql.h header file missing error while in “make”:

libgearman-server/plugins/queue/mysql/queue.cc:49:19: fatal error: mysql.h: No such file or directory
compilation terminated.

Solution: The solution is simple, i had missing “mysql-devel” package. So installing it solves the problem.

# yum install mysql-devel

so now you can run the gearman as below:

# gearmand -d -u root

Next to code Gearman’s client and worker process you need to install Gearman PHP extension. It’s very easy and straightforward, to do so, please follow this link: Installing Gearman PHP extension on CentOS

Reference:
You might also look into this:
1. Installing Gearman on CentOS 6.2
2. Getting started with Gearman
3. Gearman 0.14 on CentOS 5.5 and PHP bindings

Hope that it’ll help someone.

260 Responses to “Install Gearman daemon from source in CentOS”

  1. that is the finish of this write-up. Here you will find some sites that we believe youll enjoy, just click the hyperlinks over

  2. usually posts some pretty fascinating stuff like this. If youre new to this site

  3. that may be the end of this write-up. Here youll discover some sites that we think youll value, just click the links over

  4. we like to honor many other world wide web web-sites around the internet, even if they arent linked to us, by linking to them. Below are some webpages really worth checking out

  5. very handful of sites that take place to be detailed below, from our point of view are undoubtedly effectively worth checking out

  6. We prefer to honor numerous other web websites around the internet, even when they arent linked to us, by linking to them. Underneath are some webpages worth checking out.

  7. always a big fan of linking to bloggers that I like but dont get a great deal of link really like from

  8. check below, are some totally unrelated web sites to ours, nonetheless, they may be most trustworthy sources that we use

  9. Hi, I do believe this is a great web site.
    I stumbledupon it 😉 I may revisit once again since i have saved
    as a favorite it. Money and freedom is the greatest way to change, may
    you be rich and continue to help other people.

  10. صور سكس محارم

Leave a Reply