ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From magyari_san...@apache.org
Subject ambari git commit: AMBARI-17093. Ambari cluster installation with blueprint is failing when installing only Kafka + AMS +Zookeeper (magyari_sandor)
Date Tue, 14 Jun 2016 09:26:34 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 3e152bb94 -> 7bed05350


AMBARI-17093. Ambari cluster installation with blueprint is failing when installing only Kafka
+ AMS +Zookeeper (magyari_sandor)


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

Branch: refs/heads/branch-2.4
Commit: 7bed05350e18a0bbe25675fc08ca8a2eaeae23e8
Parents: 3e152bb
Author: Sandor Magyari <smagyari@hortonworks.com>
Authored: Fri Jun 10 09:56:21 2016 +0200
Committer: Sandor Magyari <smagyari@hortonworks.com>
Committed: Tue Jun 14 11:24:07 2016 +0200

----------------------------------------------------------------------
 .../BlueprintConfigurationProcessor.java        |  3 +-
 .../BlueprintConfigurationProcessorTest.java    | 57 ++++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7bed0535/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 ac0b836..9094698 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
@@ -2653,7 +2653,8 @@ public class BlueprintConfigurationProcessor {
       rangerStormAuditPropsMap
     );
     for (Map<String, PropertyUpdater> rangerAuditPropsMap: configsWithRangerHdfsAuditDirProperty)
{
-      rangerAuditPropsMap.put("xasecure.audit.destination.hdfs.dir", new SingleHostTopologyUpdater("NAMENODE"));
// the same prop updater must be used as for fs.defaultFS in core-site
+      rangerAuditPropsMap.put("xasecure.audit.destination.hdfs.dir", new OptionalSingleHostTopologyUpdater("NAMENODE"));
+       // the same prop updater must be used as for fs.defaultFS in core-site
     }
 
     // RANGER KMS

http://git-wip-us.apache.org/repos/asf/ambari/blob/7bed0535/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 ae28bc0..cda8fb8 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
@@ -6537,6 +6537,63 @@ public class BlueprintConfigurationProcessorTest {
     assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-storm-audit",
"xasecure.audit.destination.hdfs.dir"));
   }
 
+  @Test
+  public void testRangerEnv_defaults_NO_HDFS() throws Exception {
+    // Given
+    List<String> configTypesWithRangerHdfsAuditDir = ImmutableList.of(
+      "ranger-env",
+      "ranger-yarn-audit",
+      "ranger-hdfs-audit",
+      "ranger-hbase-audit",
+      "ranger-hive-audit",
+      "ranger-knox-audit",
+      "ranger-kafka-audit",
+      "ranger-storm-audit"
+    );
+    Map<String, Map<String, String>> clusterConfigProperties = new HashMap<>();
+
+    for (String configType: configTypesWithRangerHdfsAuditDir) {
+      Map<String, String> configProperties = new HashMap<>();
+      configProperties.put("xasecure.audit.destination.hdfs.dir", "hdfs://localhost:100");
+
+      clusterConfigProperties.put(configType, configProperties);
+    }
+
+    Map<String, Map<String, String>> parentProperties = new HashMap<>();
+    Configuration parentClusterConfig = new Configuration(parentProperties, new HashMap<String,
Map<String, Map<String, String>>>());
+    Configuration clusterConfig = new Configuration(clusterConfigProperties, new HashMap<String,
Map<String, Map<String, String>>>(), parentClusterConfig);
+
+    Collection<String> rangerComponents = new HashSet<>();
+    rangerComponents.add("RANGER_ADMIN");
+    rangerComponents.add("RANGER_USERSYNC");
+
+    TestHostGroup group1 = new TestHostGroup("group1", rangerComponents, Collections.singleton("host1"));
+    group1.components.add("OOZIE_SERVER");
+
+
+    expect(stack.getCardinality("NAMENODE")).andReturn(new Cardinality("1+")).anyTimes();
+
+    Collection<TestHostGroup> hostGroups = Lists.newArrayList(group1);//, group2);
+
+    ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
+    BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology);
+
+    // When
+    configProcessor.doUpdateForClusterCreate();
+
+    // Then
+    String expectedAuditHdfsDir = "hdfs://localhost:100";
+
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-env", "xasecure.audit.destination.hdfs.dir"));
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-yarn-audit",
"xasecure.audit.destination.hdfs.dir"));
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-hdfs-audit",
"xasecure.audit.destination.hdfs.dir"));
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-hbase-audit",
"xasecure.audit.destination.hdfs.dir"));
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-hive-audit",
"xasecure.audit.destination.hdfs.dir"));
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-knox-audit",
"xasecure.audit.destination.hdfs.dir"));
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-kafka-audit",
"xasecure.audit.destination.hdfs.dir"));
+    assertEquals(expectedAuditHdfsDir, clusterConfig.getPropertyValue("ranger-storm-audit",
"xasecure.audit.destination.hdfs.dir"));
+  }
+
 
   @Test
   public void testRangerEnv() throws Exception {


Mime
View raw message