hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Teng, James" <xt...@ebay.com>
Subject RE: Job progress not showing in Hadoop Tasktracker web interface
Date Wed, 20 Jul 2011 05:11:38 GMT
You can't run a hadoop job in eclipse, you have to set up an environment on linux system. Maybe
you can try to install it on WMware linux system and run the job in pseudo-distributed system.

James, Teng (Teng Linxiao)
eRL,   CDC,    eBay,    Shanghai
Extension:        86-21-28913530
MSN:     tenglinxiao@hotmail.com
Skype:                James,Teng
Email:            xteng@ebay.com
-----Original Message-----
From: foo_foo_foo [mailto:finallyanid@gmail.com] 
Sent: Wednesday, July 20, 2011 10:05 AM
To: core-user@hadoop.apache.org
Subject: Job progress not showing in Hadoop Tasktracker web interface

I am a Hadoop novice so kindly pardon my ingorance.

I am running the following Hadoop program in Fully Distributed Mode to count
the number of lines in a file. I am running this job from eclipse and I see
it running (based on the output to the eclipse console) but I do not see the
tasks in the TaskTracker web interface. Also eventhough the data is
distributed accross multiple hosts it doesnt seem to be distributing works
accross hosts.

Could someone pelase help me with this.

	package LineCount;

	import java.util.*;
	import java.io.*;

	import org.apache.hadoop.mapreduce.Mapper;
	import org.apache.hadoop.mapreduce.Reducer;
	import org.apache.hadoop.mapreduce.Job;
	import org.apache.hadoop.io.*;
	import org.apache.hadoop.conf.*;
	import org.apache.hadoop.fs.Path;
	import org.apache.hadoop.mapreduce.lib.input.*;
	import org.apache.hadoop.mapreduce.lib.output.*;
	import org.apache.hadoop.util.*;

	public class LineCount extends Configured implements Tool {

		public static class Map extends Mapper<LongWritable,Text,Text,IntWritable>
			private static int counter = 1;
			private static Text mapOpKey = new Text();
			private final static IntWritable mapOpValue = new IntWritable(1);
			public void map(LongWritable mapInpKey, Text mapInpValue,
Mapper<LongWritable,Text,Text,IntWritable>.Context context) throws
					System.out.println("Calling Map "+ counter);
					mapOpKey.set("Number Of Lines");
					context.write(mapOpKey, mapOpValue);
		public static class Reduce extends
Reducer<Text,IntWritable,Text,IntWritable> {
			private static int counter = 1;
			public void reduce(Text redIpKey, Iterable<IntWritable> redIpValue,
Reducer<Text,IntWritable,Text,IntWritable>.Context context) throws
IOException,InterruptedException {
				int sum=0;
				System.out.println("Calling Reduce "+ counter);
					sum = sum + redIpValue.iterator().next().get();		
				context.write(redIpKey, new IntWritable(sum));
		public int run(String[] args) throws Exception{

			Configuration conf = new Configuration();
			conf.addResource(new Path("/hadoop-0.20.2/conf/core-site.xml"));
			Job job = new Job(conf);
			FileInputFormat.setInputPaths(job, new Path("/usr/foo/hadoopIP"));
			FileOutputFormat.setOutputPath(job, new Path("/usr/foo/hadoopOP"));
			return 0;
		public static void main(String[] args) throws Exception{
			ToolRunner.run(new LineCount(), args);

View this message in context: http://old.nabble.com/Job-progress-not-showing-in-Hadoop-Tasktracker--web-interface-tp32096156p32096156.html
Sent from the Hadoop core-user mailing list archive at Nabble.com.

View raw message