ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Tanner <tanner...@gmail.com>
Subject proper return for status() in a service script?
Date Tue, 24 Nov 2015 20:08:12 GMT
What is the proper return values for "running" and "not running" in an
Ambari service script?

If I reference the wiki, the status function should return nothing:


https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=38571133#Overview%28Ambari1.5.0orlater%29-CreateandAddtheService.1

If I reference the GlusterFS's yarn service script included in an HDP
stack, there is no return but a ComponentIsNotRunning should be rasied if
it's down.


Regardless of what I return, it seems that the internal ambari database
status gets set to "running".

ambari=# select component_name,current_state from ambari.hostcomponentstate;
  component_name   | current_state
-------------------+---------------
 ZOOKEEPER_SERVER  | STARTED
 ZOOKEEPER_CLIENT  | INSTALLED
 ZOOKEEPER_CLIENT  | INSTALLED
 TEST_CLIENT        | STARTED
 TEST_CLIENT        | STARTED
 METRICS_MONITOR   | STARTED
 METRICS_COLLECTOR | STARTED
 ZOOKEEPER_SERVER  | STARTED
 TEST_SLAVE         | STARTED                 # the service script raised
the ComponentIsNotRunning exception for this when status() was called
 METRICS_MONITOR   | STARTED
 METRICS_COLLECTOR | STARTED
 TEST_MASTER        | STARTED               # the service script raised the
ComponentIsNotRunning exception for this when status() was called
(12 rows)



I've also noticed via log statements that the status() function for the
service is called upon startup of ambari-server or during manual service
state change, but it never polls status at any regular interval. Is that
supposed to be the case? If not, how is the displayed service state ever
accurate?

Mime
View raw message