Hadoop JobHistory 仅显示失败的作业

Hadoop JobHistory shows only the failed jobs

我正在尝试监视 The Definitive Hadoop 一书中名为 Find Maximum Temperature 的示例 MapReduce 应用程序的作业。在 Hadoop-2.6 的默认安装和配置中,该应用程序运行完美,即计算年度最高温度。但是在我像这样扩展 mapred-site.xml 和 yarn-site.xml 的配置之后:(取自 How do I view my Hadoop job history and logs using CDH4 and Yarn? and

mapred-site.xml:

<property>
  <name> mapreduce.framework.name</name>
  <value>yarn</value>
</property>
<property> 
  <name>mapreduce.jobhistory.address</name>
  <value>localhost:10020</value> 
</property>
<property> 
  <name>mapreduce.jobhistory.webapp.address</name>
  <value>localhost:19888</value> 
</property>

纱-site.xml:

  <property>
      <name>yarn.log-aggregation-enable</name>
      <value>true</value>
  </property>
  <property>
     <name>yarn.nodemanager.remote-app-log-dir</name>
     <value>/app-logs</value>
  </property>
  <property>
      <name>yarn.nodemanager.remote-app-log-dir-suffix</name>
      <value>logs</value>
  </property>

当我 运行 同一个 MaxTemperature 应用程序时,应用程序完成正常并输出名为 part-r-00000 的文件,但在 localhost:19888 的 JobHistory 页面上看不到它. (同时 localhost:8042、localhpst:8088 和 localhost:50070 的其他页面工作正常)

有没有一种方法可以让我看到所有的作业,因为它们 运行在任何 Hadoop 页面上都是如此?

有时当我 运行 相同的应用程序时,它会给出此错误:

17/09/19 11:07:49 INFO mapreduce.Job: Task Id : attempt_1505767853223_0003_m_000005_1, Status : FAILED Container launch failed for container_1505767853223_0003_01_000013 : org.apache.hadoop.yarn.exceptions.InvalidAuxServiceException: The auxService:mapreduce_shuffle does not exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.instantiateException(SerializedExceptionPBImpl.java:168) at org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.deSerialize(SerializedExceptionPBImpl.java:106) at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$Container.launch(ContainerLauncherImpl.java:155) at org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl$EventProcessor.run(ContainerLauncherImpl.java:369) 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)

如果出现此错误,它会显示在 JobHistory 页面上。我不知道为什么它有时会失败,但它发生在 Hadoop 的新启动之后:start-dfs.shstart-yarn.sh/usr/local/hadoop-2.6.0/sbin/mr-jobhistory-daemon.sh 启动 historyserver 这是 3 个作业失败后的 SS:

A google 搜索 org.apache.hadoop.yarn.exceptions.InvalidAuxServiceException:auxService:mapreduce_shuffle 不存在 返回此 SO post

将这些行添加到 yarn-site.xml:

的配置中
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>

解决了问题。现在,所有作业,无论是失败的还是成功的,都会出现在 JobHistory 页面上。这是一个 SS: