ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbeerbo...@apache.org
Subject ambari git commit: AMBARI-16043: version_builder.py fails to run against Python 2.6 (dili)
Date Mon, 25 Apr 2016 15:39:03 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk cda7f2a3e -> 134a15daf


AMBARI-16043: version_builder.py fails to run against Python 2.6 (dili)


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

Branch: refs/heads/trunk
Commit: 134a15daf10bf1ca6079480a68acf9949424b125
Parents: cda7f2a
Author: Di Li <dili@apache.org>
Authored: Mon Apr 25 10:20:32 2016 -0400
Committer: tbeerbower <tbeerbower@hortonworks.com>
Committed: Mon Apr 25 11:38:57 2016 -0400

----------------------------------------------------------------------
 .../ATLAS/0.1.0.2.3/package/scripts/params.py   |  11 ++
 .../configuration/application-properties.xml    |  14 +++
 .../stacks/HDP/2.5/services/stack_advisor.py    |  13 ++-
 .../stacks/2.5/common/test_stack_advisor.py     | 102 ++++++++++++++++++-
 4 files changed, 138 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/134a15da/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 4191212..c86dbf9 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
@@ -156,3 +156,14 @@ for host in atlas_hosts:
 
   id += 1
   first_id = False
+
+zookeeper_port = default('/configurations/zoo.cfg/clientPort', None)
+# get comma separated list of zookeeper hosts from clusterHostInfo
+index = 0
+zookeeper_quorum = ""
+for host in config['clusterHostInfo']['zookeeper_hosts']:
+  zookeeper_quorum += host + ":" + str(zookeeper_port)
+  index += 1
+  if index < len(config['clusterHostInfo']['zookeeper_hosts']):
+    zookeeper_quorum += ","
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/134a15da/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 09cb987..99fd20f 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
@@ -42,4 +42,18 @@
       <visible>false</visible>
     </value-attributes>
   </property>
+  <property>
+    <name>atlas.graph.index.search.backend</name>
+    <value>solr5</value>
+    <description>The Atlas indexing backend (e.g. solr5).</description>
+  </property>
+  <property>
+    <name>atlas.graph.index.search.solr.mode</name>
+    <value>cloud</value>
+    <description>The Solr mode (e.g. cloud).</description>
+  </property>
+  <property>
+    <name>atlas.graph.index.search.solr.zookeeper-url</name>
+    <description>The ZooKeeper quorum setup for Solr as comma separated value.</description>
+  </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/134a15da/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 0dc92b1..7f63d0c 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
@@ -116,11 +116,22 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
     parentRecommendConfDict = super(HDP25StackAdvisor, self).getServiceConfigurationRecommenderDict()
     childRecommendConfDict = {
       "RANGER": self.recommendRangerConfigurations,
-      "HIVE": self.recommendHIVEConfigurations
+      "HIVE": self.recommendHIVEConfigurations,
+      "ATLAS": self.recommendAtlasConfigurations
     }
     parentRecommendConfDict.update(childRecommendConfDict)
     return parentRecommendConfDict
 
+  def recommendAtlasConfigurations(self, configurations, clusterData, services, hosts):
+    putAtlasApplicationProperty = self.putProperty(configurations, "application-properties",
services)
+
+    servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
+
+    include_logsearch = "LOGSEARCH" in servicesList
+    if include_logsearch:
+      logsearch_solr_znode = services["configurations"]["logsearch-solr-env"]["properties"]['logsearch_solr_znode']
+      putAtlasApplicationProperty('atlas.graph.index.search.solr.zookeeper-url', '{{zookeeper_quorum}}'
+ logsearch_solr_znode)
+
   def recommendHIVEConfigurations(self, configurations, clusterData, services, hosts):
     super(HDP25StackAdvisor, self).recommendHIVEConfigurations(configurations, clusterData,
services, hosts)
     putHiveInteractiveEnvProperty = self.putProperty(configurations, "hive-interactive-env",
services)

http://git-wip-us.apache.org/repos/asf/ambari/blob/134a15da/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 3934301..ea9a924 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
@@ -1786,6 +1786,106 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-interactive-site']['properties'],
                       expected_hive_interactive_site_empty['hive-interactive-site']['properties'])
 
+  def test_recommendAtlasConfigurations(self):
+    self.maxDiff = None
+    configurations = {
+      "application-properties": {
+        "properties": {
+          "atlas.graph.index.search.solr.zookeeper-url": ""
+        }
+      },
+      "logsearch-solr-env": {
+        "properties": {
+          "logsearch_solr_znode": "/logsearch"
+        }
+      }
+    }
+    clusterData = {
+      "cpu": 4,
+      "mapMemory": 3000,
+      "amMemory": 2000,
+      "reduceMemory": 2056,
+      "containers": 3,
+      "ramPerContainer": 256
+    }
+    expected = {
+      'application-properties': {
+        'properties': {
+          'atlas.graph.index.search.solr.zookeeper-url': '{{zookeeper_quorum}}/logsearch',
+        }
+      },
+      "logsearch-solr-env": {
+        "properties": {
+          "logsearch_solr_znode": "/logsearch"
+        }
+      }
+    }
+    services = {
+      "services": [
+        {
+          "href": "/api/v1/stacks/HDP/versions/2.2/services/ATLAS",
+          "StackServices": {
+            "service_name": "LOGSEARCH",
+            "service_version": "2.6.0.2.2",
+            "stack_name": "HDP",
+            "stack_version": "2.3"
+          },
+          "components": [
+            {
+              "StackServiceComponents": {
+                "advertise_version": "false",
+                "cardinality": "1",
+                "component_category": "MASTER",
+                "component_name": "LOGSEARCH_SOLR",
+                "display_name": "solr",
+                "is_client": "false",
+                "is_master": "true",
+                "hostnames": []
+              },
+              "dependencies": []
+            }
+          ]
+        },
+      ],
+      "configurations": {
+        "application-properties": {
+          "properties": {
+            "atlas.graph.index.search.solr.zookeeper-url": ""
+          }
+        },
+        "logsearch-solr-env": {
+          "properties": {
+            "logsearch_solr_znode": "/logsearch"
+          }
+        }
+      },
+      "changed-configurations": [ ]
+
+    }
+    hosts = {
+      "items" : [
+        {
+          "href" : "/api/v1/hosts/c6401.ambari.apache.org",
+          "Hosts" : {
+            "cpu_count" : 1,
+            "host_name" : "c6401.ambari.apache.org",
+            "os_arch" : "x86_64",
+            "os_type" : "centos6",
+            "ph_cpu_count" : 1,
+            "public_host_name" : "c6401.ambari.apache.org",
+            "rack_info" : "/default-rack",
+            "total_mem" : 1922680
+          }
+        }
+      ]
+    }
+
+    self.stackAdvisor.recommendAtlasConfigurations(configurations, clusterData, services,
hosts)
+    self.assertEquals(configurations, expected)
+
+    services['ambari-server-properties'] = {'java.home': '/usr/jdk64/jdk1.7.3_23'}
+    self.stackAdvisor.recommendAtlasConfigurations(configurations, clusterData, services,
hosts)
+    self.assertEquals(configurations, expected)
 
 
 """
@@ -1799,4 +1899,4 @@ def convertToDict(properties):
       key, sep, value = property.partition("=")
       if key:
         capacitySchedulerProperties[key] = value
-  return capacitySchedulerProperties
\ No newline at end of file
+  return capacitySchedulerProperties


Mime
View raw message