AMBARI-20459. Change required in rest address property of atlas-application 
properties to handle import-hive.sh script failure in Atlas HA mode (Ayub 
Pathan via via smohanty)


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

Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 3f8ce108ee7a369f0f61ba56c5ab3ce1cd04747b
Parents: 87d47f9
Author: Sumit Mohanty <[email protected]>
Authored: Wed Mar 15 08:40:55 2017 -0700
Committer: Sumit Mohanty <[email protected]>
Committed: Wed Mar 15 08:40:55 2017 -0700

----------------------------------------------------------------------
 .../ATLAS/0.1.0.2.3/package/scripts/params.py             | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3f8ce108/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
index a476e77..21d172b 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
@@ -35,12 +35,13 @@ from resource_management.libraries.functions.is_empty 
import is_empty
 from resource_management.libraries.functions.expect import expect
 
 
-def configs_for_ha(atlas_hosts, metadata_port, is_atlas_ha_enabled):
+def configs_for_ha(atlas_hosts, metadata_port, is_atlas_ha_enabled, 
metadata_protocol):
   """
   Return a dictionary of additional configs to merge if Atlas HA is enabled.
   :param atlas_hosts: List of hostnames that contain Atlas
   :param metadata_port: Port number
   :param is_atlas_ha_enabled: None, True, or False
+  :param metadata_protocol: http or https
   :return: Dictionary with additional configs to merge to 
application-properties if HA is enabled.
   """
   additional_props = {}
@@ -61,6 +62,11 @@ def configs_for_ha(atlas_hosts, metadata_port, 
is_atlas_ha_enabled):
     prop_name = "atlas.server.address." + id
     prop_value = curr_hostname + ":" + metadata_port
     additional_props[prop_name] = prop_value
+    if "atlas.rest.address" in additional_props:
+      additional_props["atlas.rest.address"] += "," + metadata_protocol + 
"://" + prop_value
+    else:
+      additional_props["atlas.rest.address"] = metadata_protocol + "://" + 
prop_value
+
     i += 1
 
   # This may override the existing property
@@ -164,7 +170,7 @@ else:
 # User should not have to modify this property, but still allow overriding it 
to False if multiple Atlas servers exist
 # This can be None, True, or False
 is_atlas_ha_enabled = 
default("/configurations/application-properties/atlas.server.ha.enabled", None)
-additional_ha_props = configs_for_ha(atlas_hosts, metadata_port, 
is_atlas_ha_enabled)
+additional_ha_props = configs_for_ha(atlas_hosts, metadata_port, 
is_atlas_ha_enabled, metadata_protocol)
 for k,v in additional_ha_props.iteritems():
   application_properties[k] = v
 

Reply via email to