[padb] r421 committed - Add support for using clush as a backend launcher....

padb at googlecode.com padb at googlecode.com
Fri Dec 3 18:01:29 GMT 2010


Revision: 421
Author: apittman at gmail.com
Date: Fri Dec  3 10:00:39 2010
Log: Add support for using clush as a backend launcher.
This is similar to the pdsh support but uses clush instead.
http://sourceforge.net/projects/clustershell/

The mechanism for launch is the same as pdsh so presumably the performance
is the same at scale, it might suit some people to use clush rather than
pdsh though.  Pdsh will still be used in preference but clush will be
selected if pdsh cannot be found or if the user selects it.

http://code.google.com/p/padb/source/detail?r=421

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Sun Nov 28 13:43:33 2010
+++ /trunk/src/padb	Fri Dec  3 10:00:39 2010
@@ -575,7 +575,7 @@

  $conf{tree_width} = '4';

-$conf{launch_mode} = 'local,rmgr,ssh,pdsh';
+$conf{launch_mode} = 'local,rmgr,ssh,pdsh,clush';

  # Config options which take boolean values.
  my @conf_bool = qw(watch_clears_screen inner_callback);
@@ -3753,7 +3753,8 @@
          @hosts = @{ $pcmd{host_list} };
      }

-    my $have_pdsh = find_exe('pdsh');
+    my $have_pdsh  = find_exe('pdsh');
+    my $have_clush = find_exe('clush');

      foreach my $mode (@modes) {
          if ( $mode eq 'local' ) {
@@ -3791,12 +3792,25 @@

              return %pcmd;

+        } elsif ( $mode eq 'clush' ) {
+            next unless ($have_clush);
+            next if ( @hosts == 0 );
+
+            my $fanout = @hosts + 5;
+
+            $pcmd{require_inner_callback} = 1;
+            my $hlist = join q{,}, @hosts;
+            $pcmd{command} = "clush -f $fanout --nostdin -w $hlist";
+
+            return %pcmd;
+
          } else {
              print "Backend invalid: $mode\n";
          }
      }

-    print "No suitable backend found (perhaps try installing pdsh?)!\n";
+    print
+      "No suitable backend found (perhaps try installing pdsh or  
clush ?)!\n";
      return;

  }




More information about the padb-devel mailing list