Return-Path: X-Original-To: apmail-ambari-user-archive@www.apache.org Delivered-To: apmail-ambari-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 341A818145 for ; Thu, 12 Nov 2015 08:30:52 +0000 (UTC) Received: (qmail 68084 invoked by uid 500); 12 Nov 2015 08:30:52 -0000 Delivered-To: apmail-ambari-user-archive@ambari.apache.org Received: (qmail 68052 invoked by uid 500); 12 Nov 2015 08:30:52 -0000 Mailing-List: contact user-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ambari.apache.org Delivered-To: mailing list user@ambari.apache.org Received: (qmail 68042 invoked by uid 99); 12 Nov 2015 08:30:51 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Nov 2015 08:30:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 84C9F1A2198 for ; Thu, 12 Nov 2015 08:30:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.999 X-Spam-Level: **** X-Spam-Status: No, score=4.999 tagged_above=-999 required=6.31 tests=[FSL_HELO_BARE_IP_2=1.999, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id wn7nQIAWc1zt for ; Thu, 12 Nov 2015 08:30:38 +0000 (UTC) Received: from relayvx11b.securemail.intermedia.net (relayvx11b.securemail.intermedia.net [64.78.52.184]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 6486C42B20 for ; Thu, 12 Nov 2015 08:30:38 +0000 (UTC) Received: from securemail.intermedia.net (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by emg-ca-1-1.localdomain (Postfix) with ESMTPS id A853C53F22 for ; Thu, 12 Nov 2015 00:30:36 -0800 (PST) Subject: Re: Ambari commandScript running on ambari server itself MIME-Version: 1.0 x-echoworx-msg-id: a0cab08c-316c-4469-91ba-686144ce43ea x-echoworx-emg-received: Thu, 12 Nov 2015 00:30:36.514 -0800 x-echoworx-action: delivered Received: from 10.254.155.14 ([10.254.155.14]) by emg-ca-1-1 (JAMES SMTP Server 2.3.2) with SMTP ID 455 for ; Thu, 12 Nov 2015 00:30:36 -0800 (PST) Received: from MBX080-W4-CO-1.exch080.serverpod.net (unknown [10.224.117.101]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emg-ca-1-1.localdomain (Postfix) with ESMTPS id 2E03153F22 for ; Thu, 12 Nov 2015 00:30:36 -0800 (PST) Received: from MBX080-W4-CO-1.exch080.serverpod.net (10.224.117.101) by MBX080-W4-CO-1.exch080.serverpod.net (10.224.117.101) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 12 Nov 2015 00:30:34 -0800 Received: from MBX080-W4-CO-1.exch080.serverpod.net ([10.224.117.101]) by mbx080-w4-co-1.exch080.serverpod.net ([10.224.117.101]) with mapi id 15.00.1044.021; Thu, 12 Nov 2015 00:30:34 -0800 From: Dmitry Sen To: "user@ambari.apache.org" Thread-Topic: Ambari commandScript running on ambari server itself Thread-Index: AQHRHK6fHMxOXiE7/Ua+AQgOLhzltp6X2qUAgAAmx7eAAA3Mcw== Date: Thu, 12 Nov 2015 08:30:33 +0000 Message-ID: <1447317033433.46142@hortonworks.com> References: ,<150f86ce7fa.ff28cc2d90983.8942318161606772019@microlution.de>,<1447314877995.79197@hortonworks.com> In-Reply-To: <1447314877995.79197@hortonworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [109.86.55.247] x-source-routing-agent: Processed Content-Type: multipart/alternative; boundary="_000_144731703343346142hortonworkscom_" --_000_144731703343346142hortonworkscom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 5. Check YOUR_MASTER_COMPONENT? for deployment and ambari server node ________________________________ From: Dmitry Sen Sent: Thursday, November 12, 2015 9:54 AM To: user@ambari.apache.org Subject: Re: Ambari commandScript running on ambari server itself Hi, You can 1. Define a new master component for your service in metainfo.xml 2. Create for your stack role_command_order.json like stacks/HDP/2.3/role_c= ommand_order.json? , add here dependency "YOUR_OTHER_COMPONENTS-START" : ["YOUR_MASTER_COMPONENT-START"], or "YOUR_OTHER_COMPONENTS-INSTALL" : ["YOUR_MASTER_COMPONENT-START"],? 3. Implement certificates generation logic at YOUR_SERVICE/1.0/scripts/mast= er_component.py . The certificates should be located under /var/lib/ambari-= server/resources/ , it's a shared directory by ambari server:8080 4. Install ambari agent on the Ambari Server node BR, Dmytro Sen ________________________________ From: Henning Kropp Sent: Wednesday, November 11, 2015 11:21 PM To: user@ambari.apache.org Subject: Re: Ambari commandScript running on ambari server itself Hi, maybe /var/lib/ambari-server/resources/custom_action_definitions/system_act= ion_definitions.xml and /var/lib/ambari-server/resources/custom_actions/scr= ipts could work for your purposes? Regards ---- On Mi, 11 Nov 2015 19:27:04 +0100 Constantine Yarovoy wrote ---- Hi! I am developing my own custom app stack and bunch of services for Ambari (n= ot related to HDP). And I have a specific requirement - run some code locally on Ambari server = right after deployment process starts but before any service components are= installed on chosen hosts. This "local" code is supposed to do 2 operations: 1) generate some files (e.g. certificates/tokens) 2) that are to be copied/distributed to all master hosts. Something similar can be found in Ansible and it's named "local-action". Is there any recommended way to declare such local command script that runs= on Ambari Server itself ? I mean, of course, I have 2 options for desired = automation, but they all "suck", I think: - I can code it in Ansible or bash and run prior to cluster deployment - I can code it in inside master commandScript's install function with Exec= ute("generate.sh > generate.out && scp generate.out user@master-host-1:/hom= e/user/"). But it'd be much better if Ambari had such functionality and I could have d= one all operations from just a single Ambari Web Ui. Any suggestions ? --_000_144731703343346142hortonworkscom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

5. Check = ;YOUR_MASTER_COMPONENT​ for deployment and ambari server node


From: Dmitry Sen <dsen@h= ortonworks.com>
Sent: Thursday, November 12, 2015 9:54 AM
To: user@ambari.apache.org
Subject: Re: Ambari commandScript running on ambari server itself
 

Hi,


You can 

1. Define a new master component for your service in metainfo.= xml

2. Create for your stack role_command_order.json like stacks/HDP/2.= 3/role_command_order.json​ , add here dependency 

"YOUR_OTHER_COMPONENTS-START" : ["YOUR_MASTER_COMPONENT-START"], 

or

"YOUR_OTHER= _COMPONENTS-INSTALL" : ["YOUR_MASTER_COMPONENT-START&qu= ot;],

3. Implement certificates generat= ion logic at YOUR_SERVICE/1.0/scripts/master_component.py . The certif= icates should be located under /var/lib/ambari-server/resources/ , it's a shared directory by ambari server:8080

4. Install ambari agent on the&nb= sp;Ambari Server node


BR,

Dmytro Sen


From: Henning Kropp <hkr= opp@microlution.de>
Sent: Wednesday, November 11, 2015 11:21 PM
To: user@ambari.apache.org
Subject: Re: Ambari commandScript running on ambari server itself
 
Hi,

maybe /var/lib/ambari-server/resources/custom_action_definitions/syste= m_action_definitions.xml and /var/lib/ambari-server/resources/custom_action= s/scripts could work for your purposes?

Regards


---- On Mi, 11 Nov 2015 19:27:04 +0100 Constantine Yarovoy <= kyarovoy@gmail.com> wrote ----

Hi!

I am developing my own custom app stack and bunch of services for Amba= ri (not related to HDP).
And I have a specific requirement - run some code locally on Ambari se= rver right after deployment process starts but before any service component= s are installed on chosen hosts.
This "local" code is supposed to do 2 operations:
1) generate some files (e.g. certificates/tokens)
2) that are to be copied/distributed to all master hosts.

Something similar can be found in Ansible and it's named "loca= l-action".

Is there any recommended way to declare such local command script that= runs on Ambari Server itself ? I mean, of course, I have 2 options for des= ired automation, but they all "suck", I think:

- I can code it in Ansible or bash and run prior to cluster deployment=
- I can code it in inside master commandScript's install function with= Execute("generate.sh > generate.out && scp generate.out us= er@master-host-1:/home/user/").

But it'd be much better if Ambari had such functionality and I could h= ave done all operations from just a single Ambari Web Ui.

Any suggestions ?

--_000_144731703343346142hortonworkscom_--