Browse Source

YARN-5080. Addendum fix to the original patch to fix YARN logs CLI. Contributed by Xuan Gong

(cherry picked from commit 5a43583c0bbb9650ea6a9f48d9544ec3ec24b580)
Vinod Kumar Vavilapalli 9 years ago
parent
commit
593d2c66c4

+ 3 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/LogsCLI.java

@@ -379,7 +379,9 @@ public class LogsCLI extends Configured implements Tool {
       Configuration conf, String appId) throws ClientHandlerException,
       UniformInterfaceException, JSONException {
     Client webServiceClient = Client.create();
-    String webAppAddress = WebAppUtils.getRMWebAppURLWithScheme(conf);
+    String webAppAddress = WebAppUtils.getHttpSchemePrefix(conf) +
+        WebAppUtils.getWebAppBindURL(conf, YarnConfiguration.RM_BIND_HOST,
+        WebAppUtils.getRMWebAppURLWithoutScheme(conf));
     WebResource webResource = webServiceClient.resource(webAppAddress);
 
     ClientResponse response =