ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Di Li <osji...@gmail.com>
Subject Re: custom master service can not stop
Date Thu, 29 Mar 2018 13:02:11 GMT
Not much to go with based on your example, as I assume you removed
sensitive code that actually does the stop. All I can suggest is to make
sure the stop actually stops the process and don't sit in a loop forever.
Also, it's not the stop that tells the UI a component is "stopped" or not,
it's the status call.

On Thu, Mar 29, 2018 at 8:33 AM, <xiang.dai@sky-data.cn> wrote:

> After waiting about 1 hour, it always print log as below and failed
> finally:
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> 2018-03-29 20:15:35,835 - Waiting for actual component stop
>
> ----- Original Message -----
> From: "xiang dai" <xiang.dai@sky-data.cn>
> To: dev@ambari.apache.org
> Sent: Thursday, March 29, 2018 8:14:47 PM
> Subject: custom master service can not stop
>
> Hi!
>
> I add a master service as below:
>
> <schemaVersion>2.0</schemaVersion>
> <services>
> <service>
> <name>YUM</name>
> <displayName>YUM</displayName>
> <comment>Yum Service</comment>
> <version>1.0.0</version>
> <components>
> <component>
> <name>YUM_MASTER</name>
> <displayName>Yum Master</displayName>
> <category>MASTER</category>
> <cardinality>1</cardinality>
> <commandScript>
> <script>scripts/master.py</script>
> <scriptType>PYTHON</scriptType>
> <timeout>600</timeout>
> </commandScript>
> </component>
> <component>
> <name>YUM_SLAVE</name>
> <displayName>Yum Slave</displayName>
> <category>SLAVE</category>
> <cardinality>1+</cardinality>
> <commandScript>
> <script>scripts/slave.py</script>
> <scriptType>PYTHON</scriptType>
> <timeout>600</timeout>
> </commandScript>
> </component>
> </components>
> <osSpecifics>
> <osSpecific>
> <osFamily>any</osFamily>
> </osSpecific>
> </osSpecifics>
> </service>
> </services>
> </metainfo>
>
> master.py:
>
> class Master(Script):
> def install(self, env):
> print 'Install Yum'
>
> def start(self, env):
> print 'Start Yum'
>
> def stop(self, env):
> print 'Stop Yum'
>
> def status(self, env):
> print 'Test Yum'
>
> if __name__ == "__main__":
> Master().execute()
>
> slave.py:
>
> class Slave(Script):
> def install(self, env):
> print 'Wait for Yum_Master install finish...'
>
> def start(self, env):
> print 'Wait for Yum_Master install finish...'
>
> def stop(self, env):
> print 'Wait for Yum_Master stop finish...'
>
> def status(self, env):
> print 'Wait for Yum_Master test finish...'
>
> if __name__ == "__main__":
> Slave().execute()
>
> I install it successfully, but when stop on the web UI, the master can not
> stop:
>
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> Test Yum
> 2018-03-29 19:12:54,068 - Waiting for actual component stop
>
> It hang at 35%.
>
> I follow https://cwiki.apache.org/confluence/display/AMBARI/
> Defining+a+Custom+Service, did i miss something import?
>
> Best wishes
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message