Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-4324

JobClient can perhaps set mapreduce.job.credentials.binary rather than expect its presence?

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 0.22.0, 2.0.0-alpha
    • Fix Version/s: None
    • Component/s: mrv1, mrv2, security
    • Labels:
      None

      Description

      HDFS-1007 added in this requirement property "mapreduce.job.credentials.binary", that has lead Oozie to add the following duplicate snippet to all its Job-launching main classes such as the Pig, Hive, MR and Sqoop actions:

      if (System.getenv("HADOOP_TOKEN_FILE_LOCATION") != null) {
                  jobConf.set("mapreduce.job.credentials.binary", System.getenv("HADOOP_TOKEN_FILE_LOCATION"));
      }
      

      Same is required for any client program that launches a job from within a task.

      Why can't this simply be set by the JobClient initialization bits itself? If no one imagines it causing issues, I'd like to add this snippet somewhere in JobSubmitter before it requests NN/JT, as otherwise we'd get…

      org.apache.hadoop.ipc.RemoteException: java.io.IOException: Delegation Token can be issued only with kerberos or web authentication 
      at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getDelegationToken(FSNamesystem.java:5509) 
      at org.apache.hadoop.hdfs.server.namenode.NameNode.getDelegationToken(NameNode.java:536) 
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source) 
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
      at java.lang.reflect.Method.invoke(Method.java:597) 
      at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:557) 
      at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1434) 
      at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1430) 
      at java.security.AccessController.doPrivileged(Native Method) 
      at javax.security.auth.Subject.doAs(Subject.java:396) 
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157) 
      at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1428)
      
      at org.apache.hadoop.ipc.Client.call(Client.java:1107) 
      at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:226) 
      at $Proxy6.getDelegationToken(Unknown Source) 
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
      at java.lang.reflect.Method.invoke(Method.java:597) 
      at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82) 
      at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59) 
      at $Proxy6.getDelegationToken(Unknown Source) 
      at org.apache.hadoop.hdfs.DFSClient.getDelegationToken(DFSClient.java:331) 
      at org.apache.hadoop.hdfs.DistributedFileSystem.getDelegationToken(DistributedFileSystem.java:605) 
      at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:115) 
      at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodes(TokenCache.java:79) 
      at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:851) 
      at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:833) 
      at java.security.AccessController.doPrivileged(Native Method) 
      at javax.security.auth.Subject.doAs(Subject.java:396) 
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157) 
      at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:833) 
      at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:807) 
      at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1242) 
      

      … or similar errors when a user submits a job from a task running in a secured cluster.

      Let me know your thoughts on this!

        Issue Links

          Activity

          Hide
          qwertymaniac Harsh J added a comment -

          Doing this would break (or be defunct due to) MAPREDUCE-3727 I think. Resolving as Won't Fix at this point.

          Users should continue manually configuring this.

          Show
          qwertymaniac Harsh J added a comment - Doing this would break (or be defunct due to) MAPREDUCE-3727 I think. Resolving as Won't Fix at this point. Users should continue manually configuring this.
          Hide
          qwertymaniac Harsh J added a comment -

          I suspect doing this may break MAPREDUCE-3727?

          Show
          qwertymaniac Harsh J added a comment - I suspect doing this may break MAPREDUCE-3727 ?
          Hide
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12534118/MAPREDUCE-4324.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2537//testReport/
          Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2537//console

          This message is automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12534118/MAPREDUCE-4324.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2537//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2537//console This message is automatically generated.
          Hide
          qwertymaniac Harsh J added a comment -

          Here's a simple attempt, which modifies JobClient's initializer method alone.

          With YARNRunner involved (via JobSubmitter, which ignores conf when sought), I am unsure where to place it. I think its sufficient for JobClient alone to have it, but if the code has diverged much beyond JobClient paths when using Job (new API), then this patch may not suffice.

          Show
          qwertymaniac Harsh J added a comment - Here's a simple attempt, which modifies JobClient's initializer method alone. With YARNRunner involved (via JobSubmitter, which ignores conf when sought), I am unsure where to place it. I think its sufficient for JobClient alone to have it, but if the code has diverged much beyond JobClient paths when using Job (new API), then this patch may not suffice.
          Hide
          ashutoshc Ashutosh Chauhan added a comment -

          As someone working on higher up the stack, I have seen this if code block in all the clients. Ideally, jobclient should do it, freeing apps from this unnecessary requirement. Thanks, Harsh for picking this up!

          Show
          ashutoshc Ashutosh Chauhan added a comment - As someone working on higher up the stack, I have seen this if code block in all the clients. Ideally, jobclient should do it, freeing apps from this unnecessary requirement. Thanks, Harsh for picking this up!

            People

            • Assignee:
              qwertymaniac Harsh J
              Reporter:
              qwertymaniac Harsh J
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development