Hadoop问题,尝试在hadoop上运行基本的WordCount MapReduce

时间:2018-05-03 01:44:58

标签: hadoop mapreduce hdfs

我在我的Windows 10笔记本电脑上运行hadoop,但我找到了一些关于启动和运行并运行基本字数计划的指南。 hadoop安装似乎很好,因为当我去http://localhost:8088/cluster/apps/NEW时我能看到仪表板,我认为这意味着"集群"正在运行。

作为参考,我这样做只是为了学习它,这就是我使用笔记本电脑和Windows 10的原因。我跟随的指南就在这里:

https://github.com/MuhammadBilalYar/Hadoop-On-Window/wiki/How-to-Run-Hadoop-wordcount-MapReduce-Example-on-Windows-10

一段时间以来运行良好,直到我必须实际提交作业,它转到ResourceManager,我可以在仪表板上看到它但在此处失败并出现非特定错误:

Application application_1525309913796_0001 failed 2 times due to AM Container for appattempt_1525309913796_0001_000002 exited with exitCode: 1
Failing this attempt.Diagnostics: Exception from container-launch.
Container id: container_1525309913796_0001_02_000001
Exit code: 1
Stack trace: ExitCodeException exitCode=1:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:972)
at org.apache.hadoop.util.Shell.run(Shell.java:869)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:1170)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:236)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:305)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:84)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Shell output: 1 file(s) moved.
Container exited with a non-zero exit code 1
For more detailed output, check the application tracking page: http://BertieCoding:8088/cluster/app/application_1525309913796_0001 Then click on links to logs of each attempt.
. Failing the application.

在运行作业之前,我按照说明运行了这些命令:

hadoop fs -mkdir /input_dir
hadoop fs -put C:/input_file.txt /input_dir
hadoop fs -ls /input_dir/
hadoop jar C:/MapReduceClient.jar wordcount /input_dir /output_dir

不幸的是,当我查看我的hadoop安装的日志目录时,它有文件夹/文件,但文件中没有任何内容也看起来不对。

之前有没有人见过这个并知道如何修复它?

哦,如果不明显,我会使用HDFS作为底层框架。我也可以发布该程序的源代码,但它似乎在它甚至无法运行之前就失败了。

1 个答案:

答案 0 :(得分:0)

在您设置JAVA_HOME路径的hadoop-env.cmd文件中,请勿在路径周围使用引号。

例如,我将其设置为:

set JAVA_HOME="C:\java"

但是这样做:

set JAVA_HOME=C:\java

非常简单的修复,造成了很多问题。