gpt4 book ai didi

hadoop 2.2.0 wordcount prg 无法从远程运行

转载 作者:可可西里 更新时间:2023-11-01 16:16:13 25 4
gpt4 key购买 nike

我无法使用 eclipse 从远程计算机运行 hadoop 2.2.0 中的 wordcount 示例。我构建了可运行的 jar 并使用 >java -jar wordcount.jar 执行。我的驱动类代码如下

Configuration conf = new Configuration();      
Job job = new Job(conf, "wordcount");
conf.set("fs.defaultFS", "hdfs://192.168.117.128:8020/");
conf.set("hadoop.job.ugi", "root");
conf.set("mapred.job.tracker", "192.168.117.128:8021");
Path inputPath = new Path("/input/FB_Bank_Comments_abi_required_original.txt");
Path outputPath = new Path("/output/wordcount"+System.currentTimeMillis());
job.setJobName("wordcount_analysis");
job.setJarByClass(Map.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
FileInputFormat.addInputPath(job, inputPath);
FileOutputFormat.setOutputPath(job, outputPath);
job.waitForCompletion(true);

我收到以下错误

Exception in thread "main" java.lang.NullPointerException
at java.lang.ProcessBuilder.start(Unknown Source)
at org.apache.hadoop.util.Shell.runCommand(Shell.java:404)
at org.apache.hadoop.util.Shell.run(Shell.java:379)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:678)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:661)
at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:639)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:435)
at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:277)
at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:125)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:344)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1268)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1265)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1286)
at org.myorg.WordCount.main(WordCount.java:69)

我错过了什么?任何帮助将不胜感激

最佳答案

我遇到了同样的错误。最终我找到了原因。输出目录已经存在。我把输出目录删了再运行后就成功了。

关于hadoop 2.2.0 wordcount prg 无法从远程运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20633503/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com