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: http://gearman.org/.

Here are the instructions on installing Gearman on Ubuntu



wget http://launchpad.net/gearmand/trunk/0.9/+download/gearmand-0.9.tar.gz
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
./configure
make
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: libgearman.so.1

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: libgearman.so.1." To fix this,
either add `/usr/local/lib` to `LD_LIBRARY_PATH`, or modify `/etc/ld.so.conf` or
`/etc/ld.so.conf.d` to add `/usr/local/lib`, then run: sudo ldconfig

3 comments:

  1. Anonymous3:55 AM

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

    Solved by :
    sudo ldconfig

    ReplyDelete
  2. Anonymous9:59 AM

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

    sudo gearmand -u root

    ReplyDelete
  3. Anonymous11:18 AM

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

    ReplyDelete