Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 ae1577cfc -> 26ddeca77


AMBARI-16171. Changes to Phoenix QueryServer Kerberos configuration. (Josh 
Eshler via mahadev)


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

Branch: refs/heads/branch-2.4
Commit: 26ddeca77b69a36b602e721c74f8f72bad7e0a52
Parents: ae1577c
Author: Mahadev Konar <maha...@apache.org>
Authored: Thu Jun 2 22:47:09 2016 -0700
Committer: Mahadev Konar <maha...@apache.org>
Committed: Thu Jun 2 23:35:49 2016 -0700

----------------------------------------------------------------------
 .../HBASE/0.96.0.2.0/kerberos.json                |  5 -----
 .../stacks/HDP/2.5/services/HBASE/kerberos.json   |  5 -----
 .../stacks/HDP/2.5/services/stack_advisor.py      | 18 ++++++++++++++----
 .../stacks/2.5/common/test_stack_advisor.py       |  6 +++---
 4 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/26ddeca7/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/kerberos.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/kerberos.json
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/kerberos.json
index f887f92..d569447 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/kerberos.json
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/kerberos.json
@@ -42,11 +42,6 @@
             "hbase.coprocessor.regionserver.classes": 
"{{hbase_coprocessor_regionserver_classes}}",
             "hbase.bulkload.staging.dir": "/apps/hbase/staging"
           }
-        },
-        {
-          "core-site": {
-            "hadoop.proxyuser.HTTP.hosts": 
"${clusterHostInfo/phoenix_query_server_hosts}"
-          }
         }
       ],
       "components": [

http://git-wip-us.apache.org/repos/asf/ambari/blob/26ddeca7/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/kerberos.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/kerberos.json 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/kerberos.json
index 5cfe42d..8be8bda 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/kerberos.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/kerberos.json
@@ -43,11 +43,6 @@
             "hbase.bulkload.staging.dir": "/apps/hbase/staging",
             "hbase.master.ui.readonly": "true"
           }
-        },
-        {
-          "core-site": {
-            "hadoop.proxyuser.HTTP.hosts": 
"${clusterHostInfo/phoenix_query_server_hosts}"
-          }
         }
       ],
       "components": [

http://git-wip-us.apache.org/repos/asf/ambari/blob/26ddeca7/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
index 413a2f7..379c268 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
@@ -196,29 +196,39 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
     super(HDP25StackAdvisor, 
self).recommendHBASEConfigurations(configurations, clusterData, services, hosts)
     putHbaseSiteProperty = self.putProperty(configurations, "hbase-site", 
services)
     appendCoreSiteProperty = self.updateProperty(configurations, "core-site", 
services)
-    servicesList = [service["StackServices"]["service_name"] for service in 
services["services"]]
 
-    if 'KERBEROS' in servicesList:
+    if "cluster-env" in services["configurations"] \
+         and "security_enabled" in 
services["configurations"]["cluster-env"]["properties"] \
+         and 
services["configurations"]["cluster-env"]["properties"]["security_enabled"].lower()
 == "true":
+      # Set the master's UI to readonly
       putHbaseSiteProperty('hbase.master.ui.readonly', 'true')
 
       phoenix_query_server_hosts = 
self.get_phoenix_query_server_hosts(services, hosts)
+      Logger.debug("Calculated Phoenix Query Server hosts: %s" % 
str(phoenix_query_server_hosts))
       if phoenix_query_server_hosts:
+        Logger.debug("Attempting to update hadoop.proxyuser.HTTP.hosts with 
%s" % str(phoenix_query_server_hosts))
         # The PQS hosts we want to ensure are set
         new_value = ','.join(phoenix_query_server_hosts)
         # Compute the unique set of hosts for the property
         def updateCallback(originalValue, newValue):
+          Logger.debug("Original hadoop.proxyuser.HTTP.hosts value %s, 
appending %s" % (originalValue, newValue))
           # Only update the original value if it's not whitespace only
           if originalValue and not originalValue.isspace():
             hosts = originalValue.split(',')
             # Add in the new hosts if we have some
             if newValue and not newValue.isspace():
               hosts.extend(newValue.split(','))
-            # Return the combined (unique) list of hosts
-            return ','.join(set(hosts))
+            # Return the combined (uniqued) list of hosts
+            result = ','.join(set(hosts))
+            Logger.debug("Setting final to %s" % result)
+            return result
           else:
+            Logger.debug("Setting final value to %s" % newValue)
             return newValue
         # Update the proxyuser setting, deferring to out callback to merge 
results together
         appendCoreSiteProperty('hadoop.proxyuser.HTTP.hosts', new_value, 
updateCallback)
+      else:
+        Logger.debug("No phoenix query server hosts to update")
     else:
       putHbaseSiteProperty('hbase.master.ui.readonly', 'false')
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/26ddeca7/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
index d61de7b..46e9f47 100644
--- a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
@@ -5716,7 +5716,7 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertTrue('properties' in configurations['core-site'])
     # Avoid an unnecessary sort in the stack advisor, sort here for easy 
comparison
     actualHosts = 
configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
-    expectedHosts = 
configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
+    expectedHosts = 
expected_configuration['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
     self.assertEquals(splitAndSort(actualHosts), splitAndSort(expectedHosts))
     # Do a simple check for hbase-site
     self.assertTrue('hbase-site' in configurations)
@@ -5841,7 +5841,7 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertTrue('hadoop.proxyuser.HTTP.hosts' in 
configurations['core-site']['properties'])
     # Avoid an unnecessary sort in the stack advisor, sort here for easy 
comparison
     actualHosts = 
configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
-    expectedHosts = 
configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
+    expectedHosts = 
expected_configuration['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
     self.assertEquals(splitAndSort(actualHosts), splitAndSort(expectedHosts))
     # Do a simple check for hbase-site
     self.assertTrue('hbase-site' in configurations)
@@ -5967,7 +5967,7 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertTrue('properties' in configurations['core-site'])
     # Avoid an unnecessary sort in the stack advisor, sort here for easy 
comparison
     actualHosts = 
configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
-    expectedHosts = 
configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
+    expectedHosts = 
expected_configuration['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
     self.assertEquals(splitAndSort(actualHosts), splitAndSort(expectedHosts))
     # Do a simple check for hbase-site
     self.assertTrue('hbase-site' in configurations)

Reply via email to