hadoop WordCount 运行

配好Eclipse 就去 http://hadoop.apache.org/docs/r1.0.4/mapred_tutorial.html

抄了段代码.

Example: WordCount v1.0

然后 Eclipse 跑一下.

在参数设置 input 和output

hdfs://10.221.62.68:9000/tmp/hadoop-oracli/input

hdfs://10.221.62.68:9000/tmp/hadoop-oracli/output

 

跑了下 出错了 

ecurity.UserGroupInformation: PriviledgedActionException as:Administrator cause:java.io.IOException: Failed to set permissions of path: \tmp\hadoop. ....................

查了下 在mian 里面加了个mapred.job.tracker.

 

		JobConf conf = new JobConf(WordCount.class);
		conf.setJobName("wordcount");
                //add
		conf.set("mapred.job.tracker", "10.221.62.68:9001");
		conf.setOutputKeyClass(Text.class);
		conf.setOutputValueClass(IntWritable.class);

 之后就跑过了.

你可能感兴趣的:(wordcount)