Sunday, January 27, 2013

Installing Gearman on Amazon's EC2 Linux AMI


Steps below show how to install Gearman on Amazon Linux AMI. I assume you are logged in as root or you may want to use sudo. 

1. cd /var/tmp;
2. wget https://launchpad.net/gearmand/1.2/1.1.4/+download/gearmand-1.1.4.tar.gz
3. yum install libevent-devel gcc-c++ boost-devel libuuid-devel memcached-devel gperf
4. tar xvzf gearmand-1.1.4.tar.gz
5. cd gearmand-1.1.4
6. ./configure --prefix=/usr
7. sudo make && sudo make install
8. adduser gearmand
9. /usr/sbin/gearmand -u gearmand
10.  pecl channel-update pecl.php.net
11.  pecl install channel://pecl.php.net/gearman-1.1.1
12.  php --ini
13.  echo "extension=gearman.so" >> /etc/php.ini
14.  /etc/rc.d/init.d/httpd restart


Some useful commands:

php --info | grep gear

You may find different versions here and replace it with the wget link above.

Thanks to: http://mysqldba.blogspot.com/2011/05/installing-gearmand-on-amazons-ec2.html

6 comments:

  1. you also need **gperf** package to be available, for gearmand 1.1.9 at least

    ReplyDelete
  2. for this command "yum install libevent-devel gcc-c++ boost-devel libuuid-devel memcached-devel gperf" i get i need root access, but i can't connect as root, just as ec2-user...

    ReplyDelete
  3. I have gone through your blog in details. It is really very relevant and informative..... web design

    ReplyDelete
  4. Thanks for the instructions, they were very helpful. I got an error during installation:

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

    The solution, according to http://www.usamurai.com/2013/05/01/install-gearman-from-source-in-centos/ was to install mysql-devel:

    yum install mysql-devel

    ReplyDelete