windows下eclipse远程连接hadoop集群开发mapreduce
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了windows下eclipse远程连接hadoop集群开发mapreduce,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含6184字,纯文字阅读大概需要9分钟。
内容图文
![windows下eclipse远程连接hadoop集群开发mapreduce](/upload/InfoBanner/zyjiaocheng/1303/85d73f96e48e4101b9b8f87b0506f060.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045614573.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045614843.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045614990.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045615540.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045615920.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045616311.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045617194.jpg)
![技术分享](/upload/getfiles/default/2022/11/7/20221107045617338.jpg)
liang ni hao ma
wo hen hao
ha
qwe
asasa
xcxc vbv xxxx aaa eee
package com.hadoop.example1; import java.io.IOException; import java.util.Iterator; import java.util.StringTokenizer; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.FileInputFormat; import org.apache.hadoop.mapred.FileOutputFormat; import org.apache.hadoop.mapred.JobClient; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.MapReduceBase; import org.apache.hadoop.mapred.Mapper; import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapred.TextInputFormat; import org.apache.hadoop.mapred.TextOutputFormat; public class WordCount { public static class Map extends MapReduceBase implements Mapper<LongWritable, Text, Text, IntWritable> { privatefinalstatic IntWritable one = new IntWritable(1); private Text word = new Text(); publicvoid map(LongWritable key, Text value, OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException { String line = value.toString(); StringTokenizer tokenizer = new StringTokenizer(line); while (tokenizer.hasMoreTokens()) { word.set(tokenizer.nextToken()); output.collect(word, one); } } } publicstaticclass Reduce extends MapReduceBase implements Reducer<Text, IntWritable, Text, IntWritable> { publicvoid reduce(Text key, Iterator<IntWritable> values, OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException { int sum = 0; while (values.hasNext()) { sum += values.next().get(); } output.collect(key, new IntWritable(sum)); } } publicstaticvoid main(String[] args) throws Exception { JobConf conf = new JobConf(WordCount.class); conf.setJobName("wordcount"); conf.setOutputKeyClass(Text.class); conf.setOutputValueClass(IntWritable.class); conf.setMapperClass(Map.class); conf.setCombinerClass(Reduce.class); conf.setReducerClass(Reduce.class); conf.setInputFormat(TextInputFormat.class); conf.setOutputFormat(TextOutputFormat.class); FileInputFormat.setInputPaths(conf, new Path(args[0])); FileOutputFormat.setOutputPath(conf, new Path(args[1])); JobClient.runJob(conf); } }
![技术分享](/upload/getfiles/default/2022/11/7/20221107045617487.jpg)
14/05/29 13:49:16 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 14/05/29 13:49:16 ERROR security.UserGroupInformation: PriviledgedActionException as:ISCAS cause:java.io.IOException: Failed to set permissions of path: \tmp\hadoop-ISCAS\mapred\staging\ISCAS1655603947\.staging to 0700 Exception in thread "main" java.io.IOException: Failed to set permissions of path: \tmp\hadoop-ISCAS\mapred\staging\ISCAS1655603947\.staging to 0700 at org.apache.hadoop.fs.FileUtil.checkReturnValue(FileUtil.java:691) at org.apache.hadoop.fs.FileUtil.setPermission(FileUtil.java:664) at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:514) at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:349) at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:193) at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:126) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:942) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Unknown Source) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190) at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936) at org.apache.hadoop.mapreduce.Job.submit(Job.java:550) at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580) at org.apache.hadoop.examples.WordCount.main(WordCount.java:82)
private static void checkReturnValue(boolean rv, File p, FsPermission permission) throws IOException { /** * comment the following, disable this function if (!rv) { throw new IOException("Failed to set permissions of path: " + p + " to " + String.format("%04o", permission.toShort())); } */ }
![技术分享](/upload/getfiles/default/2022/11/7/20221107045618282.jpg)
原文:http://www.cnblogs.com/liangjf/p/7710789.html
内容总结
以上是互联网集市为您收集整理的windows下eclipse远程连接hadoop集群开发mapreduce全部内容,希望文章能够帮你解决windows下eclipse远程连接hadoop集群开发mapreduce所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。