Tag Archives: distributed computing

Starting gearmand deamon

Getting the gearmand deamon running. Should be simple work, yet, as with a lot of thing in the software world, it’s not quite that simple. My first attempt to start up gearmand failed with the following error:

Corsa-3:~ root# gearmand
Error creating socket: IO::Socket::INET: Address already in use
Corsa-3:~ root#

Now, I’m not sure why that would be the case, since I checked the system process list and did NOT see any other instance of gearman executing (if you are not sure what you are looking at, the only thing found matching gearman, was the grep against the process list itself, not what I’m looking for)

Corsa-3:~ root# ps -ealf | grep gearman
0 33324 32942 4006 0 31 0 2425520 168 - R+ 5bb5a80 ttys000 0:00.00 grep gearman 0:00.00

A check of netstat did not reveal a listener on either of the known gearman ports (7003 or the new official port: 4730 ).

** TO BE COMPLETED **

Installing Gearman APIs for JAVA and PERL


Following yesterday’s marathon package installation ‘experiment’, today I started to acquire and install the Client/Worker API modules.

JAVA – installing gearman-java-0.03.jar

Java modules can be located on the downloads page for Gearman. It is also available at the Launchpad page for Gearman. I selected the code from the gearman.org site to try first, which ended up directing me to: https://launchpad.net/gearman-java.

I downloaded all three available files:

  • gearman-java-0.03.jar
  • geareman-java-0.03-javadocs.jar
  • gearman-java-0.03-src.tar.gz

Once downloaded, I moved all three files, and the original gearmand-C source to my Development directory.

PERL – installing Gearman::XS

For the PERL implementation, I’m going with the PERL wrapper, around the core gearman C libraries. I’d rather leverage as much C as possible. The focus for me is on speed.
It is available via CPAN under Gearman::XS.

Installing PERL packages is generally pretty painless.


#root:  cpan Gearman::XS
[...]
Running install for module 'Gearman::XS'
Running make for D/DS/DSCHOEN/Gearman-XS-0.8.tar.gz
Fetching with LWP:
http://www.perl.org/CPAN/authors/id/D/DS/DSCHOEN/Gearman-XS-0.8.tar.gz
[...]
Writing /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/Gearman/XS/.packlist
Appending installation info to /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level/perllocal.pod
DSCHOEN/Gearman-XS-0.8.tar.gz
/usr/bin/make install  -- OK

With the installation completed, I wrote and executed a very simple script, to test PERL’s ability to locate the new module.


#!/usr/bin/perl -w
use strict;
use Gearman::XS qw(:constants);
use Gearman::XS::Client;

print “\nLoaded and ran fine\n”;
exit 0;

This was the result:

david$ ./gtest0.pl

Loaded and ran fine

Installation of the PERL module Gearman::XS was successful.


NOTE: This is part of a series of posts, centered around installation and evaluation of Gearman as a distributed scheduling product. Here are the other articles in this group:

Installing GEARMAN on MAC OSX 10.6


So, today I set about installing gearmand on my laptop, to test out some massively distributed computing ideas I’m working on. Turns out, it’s not just a matter of downloading the .dmg file and hitting ‘RUN’. Nope.. you better have 1/2 a pot of coffee and your copy of XCode installed on the machine or you are dead in the water.

Actually, you’re going to need more than that, if you are working with a vanilla Snow Leopard install.

Step 1 – install XCode:

But first things first. You can download XCode from the Apple website, or you can install it from your ‘Extras’ folder on the OS disk. I did the later, since the distro is pretty big, something like 600MB. Get that done first.

Step 2 – install MacPorts:

Now this is where the fun begins. Now, if you followed my other blog page on installing MacPorts, you can move onto Step 3. If you have not, then, proceed at hast to installing it (follow this link too).

Step 3 – install libevent

If you enjoyed installing MacPorts, you are going to LOVE this! 🙂 Now, the step of building libevent from source, probably not *required* but, after three installs that were not picked up by the gearmand, I though I’d just, do this the old fashioned way too. I have a writeup for installing libevent here (link to my page).

Step 3 – install wget

wget. How I love you, let me count the ways… MANY. wget is great. It’s a non-interactive text web client. Some of the cool things that wget can do, is recursively traverse a page, grabbing all the content, images, links pages (and their images, objects etc.). It’s also almost impossible to compromise with conventional XSS or other tricky DOM / JavaScript methods. No drive-by downloads here folks!

So, go ahead and get wget installed, because it’s going to be used to reach the final objective, retrieving gearman.

#root: port install wget

For me, on my lousy ComCrap connection, it took me a fairly long time. I think it’s safe to say, run the install command, and walk away. Check back in 10-15 minutes, see if it’s done. How will you konw if it worked? Simple, if you download the file in Step 5, it worked.

Step 5 – Finally, download and extract the Gearman bundle

This is where wget comes into play. Make sure you are in the directly you want. I suggest /opt. And execute the wget command to grab the distro. NOTE: The current distribution might be later than this (higher number). A check of the Gearman main site will probably give you the number you need, if this is not the latest and greatest:

#root: wget http://launchpad.net/gearmand/trunk/0.12/+download/gearmand-0.12.tar.gz
#root: gunzip gearmand-0.12.tar.gz,
#root: tar xvf gearmand-0.12.tar

Step 6 – BUILD!

Build the package. This part is the simplest of all the steps.

#root: ./configure
#root: make
#root: make install

YOU ARE DONE (installing that is)

Next article, will be a writeup on how to use Gearman, some time in the next week.


NOTE: This is part of a series of posts, centered around installation and evaluation of Gearman as a distributed scheduling product. Here are the other articles in this group: