From 7c4c992ec57ac6c0dc8b431c934f180bc32b8b19 Mon Sep 17 00:00:00 2001 From: taojie Date: Tue, 29 Nov 2016 16:03:02 +0800 Subject: [PATCH] MYRIAD-247 Fail to fetch yarnConfiguration from Resourcemanager --- .../myriad/scheduler/ExecutorCommandLineGenerator.java | 6 +++--- .../org/apache/myriad/scheduler/TestServiceCommandLine.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/ExecutorCommandLineGenerator.java b/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/ExecutorCommandLineGenerator.java index c2a1c686..6f1bd0ba 100644 --- a/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/ExecutorCommandLineGenerator.java +++ b/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/ExecutorCommandLineGenerator.java @@ -77,7 +77,7 @@ protected void appendDistroExtractionCommands(StringBuilder cmdLine) { //config file to yarnConfiguration, It's an xml file with the parameters of yarn-site.xml, core-site.xml and hdfs.xml. if (!myriadExecutorConfiguration.getConfigUri().isPresent()) { appendSudo(cmdLine); - cmdLine.append(" cp yarnConfiguration "); + cmdLine.append(" cp conf "); cmdLine.append(myriadConfiguration.getYarnEnvironment().get("YARN_HOME")); cmdLine.append("/etc/hadoop/yarn-site.xml && "); } @@ -111,13 +111,13 @@ public String getConfigurationUrl() { if (StringUtils.isEmpty(address)) { address = yarnConfiguration.get(TaskFactory.YARN_RESOURCEMANAGER_HOSTNAME) + ":8090"; } - return "https://" + address + "/yarnConfiguration"; + return "https://" + address + "/conf"; } else { address = yarnConfiguration.get(TaskFactory.YARN_RESOURCEMANAGER_WEBAPP_ADDRESS); if (StringUtils.isEmpty(address)) { address = yarnConfiguration.get(TaskFactory.YARN_RESOURCEMANAGER_HOSTNAME) + ":8088"; } - return "http://" + address + "/yarnConfiguration"; + return "http://" + address + "/conf"; } } diff --git a/myriad-scheduler/src/test/java/org/apache/myriad/scheduler/TestServiceCommandLine.java b/myriad-scheduler/src/test/java/org/apache/myriad/scheduler/TestServiceCommandLine.java index b6806a2b..4e43564b 100644 --- a/myriad-scheduler/src/test/java/org/apache/myriad/scheduler/TestServiceCommandLine.java +++ b/myriad-scheduler/src/test/java/org/apache/myriad/scheduler/TestServiceCommandLine.java @@ -47,10 +47,10 @@ public class TestServiceCommandLine extends BaseConfigurableTest { + System.lineSeparator() + "%s"; protected static final String CMD_FORMAT = "echo \"%1$s\" && %1$s"; static String toJHSCompare = - " sudo tar -zxpf hadoop-2.7.0.tar.gz && sudo cp yarnConfiguration /usr/local/hadoop/etc/hadoop/yarn-site.xml && " + + " sudo tar -zxpf hadoop-2.7.0.tar.gz && sudo cp conf /usr/local/hadoop/etc/hadoop/yarn-site.xml && " + "sudo -E -u hduser -H bin/mapred historyserver"; static String toCompare = - " sudo tar -zxpf hadoop-2.7.0.tar.gz && sudo cp yarnConfiguration /usr/local/hadoop/etc/hadoop/yarn-site.xml && " + + " sudo tar -zxpf hadoop-2.7.0.tar.gz && sudo cp conf /usr/local/hadoop/etc/hadoop/yarn-site.xml && " + "sudo -E -u hduser -H $YARN_HOME/bin/yarn nodemanager"; @Test