ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject ambari git commit: AMBARI-14494. Generate warning on deploy wizard UI when HAWQ segment is not co-located with a datanode(Lav Jain via odiachenko).
Date Thu, 07 Jan 2016 22:12:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 bad080231 -> 1ad6fa805


AMBARI-14494. Generate warning on deploy wizard UI when HAWQ segment is not co-located with
a datanode(Lav Jain via odiachenko).


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

Branch: refs/heads/branch-2.2
Commit: 1ad6fa80502014251177a52845bec2c11019417f
Parents: bad0802
Author: Oleksandr Diachenko <odiachenko@pivotal.io>
Authored: Thu Jan 7 14:12:24 2016 -0800
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Thu Jan 7 14:12:24 2016 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.3/services/stack_advisor.py    | 93 +++++++++++---------
 1 file changed, 51 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1ad6fa80/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index 860b40d..7c476cf 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -53,50 +53,59 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
   def getComponentLayoutValidations(self, services, hosts):
     parentItems = super(HDP23StackAdvisor, self).getComponentLayoutValidations(services,
hosts)
 
-    hiveExists = "HIVE" in [service["StackServices"]["service_name"] for service in services["services"]]
-    sparkExists = "SPARK" in [service["StackServices"]["service_name"] for service in services["services"]]
-
-    if not "HAWQ" in [service["StackServices"]["service_name"] for service in services["services"]]
and not sparkExists:
-      return parentItems
-
+    servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
     childItems = []
-    hostsList = [host["Hosts"]["host_name"] for host in hosts["items"]]
-    hostsCount = len(hostsList)
 
-    componentsListList = [service["components"] for service in services["services"]]
-    componentsList = [item for sublist in componentsListList for item in sublist]
-    hawqMasterHosts = [component["StackServiceComponents"]["hostnames"][0] for component
in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQMASTER"]
-    hawqStandbyHosts = [component["StackServiceComponents"]["hostnames"][0] for component
in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQSTANDBY"]
-
-    # single node case is not analyzed because HAWQ Standby Master will not be present in
single node topology due to logic in createComponentLayoutRecommendations()
-    if len(hawqMasterHosts) == 1 and len(hawqStandbyHosts) == 1 and hawqMasterHosts == hawqStandbyHosts:
-      message = "HAWQ Standby Master and HAWQ Master should not be deployed on the same host."
-      childItems.append( { "type": 'host-component', "level": 'ERROR', "message": message,
"component-name": 'HAWQSTANDBY', "host": hawqStandbyHosts[0] } )
-
-    if len(hawqMasterHosts) ==  1 and hostsCount > 1 and self.isLocalHost(hawqMasterHosts[0]):
-      message = "HAWQ Master and Ambari Server should not be deployed on the same host. "
\
-                "If you leave them collocated, make sure to set HAWQ Master Port property
" \
-                "to a value different from the port number used by Ambari Server database."
-      childItems.append( { "type": 'host-component', "level": 'WARN', "message": message,
"component-name": 'HAWQMASTER', "host": hawqMasterHosts[0] } )
-
-    if len(hawqStandbyHosts) ==  1 and hostsCount > 1 and self.isLocalHost(hawqStandbyHosts[0]):
-      message = "HAWQ Standby Master and Ambari Server should not be deployed on the same
host. " \
-                "If you leave them collocated, make sure to set HAWQ Master Port property
" \
-                "to a value different from the port number used by Ambari Server database."
-      childItems.append( { "type": 'host-component', "level": 'WARN', "message": message,
"component-name": 'HAWQSTANDBY', "host": hawqStandbyHosts[0] } )
-
-    if "SPARK_THRIFTSERVER" in [service["StackServices"]["service_name"] for service in services["services"]]:
-      if not "HIVE_SERVER" in [service["StackServices"]["service_name"] for service in services["services"]]:
-        message = "SPARK_THRIFTSERVER requires HIVE services to be selected."
-        childItems.append( {"type": 'host-component', "level": 'ERROR', "message": messge,
"component-name": 'SPARK_THRIFTSERVER'} )
-
-    hmsHosts = [component["StackServiceComponents"]["hostnames"] for component in componentsList
if component["StackServiceComponents"]["component_name"] == "HIVE_METASTORE"][0] if hiveExists
else []
-    sparkTsHosts = [component["StackServiceComponents"]["hostnames"] for component in componentsList
if component["StackServiceComponents"]["component_name"] == "SPARK_THRIFTSERVER"][0] if sparkExists
else []
-
-    # if Spark Thrift Server is deployed but no Hive Server is deployed
-    if len(sparkTsHosts) > 0 and len(hmsHosts) == 0:
-      message = "SPARK_THRIFTSERVER requires HIVE_METASTORE to be selected/deployed."
-      childItems.append( { "type": 'host-component', "level": 'ERROR', "message": message,
"component-name": 'SPARK_THRIFTSERVER' } )
+    if "HAWQ" in servicesList:
+      hostsList = [host["Hosts"]["host_name"] for host in hosts["items"]]
+      hostsCount = len(hostsList)
+
+      componentsListList = [service["components"] for service in services["services"]]
+      componentsList = [item["StackServiceComponents"] for sublist in componentsListList
for item in sublist]
+      hawqMasterHosts = [component["hostnames"] for component in componentsList if component["component_name"]
== "HAWQMASTER"][0]
+      hawqStandbyHosts = [component["hostnames"] for component in componentsList if component["component_name"]
== "HAWQSTANDBY"][0]
+      hawqSegmentHosts = [component["hostnames"] for component in componentsList if component["component_name"]
== "HAWQSEGMENT"][0]
+      datanodeHosts = [component["hostnames"] for component in componentsList if component["component_name"]
== "DATANODE"][0]
+
+      # Generate WARNING if any HAWQSEGMENT is not colocated with a DATANODE
+      mismatchHosts = set(hawqSegmentHosts).symmetric_difference(set(datanodeHosts))
+      if len(mismatchHosts) > 0:
+        hostsString = ', '.join(mismatchHosts)
+        message = "HAWQSEGMENT is not co-located with DATANODE on the following {0} host(s):
{1}".format(len(mismatchHosts), hostsString)
+        childItems.append( { "type": 'host-component', "level": 'WARN', "message": message,
"component-name": 'HAWQSEGMENT' } )
+
+      # single node case is not analyzed because HAWQ Standby Master will not be present
in single node topology due to logic in createComponentLayoutRecommendations()
+      if len(hawqMasterHosts) == 1 and len(hawqStandbyHosts) == 1 and hawqMasterHosts ==
hawqStandbyHosts:
+        message = "HAWQ Standby Master and HAWQ Master should not be deployed on the same
host."
+        childItems.append( { "type": 'host-component', "level": 'ERROR', "message": message,
"component-name": 'HAWQSTANDBY', "host": hawqStandbyHosts[0] } )
+
+      if len(hawqMasterHosts) ==  1 and hostsCount > 1 and self.isLocalHost(hawqMasterHosts[0]):
+        message = "HAWQ Master and Ambari Server should not be deployed on the same host.
" \
+                  "If you leave them collocated, make sure to set HAWQ Master Port property
" \
+                  "to a value different from the port number used by Ambari Server database."
+        childItems.append( { "type": 'host-component', "level": 'WARN', "message": message,
"component-name": 'HAWQMASTER', "host": hawqMasterHosts[0] } )
+
+      if len(hawqStandbyHosts) ==  1 and hostsCount > 1 and self.isLocalHost(hawqStandbyHosts[0]):
+        message = "HAWQ Standby Master and Ambari Server should not be deployed on the same
host. " \
+                  "If you leave them collocated, make sure to set HAWQ Master Port property
" \
+                  "to a value different from the port number used by Ambari Server database."
+        childItems.append( { "type": 'host-component', "level": 'WARN', "message": message,
"component-name": 'HAWQSTANDBY', "host": hawqStandbyHosts[0] } )
+
+    if "SPARK" in servicesList:
+      if "SPARK_THRIFTSERVER" in servicesList:
+        if not "HIVE_SERVER" in servicesList:
+          message = "SPARK_THRIFTSERVER requires HIVE services to be selected."
+          childItems.append( {"type": 'host-component', "level": 'ERROR', "message": message,
"component-name": 'SPARK_THRIFTSERVER'} )
+
+      hmsHosts = [component["hostnames"] for component in componentsList
+                  if component["component_name"] == "HIVE_METASTORE"][0] if "HIVE" in servicesList
else []
+      sparkTsHosts = [component["hostnames"] for component in componentsList
+                      if component["component_name"] == "SPARK_THRIFTSERVER"][0] if "SPARK"
in servicesList else []
+
+      # if Spark Thrift Server is deployed but no Hive Server is deployed
+      if len(sparkTsHosts) > 0 and len(hmsHosts) == 0:
+        message = "SPARK_THRIFTSERVER requires HIVE_METASTORE to be selected/deployed."
+        childItems.append( { "type": 'host-component', "level": 'ERROR', "message": message,
"component-name": 'SPARK_THRIFTSERVER' } )
 
     parentItems.extend(childItems)
     return parentItems


Mime
View raw message