Hadoop-2-6-0的Web-UI无法看到应用执行的历史信息

Posted by AlstonWilliams on February 17, 2019

环境

  • Hadoop 2.6.0
  • Java 1.8.0_151
  • Ubuntu 16.04

解决方案

开始在配置Hadoop时,由于是按照官网配置的非常简洁版的伪分布式版本,缺少了某些选项,才会造成这个问题。

开始时,我的mapred-site.xml的配置如下:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
        <property>
                <name>mapreduce.framework.name</name>
                <value>yarn</value>
        </property>
</configuration>

这个就是跟着官网上的tutorial一步步走到最后的结果。

由于我们想要查看历史信息,那么肯定就需要有一个地方来存储这些历史信息啊,在之前的Hadoop版本中,使用的是JobHistoryServer,但是如果使用的mapreduce调度框架是YARN的话,就不会使用这一个了,而是ApplicationHistoryServer

所以,我们还需要额外配置一下。

将上面的配置文件修改成如这样:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
        <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>
</configuration>

然后,还需要启动它,通过下面的命令: sbin/yarn-daemon.sh start historyserver

好啦,这样就大功告成啦。