Yarn MapReduce 作业死于奇怪的消息

Yarn MapReduce job dies with strange message

我有 Hadoop-Yarn 集群,当我尝试 运行 hadoop 示例时,我在容器日志中收到奇怪的错误消息:

Error: Could not find or load main class 1638

我的 Java 版本是:

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

运行 主服务器上的服务:

593 NodeManager
373 SecondaryNameNode
745 JobHistoryServer
507 ResourceManager
129 NameNode
240 DataNode

运行 从服务器上的服务:

51 DataNode
136 NodeManager
351 Jps

我执行以下命令:

bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar grep input/hadoop output 'dfs[a-z.]+'

并得到这个异常:

15/05/13 13:35:31 INFO mapreduce.Job: Running job: job_1431538391289_0005
15/05/13 13:35:37 INFO mapreduce.Job: Job job_1431538391289_0005 running in uber mode : false
15/05/13 13:35:37 INFO mapreduce.Job: map 0% reduce 0%
15/05/13 13:35:37 INFO mapreduce.Job: Job job_1431538391289_0005 failed with state FAILED due to: Application application_1431538391289_0005 failed 2 times due to AM Container for appattempt_1431538391289_0005_000002 exited with exitCode: 1
For more detailed output, check application tracking page:http://namenode:8088/proxy/application_1431538391289_0005/Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_1431538391289_0005_02_000001
Exit code: 1
Stack trace: ExitCodeException exitCode=1: 
at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
at org.apache.hadoop.util.Shell.run(Shell.java:455)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

你能帮我解决这个问题吗

而不是

<property>
    <name>yarn.app.mapreduce.am.command-opts</name>
    <value>819</value>
</property>

需要

<property>
    <name>yarn.app.mapreduce.am.command-opts</name>
    <value>-Xmx819m</value>
</property>

检查配置的 RAM 大小,必要时增加。我的 VM 也有同样的问题,只是发现它配置的内存太少 (1G)。