Playing with Gearman

This was written in September 2009 when the current version of Gearman was 0.9.
Thanks to Eric Day for answering my dumb questions along the way.



To get started, install Gearman. I am on Debian, so this is what I installed:

% apt-get install gearman gearman-job-server gearman-tools libgearman1 libgearman-dev libdrizzle-dev


Enable Gearman in /etc/default/gearman-server


Set up Gearman to use MySQL for its persistent queue store in /etc/default/gearman-job-server

PARAMS="-q libdrizzle --libdrizzle-host=127.0.0.1 --libdrizzle-user=gearman \
--libdrizzle-password=your_pw --libdrizzle-db=gearman \
--libdrizzle-table=gearman_queue --libdrizzle-mysql"

% mysqladmin create gearman

% mysql
mysql> create USER gearman@localhost identified by 'your_pw';
mysql> GRANT ALL on gearman.* to gearman@localhost;


** Careful, if you are running MySQL using --old-passwords this won't work with libdrizzle.
You will need to get the 41-char password hash with a little snippet of PHP that does
the double sha1 encoding:

% php -r "echo '*'.strtoupper(sha1(sha1('your_pw',true)));"

% mysql
mysql> UPDATE mysql.user set Password='above_output' where User='gearman';

% mysqladmin flush-privileges


Continue reading "Playing with Gearman"
 •  0 comments  •  flag
Share on Twitter
Published on September 24, 2009 14:57
No comments have been added yet.


Rasmus Lerdorf's Blog

Rasmus Lerdorf
Rasmus Lerdorf isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Rasmus Lerdorf's blog with rss.