访问 Hadoop 作业历史服务器 /jobhistory 页面时出错

Error accessing Hadoop Job History Server /jobhistory page

我正在尝试访问 Hadoop JobHistoryServer /jobhistory 网页并收到以下错误。但是,我可以正确访问同一主机上的 /jmx 页面和 /conf 页面(jhs-0.jhs.ns.svc.cluster.local)

Guice provision errors:

1) Error injecting constructor, org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration! yarn.resourcemanager.hostname.jhs-0 or yarn.resourcemanager.webapp.address.jhs-0 needs to be set in a HA configuration.
      at org.apache.hadoop.mapreduce.v2.hs.webapp.HsController.<init>(HsController.java:38)
      while locating org.apache.hadoop.mapreduce.v2.hs.webapp.HsController

    1 error</pre></p><h3>Caused by:</h3><pre>com.google.inject.ProvisionException: Guice provision errors:

    1) Error injecting constructor, org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration! yarn.resourcemanager.hostname.jhs-0 or yarn.resourcemanager.webapp.address.jhs-0 needs to be set in a HA configuration.
      at org.apache.hadoop.mapreduce.v2.hs.webapp.HsController.&lt;init&gt;(HsController.java:38)
      while locating org.apache.hadoop.mapreduce.v2.hs.webapp.HsController

    1 error
        at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:987)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
        at org.apache.hadoop.yarn.webapp.Dispatcher.service(Dispatcher.java:161)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:900)
        at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:834)
        at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:795)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.apache.hadoop.http.lib.StaticUserWebFilter$StaticUserFilter.doFilter(StaticUserWebFilter.java:109)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.apache.hadoop.http.HttpServer2$QuotingInputFilter.doFilter(HttpServer2.java:1263)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.apache.hadoop.http.NoCacheFilter.doFilter(NoCacheFilter.java:45)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.apache.hadoop.http.NoCacheFilter.doFilter(NoCacheFilter.java:45)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
    Caused by: org.apache.hadoop.yarn.exceptions.YarnRuntimeException: Invalid configuration! yarn.resourcemanager.hostname.jhs-0 or yarn.resourcemanager.webapp.address.jhs-0 needs to be set in a HA configuration.
        at org.apache.hadoop.yarn.conf.HAUtil.throwBadConfigurationException(HAUtil.java:43)
        at org.apache.hadoop.yarn.conf.HAUtil.checkAndSetRMRPCAddress(HAUtil.java:287)
        at org.apache.hadoop.yarn.conf.HAUtil.getConfKeyForRMInstance(HAUtil.java:243)
        at org.apache.hadoop.yarn.conf.HAUtil.getConfValueForRMInstance(HAUtil.java:250)
        at org.apache.hadoop.yarn.conf.HAUtil.getConfValueForRMInstance(HAUtil.java:262)
        at org.apache.hadoop.yarn.conf.YarnConfiguration.getSocketAddr(YarnConfiguration.java:1862)
        at org.apache.hadoop.yarn.webapp.util.WebAppUtils.getResolvedRMWebAppURLWithoutScheme(WebAppUtils.java:165)
        at org.apache.hadoop.mapreduce.v2.app.webapp.AppController.&lt;init&gt;(AppController.java:65)
        at org.apache.hadoop.mapreduce.v2.hs.webapp.HsController.&lt;init&gt;(HsController.java:38)
        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:423)
        at com.google.inject.internal.DefaultConstructionProxyFactory.newInstance(DefaultConstructionProxyFactory.java:85)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.InjectorImpl.call(InjectorImpl.java:978)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
        at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:974)
        ... 38 more

如果有人可以为此提供解决方案,那就太好了。添加 属性 yarn.resourcemanager.hostname.jhs-0 对我来说似乎不正确,因为该主机不作为资源管理器。我正在使用 Hadoop 2.7.6。

我解决了这个问题。问题是 jhs-0 被无意中设置为 yarn.resourcemanager.ha.id 的值。删除它解决了问题。