ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnettle...@apache.org
Subject ambari git commit: AMBARI-12000. Blueprint export incorrectly includes Kerberos host information. (rnettleton)
Date Thu, 18 Jun 2015 16:06:06 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 73b7d7273 -> 61b2ebb54


AMBARI-12000. Blueprint export incorrectly includes Kerberos host information. (rnettleton)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/61b2ebb5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/61b2ebb5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/61b2ebb5

Branch: refs/heads/branch-2.1
Commit: 61b2ebb545cfb79801151d91005bc98aefcff08f
Parents: 73b7d72
Author: Bob Nettleton <rnettleton@hortonworks.com>
Authored: Thu Jun 18 12:04:45 2015 -0400
Committer: Bob Nettleton <rnettleton@hortonworks.com>
Committed: Thu Jun 18 12:05:32 2015 -0400

----------------------------------------------------------------------
 .../BlueprintConfigurationProcessor.java        |  5 +-
 .../BlueprintConfigurationProcessorTest.java    | 54 ++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/61b2ebb5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index af3b331..f567c64 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -127,7 +127,9 @@ public class BlueprintConfigurationProcessor {
    */
   private static final PropertyFilter[] exportPropertyFilters =
     { new PasswordPropertyFilter(),
-      new SimplePropertyNameExportFilter("tez.tez-ui.history-url.base", "tez-site")};
+      new SimplePropertyNameExportFilter("tez.tez-ui.history-url.base", "tez-site"),
+      new SimplePropertyNameExportFilter("admin_server_host", "kerberos-env"),
+      new SimplePropertyNameExportFilter("kdc_host", "kerberos-env")};
 
   /**
    * Statically-defined list of filters to apply on cluster config
@@ -1941,6 +1943,7 @@ public class BlueprintConfigurationProcessor {
     multiCoreSiteMap.put("hadoop.proxyuser.hive.hosts", new MultipleHostTopologyUpdater("HIVE_SERVER"));
     multiCoreSiteMap.put("hadoop.proxyuser.HTTP.hosts", new MultipleHostTopologyUpdater("WEBHCAT_SERVER"));
     multiCoreSiteMap.put("hadoop.proxyuser.hcat.hosts", new MultipleHostTopologyUpdater("WEBHCAT_SERVER"));
+    multiCoreSiteMap.put("hadoop.proxyuser.yarn.hosts", new MultipleHostTopologyUpdater("RESOURCEMANAGER"));
     multiWebhcatSiteMap.put("templeton.hive.properties", new TempletonHivePropertyUpdater());
     multiWebhcatSiteMap.put("templeton.kerberos.principal", new MultipleHostTopologyUpdater("WEBHCAT_SERVER"));
     hiveEnvMap.put("hive_hostname", new SingleHostTopologyUpdater("HIVE_SERVER"));

http://git-wip-us.apache.org/repos/asf/ambari/blob/61b2ebb5/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index abf5675..c8daf09 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -714,6 +714,60 @@ public class BlueprintConfigurationProcessorTest {
       tezSiteProperties.containsKey("tez.tez-ui.history-url.base"));
   }
 
+  /**
+   * There is no support currently for deploying a fully Kerberized
+   * cluster with Blueprints.  This test verifies the current treatment
+   * of Kerberos-related properties in a Blueprint export.
+   *
+   * @throws Exception
+   */
+  @Test
+  public void testKerberosConfigExport() throws Exception {
+    final String expectedHostName = "c6401.apache.ambari.org";
+    final String expectedHostGroupName = "host_group_1";
+
+    Map<String, Map<String, String>> configProperties = new HashMap<String,
Map<String, String>>();
+    Map<String, String> kerberosEnvProperties = new HashMap<String, String>();
+    Map<String, String> coreSiteProperties = new HashMap<String, String>();
+    configProperties.put("kerberos-env", kerberosEnvProperties);
+    configProperties.put("core-site", coreSiteProperties);
+
+    // simulate the case of a Kerberized cluster, including config
+    // added by the Kerberos service
+    kerberosEnvProperties.put("admin_server_host", expectedHostName);
+    kerberosEnvProperties.put("kdc_host", expectedHostName);
+    coreSiteProperties.put("hadoop.proxyuser.yarn.hosts", expectedHostName);
+
+    Configuration clusterConfig = new Configuration(configProperties,
+      Collections.<String, Map<String, Map<String, String>>>emptyMap());
+
+    // note: test hostgroups may not accurately reflect the required components for the config
properties
+    // which are mapped to them.  Only the hostgroup name is used for hostgroup resolution
an the components
+    // are not validated
+    Collection<String> groupComponents = new HashSet<String>();
+    groupComponents.add("TEZ_CLIENT");
+    groupComponents.add("RESOURCEMANAGER");
+    Collection<String> hosts = new ArrayList<String>();
+    hosts.add(expectedHostName);
+    hosts.add("serverTwo");
+    TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts);
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    hostGroups.add(group);
+
+    ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
+    BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology);
+    configProcessor.doUpdateForBlueprintExport();
+
+    // verify that these properties are filtered out of the exported configuration
+    assertFalse("admin_server_host should not be present in exported blueprint in kerberos-env",
+      kerberosEnvProperties.containsKey("admin_server_host"));
+    assertFalse("kdc_host should not be present in exported blueprint in kerberos-env",
+      kerberosEnvProperties.containsKey("kdc_host"));
+    assertEquals("hadoop.proxyuser.yarn.hosts was not exported correctly",
+      createExportedHostName("host_group_1"), coreSiteProperties.get("hadoop.proxyuser.yarn.hosts"));
+  }
+
   @Test
   public void testDoNameNodeHighAvailabilityExportWithHAEnabled() throws Exception {
     final String expectedNameService = "mynameservice";


Mime
View raw message