由于来自容器启动的AM容器异常,无头环境中的MapReduce作业失败N次 [英] MapReduce job in headless environment fails N times due to AM Container exception from container-launch
问题描述
当在MacOSX的无头环境中运行map reduce作业时(例如,当以特定用户的身份运行作业时),我得到以下异常或类似的东西......
When running a map reduce job in a headless environment in MacOSX (e.g., when running jobs when ssh'ed as a particular user), I get the following exception or something like it…
2013-12-04 15:08:28,513 WARN org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger: USER=hadoop OPERATION=Application Finished - Failed TARGET=RMAppManager RESULT=FAILURE DESCRIPTION=App failed with state: FAILED PERMISSIONS=Application application_1386194876944_0001 failed 2 times due to AM Container for appattempt_1386194876944_0001_000002 exited with exitCode: 1 due to: Exception from container-launch:
org.apache.hadoop.util.Shell$ExitCodeException:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:464)
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.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:283)
这不是权限问题(其他地方提出的问题)或缺少目录。
If instead, I log in as that user, the error does not occur and the MR job runs to conclusion, while a Java icon labeled "MRAppMaster" pops up in the dock.
但我不知道如何影响最后一次违规访问根窗口的企图。
I have narrowed this down to the ResourceManager starting a Java process without passing along the -Djava.awt.headless=true
. When this occurs in a headless environment, the JVM does not have permission to display in the root window. This has showed up in a number of other circumstances, and I've corrected each.
我添加了 -Djava。 awt.headless = true
选项添加到以下内容:
This is not a question of permissions (something suggested elsewhere) or missing directories.
- hadoop-env.sh中的HADOOP_OPTS
- mapred-env.sh中的HADOOP_JOB_HISTORYSERVER_OPTS
中的YARN_OPTS yarn-env.sh - yarn-env.sh中的YARN_RESOURCEMANAGER_OPTS(尽管
可能会复制mapred-site.xml中的YARN_OPTS - mapred。{map | reduce} .child.java.opts
和mapred.child.java.opts
But I'm at a loss as to how to affect the last of the offending attempts to access the root window without permission.
我错过了什么?我可以更好地将它添加到我的Java选项中吗?
I have added the -Djava.awt.headless=true
option to the following:
FYI,这仅仅是一个Mac OS X 10.8.5上的伪集群设置,运行Hadoop 2.2.0,使用Java 1.6.0_65-b14从Apache下载。我没有使用Homebrew或任何其他分配。我正在用WordCount示例测试伪群集。
- HADOOP_OPTS in hadoop-env.sh
- HADOOP_JOB_HISTORYSERVER_OPTS in mapred-env.sh YARN_OPTS in yarn-env.sh
- YARN_RESOURCEMANAGER_OPTS in yarn-env.sh (although that probably duplicates the YARN_OPTS
- mapred.{map|reduce}.child.java.opts and mapred.child.java.opts in mapred-site.xml
谢谢。
好的。 Mea culpa。我终于找到了所有要添加的设置...搜索 mapred-default.xml 配置说明。
这里是原地...
Thanks.
我也试图通过将参数添加到/ etc / profile中的_JAVA_OPTIONS来实现同样的目的。 Java运行它,除了运行MRAppMaster !!!
Ok. Mea culpa. I finally found all the settings to add… Search for all of the "opt" entries in the mapred-default.xml configuration instructions.
希望这有助于其他人。
这个问题是由于YARN使用不同的路径来执行,
检查java的硬编码路径是/ bin / java,但如果您的Java可执行文件没有/ bin / java,则YARN作业将失败。像在OSX中一样,我的Java 1.7运行在/ usr / bin / java中,如下所示:
$java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
To solve this problem in OSX I created a link from /bin/java to /usr/bin/java as below:
为了在OSX中解决这个问题,我创建了一个从/ bin / java到/ usr / bin / java的链接如下所示:
$ sudo ln -s /usr/bin/java /bin/java
Password: *****
After then the job ran successfully.
这篇关于由于来自容器启动的AM容器异常,无头环境中的MapReduce作业失败N次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!