Friday, August 07, 2009

Installing Gearman on Ubuntu

Gearman is a open source job forking system. We have been evaluating its use in our project to share jobs across components. More info on the Gearman project can be found here:

Here are the instructions on installing Gearman on Ubuntu

tar -xvzf gearmand-0.9.tar.gz

# two missing libraries that found at configure time
sudo apt-get install libevent-dev
sudo apt-get install uuid-dev

cd gearmand-0.9
sudo make install
sudo ldconfig

# start gearman
gearmand &

# check gearmand running
ps auxw | grep [g]earmand

# check germand listening for jobs on tcp port 4730
sudo lsof -i tcp:4730

# errors when starting gearman
Error: gearman: error while loading shared libraries:

Solution: `make install` may install libraries into `/usr/local/lib`. It's possible
that this directory isn't on your library search path, which will result in an error
like: "gearman: error while loading shared libraries:" To fix this,
either add `/usr/local/lib` to `LD_LIBRARY_PATH`, or modify `/etc/` or
`/etc/` to add `/usr/local/lib`, then run: sudo ldconfig


  1. Anonymous3:55 AM

    Was getting error:
    "gearmand: error while loading shared libraries: cannot open shared object file: No such file or directory"

    Solved by :
    sudo ldconfig

  2. Anonymous9:59 AM

    I was getting an error "gearmand: command not found", so had to run as root:

    sudo gearmand -u root

  3. Anonymous11:18 AM

    sudo ldconfig
    I can confirm this fixes the problem - ubuntu 11.04 natty