Browse Source

MAPREDUCE-5217. Fix DistCP to work when launched by Oozie on a secure cluster. Contributed by Venkat Ranganathan.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1481217 13f79535-47bb-0310-9956-ffa450edef68
Siddharth Seth 12 years ago
parent
commit
b5b47a32e0
2 changed files with 12 additions and 0 deletions
  1. 3 0
      CHANGES.txt
  2. 9 0
      src/tools/org/apache/hadoop/tools/DistCp.java

+ 3 - 0
CHANGES.txt

@@ -46,6 +46,9 @@ Release 1.3.0 - unreleased
     MAPREDUCE-5218. Annotate (comment) internal classes as Private. 
     (kkambatl via tucu)
 
+    MAPREDUCE-5217. Fix DistCP to work when launched by Oozie on a secure
+    cluster. (Venkat Ranganathan via sseth)
+
 Release 1.2.1 - Unreleased 
 
   INCOMPATIBLE CHANGES

+ 9 - 0
src/tools/org/apache/hadoop/tools/DistCp.java

@@ -979,6 +979,15 @@ public class DistCp implements Tool {
 
     jobconf.setMapperClass(CopyFilesMapper.class);
     jobconf.setNumReduceTasks(0);
+    // Propagate delegation related props to DistCp job
+    String tokenFile = System.getenv("HADOOP_TOKEN_FILE_LOCATION");
+    if (tokenFile != null) {
+      LOG
+        .info("Setting env property for mapreduce.job.credentials.binary to: "
+          + tokenFile);
+      jobconf.set("mapreduce.job.credentials.binary", tokenFile);
+    }
+
     return jobconf;
   }