Repository: ambari
Updated Branches:
  refs/heads/trunk f674a5678 -> eec84460f


AMBARI-17273 - With Atlas HA enabled, atlas instance fails to come up with 
Unable to find IDs matching any local host and port binding among id1


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

Branch: refs/heads/trunk
Commit: eec84460f391ece3d9018ecf552ef66b6b270159
Parents: f674a56
Author: tbeerbower <[email protected]>
Authored: Thu Jun 16 14:07:05 2016 -0400
Committer: tbeerbower <[email protected]>
Committed: Thu Jun 16 14:07:14 2016 -0400

----------------------------------------------------------------------
 .../ATLAS/0.1.0.2.3/package/scripts/params.py   | 22 ++++++++++-
 .../configuration/application-properties.xml    |  4 +-
 .../stacks/HDP/2.5/services/stack_advisor.py    | 41 +-------------------
 .../stacks/2.5/common/test_stack_advisor.py     |  2 -
 4 files changed, 24 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eec84460/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 37236fe..614fa6b 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
@@ -131,6 +131,26 @@ else:
 # hbase
 hbase_conf_dir = "/etc/hbase/conf"
 
+# atlas HA
+atlas_hosts = sorted(default('/clusterHostInfo/atlas_server_hosts', []))
+
+id = 1
+server_ids = ""
+server_hosts = ""
+first_id = True
+for host in atlas_hosts:
+  server_id = "id" + str(id)
+  server_host = host + ":" + metadata_port
+  if first_id:
+    server_ids = server_id
+    server_hosts = server_host
+  else:
+    server_ids += "," + server_id
+    server_hosts += "\n" + "atlas.server.address." + server_id + "=" + 
server_host
+
+  id += 1
+  first_id = False
+
 atlas_search_backend = 
default("/configurations/application-properties/atlas.graph.index.search.backend",
 "")
 search_backend_solr = atlas_search_backend.startswith('solr')
 
@@ -252,4 +272,4 @@ if has_ranger_admin and stack_supports_atlas_ranger_plugin:
     'description': 'atlas repo',
     'name': repo_name,
     'type': 'atlas',
-    }
\ No newline at end of file
+    }

http://git-wip-us.apache.org/repos/asf/ambari/blob/eec84460/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml
index a5a63ba..8b523d3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/application-properties.xml
@@ -28,7 +28,7 @@
   </property>
   <property>
     <name>atlas.server.ids</name>
-    <value/>
+    <value>{{server_ids}}</value>
     <description>List of Atlas server ids for HA feature.</description>
     <value-attributes>
       <overridable>false</overridable>
@@ -38,7 +38,7 @@
   </property>
   <property>
     <name>atlas.server.address.id1</name>
-    <value/>
+    <value>{{server_hosts}}</value>
     <description>Mapping of Atlas server ids to hosts.</description>
     <value-attributes>
       <overridable>false</overridable>

http://git-wip-us.apache.org/repos/asf/ambari/blob/eec84460/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 35ad34b..01522b2 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
@@ -241,45 +241,6 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
 
     servicesList = [service["StackServices"]["service_name"] for service in 
services["services"]]
 
-    # HA
-    atlas_hosts = self.getHostNamesWithComponent("ATLAS", "ATLAS_SERVER", 
services)
-
-    if 'atlas.enableTLS' in 
services['configurations']['application-properties']['properties']:
-      ssl_enabled = 
services['configurations']['application-properties']['properties']['atlas.enableTLS']
-    else:
-      ssl_enabled = 'false'
-
-    if ssl_enabled.lower == 'true':
-      if 'atlas.server.https.port' in 
services['configurations']['application-properties']['properties']:
-        metadata_port = 
services['configurations']['application-properties']['properties']['atlas.server.https.port']
-      else:
-        metadata_port = '21443'
-    else:
-      if 'atlas.server.http.port' in 
services['configurations']['application-properties']['properties']:
-        metadata_port = 
services['configurations']['application-properties']['properties']['atlas.server.http.port']
-      else:
-        metadata_port = '21000'
-
-    id = 1
-    server_ids = ""
-    server_hosts = ""
-
-    for host in atlas_hosts:
-      server_id = "id" + str(id)
-      server_host = host+ ":" + metadata_port
-
-      if id > 1:
-        server_ids += ","
-        server_hosts += "\n" + "atlas.server.address." + server_id + "="
-
-      server_ids += server_id
-      server_hosts += server_host
-
-      id += 1
-
-    putAtlasApplicationProperty('atlas.server.ids', server_ids)
-    putAtlasApplicationProperty('atlas.server.address.id1', server_hosts)
-
     if "LOGSEARCH" in servicesList and 'logsearch-solr-env' in 
services['configurations']:
 
       if 'logsearch_solr_znode' in 
services['configurations']['logsearch-solr-env']['properties']:
@@ -1507,4 +1468,4 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
     return hosts_for_component
 
   def isComponentUsingCardinalityForLayout(self, componentName):
-    return super(HDP25StackAdvisor, self).isComponentUsingCardinalityForLayout 
(componentName) or  componentName in ['SPARK2_THRIFTSERVER', 'LIVY_SERVER']
\ No newline at end of file
+    return super(HDP25StackAdvisor, self).isComponentUsingCardinalityForLayout 
(componentName) or  componentName in ['SPARK2_THRIFTSERVER', 'LIVY_SERVER']

http://git-wip-us.apache.org/repos/asf/ambari/blob/eec84460/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 7d5a03f..f66140d 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
@@ -6428,8 +6428,6 @@ class TestHDP25StackAdvisor(TestCase):
           "atlas.graph.storage.hostname": "c6401.ambari.apache.org",
           "atlas.kafka.bootstrap.servers": "c6401.ambari.apache.org:6667",
           "atlas.kafka.zookeeper.connect": "c6401.ambari.apache.org",
-          'atlas.server.address.id1': "c6401.ambari.apache.org:21000",
-          'atlas.server.ids': "id1",
           'atlas.authorizer.impl':'ranger'
         }
       },

Reply via email to