Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-6990

AmIpFilter:findRedirectUrl use HAServiceProtocol to getServiceStatus

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.7.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Due to we have multiple IP in ResourceManager, when try to access proxy URL like https://*:50030/proxy/application_1502349494018_10877/, it will failed due to it use HAServiceProtocol to find out which one is active RM.

      2017-08-10 10:51:42,344 WARN [971256592@qtp-666312528-0] org.apache.hadoop.ipc.Client: Exception encountered while connecting to the server :
      org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[KERBEROS]
              at org.apache.hadoop.security.SaslRpcClient.selectSaslClient(SaslRpcClient.java:172)
              at org.apache.hadoop.security.SaslRpcClient.saslConnect(SaslRpcClient.java:396)
              at org.apache.hadoop.ipc.Client$Connection.setupSaslConnection(Client.java:563)
              at org.apache.hadoop.ipc.Client$Connection.access$1900(Client.java:378)
              at org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:732)
              at org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:728)
              at java.security.AccessController.doPrivileged(Native Method)
              at javax.security.auth.Subject.doAs(Subject.java:422)
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1709)
              at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:727)
              at org.apache.hadoop.ipc.Client$Connection.access$2900(Client.java:378)
              at org.apache.hadoop.ipc.Client.getConnection(Client.java:1492)
              at org.apache.hadoop.ipc.Client.call(Client.java:1402)
              at org.apache.hadoop.ipc.Client.call(Client.java:1363)
              at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:229)
              at com.sun.proxy.$Proxy84.getServiceStatus(Unknown Source)
              at org.apache.hadoop.ha.protocolPB.HAServiceProtocolClientSideTranslatorPB.getServiceStatus(HAServiceProtocolClientSideTranslatorPB.java:122)
              at org.apache.hadoop.yarn.util.RMHAUtils.getHAState(RMHAUtils.java:68)
              at org.apache.hadoop.yarn.util.RMHAUtils.findActiveRMHAId(RMHAUtils.java:44)
              at org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.findRedirectUrl(AmIpFilter.java:174)
              at org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.doFilter(AmIpFilter.java:138)
              at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
              at org.apache.hadoop.http.HttpServer2$QuotingInputFilter.doFilter(HttpServer2.java:1243)
              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)
      

      This only can happen on RM have multiple IPs, related code is inside AmIpFilter.java doFilter function:

          if (!getProxyAddresses().contains(httpReq.getRemoteAddr())) {
            String redirectUrl = findRedirectUrl();
            String target = redirectUrl + httpReq.getRequestURI();
            ProxyUtils.sendRedirect(httpReq,  httpResp,  target);
            return;
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zhaoyunjiong yunjiong zhao
                Reporter:
                zhaoyunjiong yunjiong zhao
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: