ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-13754. ranger.audit.solr.zookeepers needs to be set to NONE if SolrCloud is not used. (jaimin)
Date Fri, 06 Nov 2015 01:26:30 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 4136dbc7b -> fa042c8b7


AMBARI-13754. ranger.audit.solr.zookeepers needs to be set to NONE if SolrCloud is not used.
(jaimin)


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

Branch: refs/heads/branch-2.1
Commit: fa042c8b7c77696af9e4456a720343309e0b7661
Parents: 4136dbc
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Thu Nov 5 17:25:16 2015 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Thu Nov 5 17:26:24 2015 -0800

----------------------------------------------------------------------
 .../HBASE/configuration/ranger-hbase-audit.xml     |  2 +-
 .../HDFS/configuration/ranger-hdfs-audit.xml       |  2 +-
 .../HIVE/configuration/ranger-hive-audit.xml       |  2 +-
 .../KAFKA/configuration/ranger-kafka-audit.xml     |  2 +-
 .../KNOX/configuration/ranger-knox-audit.xml       |  2 +-
 .../RANGER/configuration/ranger-admin-site.xml     |  6 +++++-
 .../STORM/configuration/ranger-storm-audit.xml     |  2 +-
 .../YARN/configuration/ranger-yarn-audit.xml       |  2 +-
 .../stacks/HDP/2.3/services/stack_advisor.py       | 17 +++++++++++++----
 .../python/stacks/2.3/common/test_stack_advisor.py | 11 +++++++++++
 10 files changed, 36 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
index 0de24b6..57a11c3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
@@ -146,7 +146,7 @@
 
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-audit.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-audit.xml
index 888b135..c15cfc3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-audit.xml
@@ -146,7 +146,7 @@
 
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
index 0610dd1..dfac592 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
@@ -146,7 +146,7 @@
 
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-audit.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-audit.xml
index 3ba44e6..4317631 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-audit.xml
@@ -146,7 +146,7 @@
 
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
index 07f1adf..d9a1021 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
@@ -146,7 +146,7 @@
 
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
index 8835503..7b5e08a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
@@ -426,13 +426,17 @@
 
   <property>
     <name>ranger.audit.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>
         <type>zoo.cfg</type>
         <name>clientPort</name>
       </property>
+      <property>
+        <type>ranger-env</type>
+        <name>is_solrCloud_enabled</name>
+      </property>
     </depends-on>
   </property> 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-audit.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-audit.xml
index c04ba74..e946f52 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-audit.xml
@@ -146,7 +146,7 @@
 
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
index 87a48d7..1f8eb59 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
@@ -146,7 +146,7 @@
 
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
-    <value>localhost:2181</value>
+    <value>NONE</value>
     <description>Solr Zookeeper string</description>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index bb20f11..820487d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -407,12 +407,21 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
         rangerSqlConnectorProperty = authMap.get(rangerUserSyncClass)
         putRangerAdminProperty('ranger.authentication.method', rangerSqlConnectorProperty)
 
+
+    if 'ranger-env' in services['configurations'] and 'is_solrCloud_enabled' in services['configurations']["ranger-env"]["properties"]:
+      isSolrCloudEnabled = services['configurations']["ranger-env"]["properties"]["is_solrCloud_enabled"]
 == "true"
+    else:
+      isSolrCloudEnabled = False
+
+    if isSolrCloudEnabled:
+      zookeeper_host_port = self.getZKHostPortString(services)
+      if zookeeper_host_port:
+        putRangerAdminProperty('ranger.audit.solr.zookeepers', zookeeper_host_port)
+    else:
+      putRangerAdminProperty('ranger.audit.solr.zookeepers', 'NONE')
+
     # Recommend ranger.audit.solr.zookeepers and xasecure.audit.destination.hdfs.dir
     include_hdfs = "HDFS" in servicesList
-    zookeeper_host_port = self.getZKHostPortString(services)
-    if zookeeper_host_port:
-      putRangerAdminProperty('ranger.audit.solr.zookeepers', zookeeper_host_port)
-
     if include_hdfs:
       if 'core-site' in services['configurations'] and ('fs.defaultFS' in services['configurations']['core-site']['properties']):
         default_fs = services['configurations']['core-site']['properties']['fs.defaultFS']

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa042c8b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index 81495bc..c5620d7 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -1115,6 +1115,7 @@ class TestHDP23StackAdvisor(TestCase):
       },
       'ranger-admin-site': {
         'properties': {
+          "ranger.audit.solr.zookeepers": "NONE"
         }
       },
       'ranger-env': {
@@ -1128,3 +1129,13 @@ class TestHDP23StackAdvisor(TestCase):
     self.stackAdvisor.recommendRangerConfigurations(recommendedConfigurations, clusterData,
services, None)
     self.assertEquals(recommendedConfigurations, expected)
 
+    # Recommend ranger.audit.solr.zookeepers when solrCloud is disabled
+    services['configurations']['ranger-env'] = {
+      "properties": {
+        "is_solrCloud_enabled": "false"
+      }
+    }
+
+    recommendedConfigurations = {}
+    self.stackAdvisor.recommendRangerConfigurations(recommendedConfigurations, clusterData,
services, None)
+    self.assertEquals(recommendedConfigurations['ranger-admin-site']['properties']['ranger.audit.solr.zookeepers'],
'NONE')
\ No newline at end of file


Mime
View raw message