在hadoop2.4.1伪分布环境中,用MyEclipse10和相应的插件,运行hadoop自带的WordCount程序,先前出现”/bin/bash: line 0: fg: no job control",按照论坛里的方法重新编译了YARNRunner类,然后就总是出现以下错误:
用了各种方法,比如在mapred-site.xml和yarn-site.xml中设置“mapreduce.application.classpath"属性,但都没有解决上述问题,请问哪位可以帮忙解决一下。WordCount程序中的main方法如下:
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
conf.set("mapreduce.framework.name", "yarn");
conf.set("yarn.resourcemanager.address", "10.35.1.177:8032");
args=new String[2];
args[0]="hdfs://10.35.1.177:9000/test/aa";
args[1]="hdfs://10.35.1.177:9000/test/output";
String[] otherArgs = new GenericOptionsParser(conf, args)
.getRemainingArgs();
if (otherArgs.length != 2) {
System.err.println("Usage: wordcount <in> <out>");
System.exit(2);
}
Job job = new Job(conf, "word count");
job.setJarByClass(WordCount.class);
job.setMapperClass(TokenizerMapper.class);
job.setCombinerClass(IntSumReducer.class);
job.setReducerClass(IntSumReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
|