From de85f841dae2bb22696472d78feb852883761a4e Mon Sep 17 00:00:00 2001 From: Wangda Tan Date: Sun, 9 Sep 2018 17:45:31 -0700 Subject: [PATCH] YARN-8698. [Submarine] Failed to reset Hadoop home environment when submitting a submarine job. (Zac Zhou via wangda) Change-Id: If7fdc11fcc4e49bed2186ded76cd69164f34f502 --- .../runtimes/yarnservice/YarnServiceJobSubmitter.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java index 3cd0d7efb9..a2a2067425 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java @@ -125,6 +125,7 @@ private void addHdfsClassPathIfNeeded(RunJobParameters parameters, fw.append("export HADOOP_HOME=\n"); fw.append("export HADOOP_YARN_HOME=\n"); fw.append("export HADOOP_HDFS_HOME=" + hdfsHome + "\n"); + fw.append("export HADOOP_COMMON_HOME=" + hdfsHome + "\n"); } else{ lackingEnvs = true; } @@ -170,10 +171,12 @@ private void addHdfsClassPathIfNeeded(RunJobParameters parameters, // DEBUG if (SubmarineLogs.isVerbose()) { - fw.append("echo $CLASSPATH\n"); - fw.append("echo $JAVA_HOME\n"); - fw.append("echo $LD_LIBRARY_PATH\n"); - fw.append("echo $HADOOP_HDFS_HOME\n"); + fw.append("echo \"CLASSPATH:$CLASSPATH\"\n"); + fw.append("echo \"HADOOP_CONF_DIR:$HADOOP_CONF_DIR\"\n"); + fw.append("echo \"HADOOP_TOKEN_FILE_LOCATION:$HADOOP_TOKEN_FILE_LOCATION\"\n"); + fw.append("echo \"JAVA_HOME:$JAVA_HOME\"\n"); + fw.append("echo \"LD_LIBRARY_PATH:$LD_LIBRARY_PATH\"\n"); + fw.append("echo \"HADOOP_HDFS_HOME:$HADOOP_HDFS_HOME\"\n"); } }