views:

240

answers:

7

Anyone have suggestions for deployment methods for Perl modules to a share nothing cluster?

Our current method is very manual.

  1. Take down half the cluster
  2. Copy Perl modules ( CPAN style modules ) to downed cluster members
  3. ssh to each member and run perl Makefile.pl; make ; make install on each module to be installed
  4. Confirm deployment
  5. In service the newly deployed cluster members, out of service the old cluster members and repeat steps 2 -> 4

This is obviously far from optimal, anyone have or know of good tool chains for deploying Perl modules to a shared nothing cluster?

+4  A: 

Take one node offline, install Perl, and then use it to reimage the other nodes.

At least, that's how I imagine you'd want to install software in a shared-nothing cluster. Perl is just the application you happen to be installing.

Michael Carman
+2  A: 

I have, in the past, developed a Perl program which used the Expect module (from CPAN) to automate basically the process you described, automatically sshing to each host, copying any necessary files, and performing the installations. Unfortunately, this was developed on-site for a client, so I do not have access to the code to share. If you're familiar with Expect, it shouldn't be too difficult to set up, though.

Dave Sherohman
A: 

I am not sure exactly what a share nothing cluster is, but if it uses some base *nix system like Fedora, Mandriva, or Ubuntu. Many of the perl modules are precompiled for specific architectures. You can easily run these.

If these systems are of the same arch you can do as someone else said and just copy the compiled modules from system to system, just make sure you have all of the dependancies as well on the recipient system.

J.J.
+2  A: 

We currently have a clustered Perl application that does data processing. We also have numerous CPAN modules and modules that we've developed that the software depends on. When you say 'shared nothing', I'm assuming you're referring to things like NFS mounts.

If the machines have identical configurations, then you may be able to build your entire application into a single directory structure (eg: /opt/my-app), tar it up and that could be come the only thing you need to push to the boxes.

As far as deploying it to the boxes, you might be able to use Capistrano. We developed a couple of our own cluster utilities that piggybacked off of ssh - I've released one form of that utility: parallel-jobs. Its README shows an example of executing multiple parallel ssh commands. It's a small step to extend that program to be able to know about your cluster and then be able to execute the same command across the cluster (as opposed to a series of different commands).

Kyle Burton
+3  A: 

Assuming all the machines are identical, you should be able to keep one canonical installation, and use rsync or something to keep the others in updated.

Dan
+1  A: 

Capistrano is a tool that allows you to run commands on a group of servers; it is perfectly suited to making your task considerably easier.

Further down the line of automation, but also complexity, is Puppet that allows you do define a group of servers, give them roles and then push out sets of code to every machine subscribing to a certain role.

Drew Stephens
+2  A: 

If you are using Debian or Ubunto OS you could package your Perl modules - I have open sourced some code to help with this: Perl module builder it's still very rough but does work and can be made to work on your own code as well as CPAN modules, this then makes deployment much easier.

There is also project to get RedHat rpms for all of CPAN, Dave Cross gave a talk Perl in RPM-Land which may be of use.

If you are on some other system which doesn't have packaging then the rsync option (install on one machine and then rsync to the others) should work as well, note you can mount a windows share and rsync to it across unix if needed.

Using a central manager like Puppet makes creating and maintaining machines in a cluster a lot easier to manage, from installing code to managing users and email configuration. There is also a Perl project in the pipeline to do something similar but this has not been made public yet.

Ranguard