|
@@ -26,18 +26,24 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
|
|
|
parentComponentLayoutRecommendations = super(HDP23StackAdvisor, self).createComponentLayoutRecommendations(services, hosts)
|
|
|
|
|
|
hostsList = [host["Hosts"]["host_name"] for host in hosts["items"]]
|
|
|
+ hostGroups = parentComponentLayoutRecommendations["blueprint"]["host_groups"]
|
|
|
servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
|
|
|
|
|
|
- # remove HAWQSTANDBY on a single node
|
|
|
- if len(hostsList) == 1 and "HAWQ" in servicesList:
|
|
|
- components = parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"]
|
|
|
- components = [ component for component in components if component["name"] != 'HAWQSTANDBY' ]
|
|
|
- parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"] = components
|
|
|
+ if "HAWQ" in servicesList:
|
|
|
+ # remove HAWQSTANDBY on a single node
|
|
|
+ if len(hostsList) == 1:
|
|
|
+ components = parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"]
|
|
|
+ components = [component for component in components if component["name"] != 'HAWQSTANDBY']
|
|
|
+ parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"] = components
|
|
|
+
|
|
|
+ # co-locate HAWQSEGMENT with DATANODE
|
|
|
+ for host_group in hostGroups:
|
|
|
+ if {"name": "DATANODE"} in host_group["components"] and {"name": "HAWQSEGMENT"} not in host_group["components"]:
|
|
|
+ host_group["components"].append({"name": "HAWQSEGMENT"})
|
|
|
|
|
|
# co-locate PXF with NAMENODE and DATANODE
|
|
|
if "PXF" in servicesList:
|
|
|
- host_groups = parentComponentLayoutRecommendations["blueprint"]["host_groups"]
|
|
|
- for host_group in host_groups:
|
|
|
+ for host_group in hostGroups:
|
|
|
if ({"name": "NAMENODE"} in host_group["components"] or {"name": "DATANODE"} in host_group["components"]) \
|
|
|
and {"name": "PXF"} not in host_group["components"]:
|
|
|
host_group["components"].append({"name": "PXF"})
|