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 |
|
---|
3 | use strict;
|
---|
4 | use warnings;
|
---|
5 |
|
---|
6 | my $debug = 0;
|
---|
7 |
|
---|
8 | print "===== Report Hadoop Nodes =====\n";
|
---|
9 |
|
---|
10 | print " * Searching running processes...\n";
|
---|
11 | open(FIN, 'ps ax -o pid,command |') or die($!);
|
---|
12 | my $line = '';
|
---|
13 | my $found_process = 0;
|
---|
14 | while (($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 | }
|
---|
26 | close(FIN);
|
---|
27 |
|
---|
28 | if (!$found_process)
|
---|
29 | {
|
---|
30 | print " * No running Hadoop processes found!\n";
|
---|
31 | }
|
---|
32 |
|
---|
33 | print "Complete!\n\n";
|
---|
34 |
|
---|
35 | exit;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.