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-13803. Reconfiguring Kafka service via ambari-web generates an error in stack advisor. (jaimin)
Date Mon, 09 Nov 2015 23:58:40 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 70f2cfe74 -> 47e8d3ad9


AMBARI-13803. Reconfiguring Kafka service via ambari-web generates an error in stack advisor.
(jaimin)


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

Branch: refs/heads/trunk
Commit: 47e8d3ad99e7c759b47c65cded25aa778cd50413
Parents: 70f2cfe
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Mon Nov 9 15:57:08 2015 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Mon Nov 9 15:58:12 2015 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.3/services/stack_advisor.py    | 20 ++++++++++----------
 .../stacks/2.3/common/test_stack_advisor.py     |  6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/47e8d3ad/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 9e188dc..5a1a5f9 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
@@ -323,7 +323,11 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
       putHdfsSitePropertyAttribute('dfs.namenode.inode.attributes.provider.class', 'delete',
'true')
 
   def recommendKAFKAConfigurations(self, configurations, clusterData, services, hosts):
-    core_site = services["configurations"]["core-site"]["properties"]
+    kafka_broker = getServicesSiteProperties(services, "kafka-broker")
+
+    # kerberos security for kafka is decided from `security.inter.broker.protocol` property
value
+    security_enabled = (kafka_broker is not None and 'security.inter.broker.protocol' in
 kafka_broker
+                        and 'SASL' in kafka_broker['security.inter.broker.protocol'])
     putKafkaBrokerProperty = self.putProperty(configurations, "kafka-broker", services)
     putKafkaLog4jProperty = self.putProperty(configurations, "kafka-log4j", services)
     putKafkaBrokerAttributes = self.putPropertyAttribute(configurations, "kafka-broker")
@@ -385,20 +389,16 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 
 
       else:
-      # Cluster is kerberized
-        if 'hadoop.security.authentication' in core_site and core_site['hadoop.security.authentication']
== 'kerberos' and \
+        # Kerberized Cluster with Ranger plugin disabled
+        if security_enabled and \
           services['configurations']['kafka-broker']['properties']['authorizer.class.name']
== 'org.apache.ranger.authorization.kafka.authorizer.RangerKafkaAuthorizer':
           putKafkaBrokerProperty("authorizer.class.name", 'kafka.security.auth.SimpleAclAuthorizer')
+        # Non-kerberos Cluster with Ranger plugin disabled
         else:
           putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
-      # Cluster with Ranger is not kerberized
-    elif ('hadoop.security.authentication' not in core_site or core_site['hadoop.security.authentication']
!= 'kerberos'):
-      putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
-
-
 
-    # Cluster without Ranger is not kerberized
-    elif ('hadoop.security.authentication' not in core_site or core_site['hadoop.security.authentication']
!= 'kerberos'):
+    # Non-Kerberos Cluster without Ranger
+    elif not security_enabled:
       putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/47e8d3ad/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 2b09134..fc4f2e9 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
@@ -430,7 +430,7 @@ class TestHDP23StackAdvisor(TestCase):
     # Test authorizer.class.name with Ranger Kafka plugin disabled in kerberos environment
     configurations['kafka-broker']['properties'] = {}
     configurations['kafka-broker']['property_attributes'] = {}
-    services['configurations']['core-site']['properties']['hadoop.security.authentication']
= 'kerberos'
+    services['configurations']['kafka-broker']['properties']['security.inter.broker.protocol']
= 'PLAINTEXTSASL'
     services['configurations']['kafka-broker']['properties']['authorizer.class.name'] = 'org.apache.ranger.authorization.kafka.authorizer.RangerKafkaAuthorizer'
     self.stackAdvisor.recommendKAFKAConfigurations(configurations, clusterData, services,
None)
     self.assertEquals(configurations['kafka-broker']['properties']['authorizer.class.name'],
'kafka.security.auth.SimpleAclAuthorizer' , "Test authorizer.class.name with Ranger Kafka
plugin disabled in kerberos environment")
@@ -438,7 +438,7 @@ class TestHDP23StackAdvisor(TestCase):
     # Test authorizer.class.name with Ranger Kafka plugin enabled in non-kerberos environment
     configurations['kafka-broker']['properties'] = {}
     configurations['kafka-broker']['property_attributes'] = {}
-    del services['configurations']['core-site']['properties']['hadoop.security.authentication']
+    del services['configurations']['kafka-broker']['properties']['security.inter.broker.protocol']
     services['configurations']['kafka-broker']['properties']['authorizer.class.name'] = 'kafka.security.auth.SimpleAclAuthorizer'
     services['configurations']['ranger-kafka-plugin-properties']['properties']['ranger-kafka-plugin-enabled']
= 'Yes'
     self.stackAdvisor.recommendKAFKAConfigurations(configurations, clusterData, services,
None)
@@ -447,7 +447,7 @@ class TestHDP23StackAdvisor(TestCase):
     # Test authorizer.class.name with Ranger Kafka plugin enabled in kerberos environment
     configurations['kafka-broker']['properties'] = {}
     configurations['kafka-broker']['property_attributes'] = {}
-    services['configurations']['core-site']['properties']['hadoop.security.authentication']
= 'kerberos'
+    services['configurations']['kafka-broker']['properties']['security.inter.broker.protocol']
= 'PLAINTEXTSASL'
     services['configurations']['kafka-broker']['properties']['authorizer.class.name'] = 'kafka.security.auth.SimpleAclAuthorizer'
     services['configurations']['ranger-kafka-plugin-properties']['properties']['ranger-kafka-plugin-enabled']
= 'Yes'
     self.stackAdvisor.recommendKAFKAConfigurations(configurations, clusterData, services,
None)


Mime
View raw message