Note that there are some explanatory texts on larger screens.

plurals
  1. POMapReduce job in headless environment fails N times due to AM Container exception from container-launch
    primarykey
    data
    text
    <p>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…</p> <pre><code>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) </code></pre> <p>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.</p> <p>I have narrowed this down to the ResourceManager starting a Java process without passing along the <code>-Djava.awt.headless=true</code>. 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. </p> <p>This is not a question of permissions (something suggested elsewhere) or missing directories.</p> <p>But I'm at a loss as to how to affect the last of the offending attempts to access the root window without permission.</p> <p>I have added the <code>-Djava.awt.headless=true</code> option to the following:</p> <ul> <li>HADOOP_OPTS in hadoop-env.sh</li> <li>HADOOP_JOB_HISTORYSERVER_OPTS in mapred-env.sh YARN_OPTS in yarn-env.sh </li> <li>YARN_RESOURCEMANAGER_OPTS in yarn-env.sh (although that probably duplicates the YARN_OPTS </li> <li>mapred.{map|reduce}.child.java.opts and mapred.child.java.opts in mapred-site.xml</li> </ul> <p>What am I missing? Might I be better off adding this to my Java options globally?</p> <p>FYI, this is merely a pseudo cluster setup on a Mac, OS X 10.8.5, running Hadoop 2.2.0 downloaded from Apache with Java 1.6.0_65-b14. I did not use Homebrew or any other distribution. I am testing the pseudo-cluster with the WordCount example. </p> <p>Thanks.</p> <hr> <p>Ok. Mea culpa. I finally found all the settings to add… Search for all of the "opt" entries in the <a href="http://hadoop.apache.org/docs/r2.2.0/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a> configuration instructions.</p> <p>Here they are in-situ…</p> <pre><code>&lt;property&gt; &lt;name&gt;mapred.child.java.opts&lt;/name&gt; &lt;value&gt;-Djava.awt.headless=true&lt;/value&gt; &lt;/property&gt; &lt;!-- add headless to default -Xmx1024m --&gt; &lt;property&gt; &lt;name&gt;yarn.app.mapreduce.am.command-opts&lt;/name&gt; &lt;value&gt;-Djava.awt.headless=true -Xmx1024m&lt;/value&gt; &lt;/property&gt; &lt;property&gt; &lt;name&gt;yarn.app.mapreduce.am.admin-command-opts&lt;/name&gt; &lt;value&gt;-Djava.awt.headless=true&lt;/value&gt; &lt;/property&gt; </code></pre> <p>I had also tried to accomplish the same thing by adding the parameter to _JAVA_OPTIONS in /etc/profile. Java picked it up, <strong>except when running the MRAppMaster</strong>!!!</p> <p>Hopefully this helps someone else.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload