|
@@ -36,6 +36,31 @@ class LiveStatus:
|
|
"YARN", "MAPREDUCE2", "FLUME"
|
|
"YARN", "MAPREDUCE2", "FLUME"
|
|
]
|
|
]
|
|
|
|
|
|
|
|
+ CLIENT_COMPONENTS = [
|
|
|
|
+ {"serviceName" : "HBASE",
|
|
|
|
+ "componentName" : "HBASE_CLIENT"},
|
|
|
|
+ {"serviceName" : "HDFS",
|
|
|
|
+ "componentName" : "HDFS_CLIENT"},
|
|
|
|
+ {"serviceName" : "MAPREDUCE",
|
|
|
|
+ "componentName" : "MAPREDUCE_CLIENT"},
|
|
|
|
+ {"serviceName" : "ZOOKEEPER",
|
|
|
|
+ "componentName" : "ZOOKEEPER_CLIENT"},
|
|
|
|
+ {"serviceName" : "OOZIE",
|
|
|
|
+ "componentName" : "OOZIE_CLIENT"},
|
|
|
|
+ {"serviceName" : "HCATALOG",
|
|
|
|
+ "componentName" : "HCAT"},
|
|
|
|
+ {"serviceName" : "HIVE",
|
|
|
|
+ "componentName" : "HIVE_CLIENT"},
|
|
|
|
+ {"serviceName" : "YARN",
|
|
|
|
+ "componentName" : "YARN_CLIENT"},
|
|
|
|
+ {"serviceName" : "MAPREDUCE2",
|
|
|
|
+ "componentName" : "MAPREDUCE2_CLIENT"},
|
|
|
|
+ {"serviceName" : "PIG",
|
|
|
|
+ "componentName" : "PIG"},
|
|
|
|
+ {"serviceName" : "SQOOP",
|
|
|
|
+ "componentName" : "SQOOP"}
|
|
|
|
+ ]
|
|
|
|
+
|
|
COMPONENTS = [
|
|
COMPONENTS = [
|
|
{"serviceName" : "HDFS",
|
|
{"serviceName" : "HDFS",
|
|
"componentName" : "DATANODE"},
|
|
"componentName" : "DATANODE"},
|
|
@@ -118,29 +143,35 @@ class LiveStatus:
|
|
|
|
|
|
# Live status was stripped from heartbeat after revision e1718dd
|
|
# Live status was stripped from heartbeat after revision e1718dd
|
|
def build(self):
|
|
def build(self):
|
|
- global SERVICES, COMPONENTS, LIVE_STATUS, DEAD_STATUS
|
|
|
|
|
|
+ global SERVICES, CLIENT_COMPONENTS, COMPONENTS, LIVE_STATUS, DEAD_STATUS
|
|
statusCheck = StatusCheck(AmbariConfig.servicesToPidNames,
|
|
statusCheck = StatusCheck(AmbariConfig.servicesToPidNames,
|
|
AmbariConfig.pidPathesVars, self.globalConfig,
|
|
AmbariConfig.pidPathesVars, self.globalConfig,
|
|
AmbariConfig.servicesToLinuxUser)
|
|
AmbariConfig.servicesToLinuxUser)
|
|
livestatus = None
|
|
livestatus = None
|
|
- for component in self.COMPONENTS:
|
|
|
|
- if component["serviceName"] == self.service and component["componentName"] == self.component:
|
|
|
|
- serviceStatus = statusCheck.getStatus(component["componentName"])
|
|
|
|
|
|
+ component = {"serviceName" : self.service, "componentName" : self.component}
|
|
|
|
+ if component in self.COMPONENTS + self.CLIENT_COMPONENTS :
|
|
|
|
+ # CLIENT components can't have status STARTED
|
|
|
|
+ if component in self.CLIENT_COMPONENTS:
|
|
|
|
+ status = self.DEAD_STATUS
|
|
|
|
+ else:
|
|
|
|
+ serviceStatus = statusCheck.getStatus(self.component)
|
|
|
|
+
|
|
if serviceStatus is None:
|
|
if serviceStatus is None:
|
|
- logger.warn("There is no service to pid mapping for " + component["componentName"])
|
|
|
|
|
|
+ logger.warn("There is no service to pid mapping for " + self.component)
|
|
status = self.LIVE_STATUS if serviceStatus else self.DEAD_STATUS
|
|
status = self.LIVE_STATUS if serviceStatus else self.DEAD_STATUS
|
|
- livestatus ={"componentName" : component["componentName"],
|
|
|
|
- "msg" : "",
|
|
|
|
- "status" : status,
|
|
|
|
- "clusterName" : self.cluster,
|
|
|
|
- "serviceName" : self.service,
|
|
|
|
- "stackVersion": self.versionsHandler.
|
|
|
|
- read_stack_version(component["componentName"])
|
|
|
|
- }
|
|
|
|
- active_config = self.actualConfigHandler.read_actual_component(component['componentName'])
|
|
|
|
- if not active_config is None:
|
|
|
|
- livestatus['configurationTags'] = active_config
|
|
|
|
- break
|
|
|
|
|
|
+
|
|
|
|
+ livestatus ={"componentName" : self.component,
|
|
|
|
+ "msg" : "",
|
|
|
|
+ "status" : status,
|
|
|
|
+ "clusterName" : self.cluster,
|
|
|
|
+ "serviceName" : self.service,
|
|
|
|
+ "stackVersion": self.versionsHandler.
|
|
|
|
+ read_stack_version(self.component)
|
|
|
|
+ }
|
|
|
|
+ active_config = self.actualConfigHandler.read_actual_component(self.component)
|
|
|
|
+ if not active_config is None:
|
|
|
|
+ livestatus['configurationTags'] = active_config
|
|
|
|
+
|
|
logger.debug("The live status for component " + str(self.component) +\
|
|
logger.debug("The live status for component " + str(self.component) +\
|
|
" of service " + str(self.service) + " is " + str(livestatus))
|
|
" of service " + str(self.service) + " is " + str(livestatus))
|
|
return livestatus
|
|
return livestatus
|