ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhuvnesh Chaudhary <bchaudh...@pivotal.io>
Subject Re: Service component status method code
Date Mon, 16 Nov 2015 18:54:32 GMT
Hello Constantine,

What version of ambari are you using ?

Also, You can check in the ambari agent log, it will log an entry for
service check which you can run from command line and and see the output to
debug it further. (If you don't see it by default, set debug log to be
logged in the ambari-agent.ini)

It will be of the form (example below)
/usr/bin/python2.6
/var/lib/ambari-agent/cache/stacks/PHD/3.3/services/HAWQ/package/scripts/hawqmaster.py
STATUS /var/lib/ambari-agent/data/status_command.json
/var/lib/ambari-agent/cache/stacks/PHD/3.3/services/HAWQ/package
/var/lib/ambari-agent/data/structured-out-status.json DEBUG
/var/lib/ambari-agent/data/tmp

Once you get the command, go to command line on that node and execute the
command to verify the result.
If there is no exception raised in the status, by default it will mark the
status as running i believe, you just need to ensure that there is no error
/ exception occurring during the execution performed under status method.

Thanks,
Bhuvnesh Chaudhary
Email: bchau <bchaudhary@gopivotal.com>dhary@pivotal.io
Desk: +1-650-846-1696 | Mobile: +1-973-906-6976

On Mon, Nov 16, 2015 at 1:00 AM, Constantine Yarovoy <kyarovoy@gmail.com>
wrote:

> Hi all.
>
> I'm developing my own stack for Ambari and right now I have a problem with
> component status determination procedure.
>
> I have something like this in my master component code:
>
> def status(self,env):
>  code, out = shell.call("systemctl status my-service | grep Active: | awk
> '{ print $2 }'", logoutput=True)
>  state = (False,True)[out == "active"]
>
> if not state:
>  raise ComponentIsNotRunning()
>
> If I use this code - component state in web ui is always marked as stopped.
>
> Can someone suggest what am I doing wrong ? What return value is expected
> in status method to identify component as "running" ?
>
> Thanks in advance.
>
>

Mime
View raw message