diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/KerberosPrincipal.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/KerberosPrincipal.java index 0ff4daa6b8..27125fbedc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/KerberosPrincipal.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/KerberosPrincipal.java @@ -71,8 +71,9 @@ public KerberosPrincipal keytab(String keytab) { } /** - * The URI of the kerberos keytab. It supports two schemes \" - * hdfs\" and \"file\". If the URI starts with \" + * The URI of the kerberos keytab. It supports hadoop supported schemes + * like \"hdfs\" \"file\" \"s3\" + * \"viewfs\" etc.If the URI starts with \" * hdfs://\" scheme, it indicates the path on hdfs where the keytab is * stored. The keytab will be localized by YARN and made available to AM in * its local directory. If the URI starts with \"file://\" @@ -81,13 +82,14 @@ public KerberosPrincipal keytab(String keytab) { * * @return keytab **/ - @ApiModelProperty(value = "The URI of the kerberos keytab. It supports two " + - "schemes \"hdfs\" and \"file\". If the URI starts with \"hdfs://\" " + - "scheme, it indicates the path on hdfs where the keytab is stored. The " + - "keytab will be localized by YARN and made available to AM in its local" + - " directory. If the URI starts with \"file://\" scheme, it indicates a " + - "path on the local host where the keytab is presumbaly installed by " + - "admins upfront. ") + @ApiModelProperty(value = "The URI of the kerberos keytab. It supports" + + " Hadoop supported filesystem types like \"hdfs\", \"file\"," + + " \"viewfs\", \"s3\" etc.If the URI starts with \"hdfs://\" scheme, " + + "it indicates the path on hdfs where the keytab is stored. The " + + "keytab will be localized by YARN and made available to AM in its local" + + " directory. If the URI starts with \"file://\" scheme, it indicates a " + + "path on the local host where the keytab is presumbaly installed by " + + "admins upfront. ") public String getKeytab() { return keytab; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java index b3ac7bbe74..41d1e42394 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java @@ -1478,18 +1478,18 @@ private void addKeytabResourceIfSecure(SliderFileSystem fileSystem, if ("file".equals(keytabURI.getScheme())) { LOG.info("Using a keytab from localhost: " + keytabURI); } else { - Path keytabOnhdfs = new Path(keytabURI); - if (!fileSystem.getFileSystem().exists(keytabOnhdfs)) { + Path keytabPath = new Path(keytabURI); + if (!fileSystem.getFileSystem().exists(keytabPath)) { LOG.warn(service.getName() + "'s keytab (principalName = " - + principalName + ") doesn't exist at: " + keytabOnhdfs); + + principalName + ") doesn't exist at: " + keytabPath); return; } - LocalResource keytabRes = fileSystem.createAmResource(keytabOnhdfs, + LocalResource keytabRes = fileSystem.createAmResource(keytabPath, LocalResourceType.FILE, LocalResourceVisibility.PRIVATE); localResource.put(String.format(YarnServiceConstants.KEYTAB_LOCATION, service.getName()), keytabRes); LOG.info("Adding " + service.getName() + "'s keytab for " - + "localization, uri = " + keytabOnhdfs); + + "localization, uri = " + keytabPath); } }