Repository: ambari
Updated Branches:
  refs/heads/trunk 755c5eabc -> c08cbff6e


AMBARI-18130. Atlas hooks to include atlas.rest.address config, allow editing 
in the UI, and compute value using all Atlas Servers (alejandro)


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

Branch: refs/heads/trunk
Commit: c08cbff6ee1e734620472d8edc1c659e4938c01b
Parents: 755c5ea
Author: Alejandro Fernandez <[email protected]>
Authored: Fri Aug 12 10:48:17 2016 -0700
Committer: Alejandro Fernandez <[email protected]>
Committed: Fri Aug 12 10:48:17 2016 -0700

----------------------------------------------------------------------
 .../libraries/functions/setup_atlas_hook.py            |  1 +
 .../0.7.0.2.5/configuration/application-properties.xml |  5 +----
 .../resources/stacks/HDP/2.5/services/stack_advisor.py | 13 +++++++++----
 3 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c08cbff6/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
----------------------------------------------------------------------
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
index 2fdcf9d..591c064 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/setup_atlas_hook.py
@@ -77,6 +77,7 @@ SHARED_ATLAS_HOOK_CONFIGS = set(
   "atlas.notification.kafka.service.principal",
   "atlas.notification.kafka.keytab.location",
   "atlas.cluster.name",
+  "atlas.rest.address",
 
   # Security properties
   "atlas.jaas.KafkaClient.option.serviceName",

http://git-wip-us.apache.org/repos/asf/ambari/blob/c08cbff6/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.2.5/configuration/application-properties.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.2.5/configuration/application-properties.xml
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.2.5/configuration/application-properties.xml
index 0c61d1e..95715b3 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.2.5/configuration/application-properties.xml
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.2.5/configuration/application-properties.xml
@@ -128,10 +128,7 @@
       </property>
     </depends-on>
     <value-attributes>
-      <read-only>true</read-only>
-      <editable-only-at-install>true</editable-only-at-install>
-      <overridable>false</overridable>
-      <visible>true</visible>
+      <editable-only-at-install>false</editable-only-at-install>
     </value-attributes>
     <on-ambari-upgrade add="false"/>
   </property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c08cbff6/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 92a378b..e7f9344 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
@@ -460,9 +460,12 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
     services_list = [service["StackServices"]["service_name"] for service in 
services["services"]]
     is_atlas_in_cluster = "ATLAS" in services_list
 
-    atlas_server_host_info = self.getHostWithComponent("ATLAS", 
"ATLAS_SERVER", services, hosts)
-    if is_atlas_in_cluster and atlas_server_host_info:
-      atlas_rest_host = atlas_server_host_info['Hosts']['host_name']
+    atlas_server_hosts_info = self.getHostsWithComponent("ATLAS", 
"ATLAS_SERVER", services, hosts)
+    if is_atlas_in_cluster and atlas_server_hosts_info and 
len(atlas_server_hosts_info) > 0:
+      # Multiple Atlas Servers can exist, so sort by hostname to create 
deterministic csv
+      atlas_host_names = [e['Hosts']['host_name'] for e in 
atlas_server_hosts_info]
+      if len(atlas_host_names) > 1:
+        atlas_host_names = sorted(atlas_host_names)
 
       scheme = "http"
       metadata_port = "21000"
@@ -480,7 +483,9 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
             metadata_port = 
str(services['configurations']['application-properties']['properties']['atlas.server.https.port'])
           else:
             metadata_port = atlas_server_default_https_port
-      atlas_rest_address = '{0}://{1}:{2}'.format(scheme, atlas_rest_host, 
metadata_port)
+
+      atlas_rest_address_list = ["{0}://{1}:{2}".format(scheme, hostname, 
metadata_port) for hostname in atlas_host_names]
+      atlas_rest_address = ",".join(atlas_rest_address_list)
       Logger.info("Constructing atlas.rest.address=%s" % atlas_rest_address)
     return atlas_rest_address
 

Reply via email to