source: gs2-extensions/parallel-building/trunk/src/bin/script/report-hadoop-processes.pl@ 30354

Last change on this file since 30354 was 27006, checked in by jmt12, 11 years ago

A companion script to stop-hadoop-processes that just reports running Hadoop processes. Useful to determine if all compute nodes has launched Hadoop properly. In related news, putting the Hadoop pid files in a shared location results in some compute nodes not launching properly.

  • Property svn:executable set to *
  • Property svn:mime-type set to application/x-perl
File size: 668 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6my $debug = 0;
7
8print "===== Report Hadoop Nodes =====\n";
9
10print " * Searching running processes...\n";
11open(FIN, 'ps ax -o pid,command |') or die($!);
12my $line = '';
13my $found_process = 0;
14while (($line = <FIN>))
15{
16 # Kill import processes
17 if ($line =~ /^\s*(\d+)\s+(.*)java -Dproc_(datanode|jobtracker|namenode|secondarynamenode|tasktracker)/)
18 {
19 my $pid = $1;
20 my $prefix = $2;
21 my $type = $3;
22 print " - Found " . $type . " process: [" . $pid . "]\n";
23 $found_process = 1;
24 }
25}
26close(FIN);
27
28if (!$found_process)
29{
30 print " * No running Hadoop processes found!\n";
31}
32
33print "Complete!\n\n";
34
35exit;
Note: See TracBrowser for help on using the repository browser.