ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Fernandez <afernan...@hortonworks.com>
Subject Re: Question about adding our script at pre/post start and pre/post stop actions
Date Tue, 17 Jan 2017 18:44:01 GMT
Hi Adachisan,

What stack are you using?
If you're using HDP, you can modify the upgrade packs (xml files) with
additional steps like calling functions in the python files to perform any
additional logic.
E.g.,

<service name="HDFS">

 ...
  <component name="NAMENODE">
    ...
    <post-upgrade>
      <task xsi:type="execute">
      <summary>Wait for HiveServer2 Connections</summary>
      <script>scripts/namenode_upgrade.py</script>
      <function>wait_for_hive</function>
      </task>
    </post-upgrade>
 


In namenode_upgrade.py

def wait_for_hive(self, env):
  import params
  # Ensure that Hive Server is actually present in the cluster

Thanks,


Alejandro

On 1/16/17, 6:46 PM, "Hiroyuki Adachi" <hadachi@yahoo-corp.jp> wrote:

>Hello,
>
>We want to add our script at pre/post start and pre/post stop actions.
>
>When we upgrade our production environment,
>we need to check state of NameNode and wait for completion of HiveServer2
>connections, and so on.
>
>I know that we can do that with implementing custom services,
>but we do not willing to folk the code for such small jobs.
>
>Thanks,
>Hiroyuki Adachi
>
>


Mime
View raw message