Lian – Poll /api/v1/hosts until the appropriate number of hosts are available 
or be more strict by checking for the correct host names.

Here is an ugly version of doing which checks the number of hosts required have 
registered (written in 2015 but still works): 
https://github.com/seanorama/ambari-bootstrap/blob/master/deploy/deploy-recommended-cluster.bash

Or an ansible version: 
https://github.com/hortonworks/ansible-hortonworks/blob/master/playbooks/roles/ambari-config/tasks/main.yml#L97-L111


--
Sean Roberts
@seano

From: Lian Jiang <jiangok2...@gmail.com>
Reply-To: "user@ambari.apache.org" <user@ambari.apache.org>
Date: Sunday, February 18, 2018 at 8:35 PM
To: "user@ambari.apache.org" <user@ambari.apache.org>
Subject: Re: How to run scripts on ambari client nodes after hadoop setup is 
done

Thanks Sean.

In the 100% automated process of machine preparation and hadoop cluster setup, 
it is easy for ambari server to start the server and monitor. However the 
ambari clients cannot wait ambari server to start otherwise the server and 
client lock each other (ambari server waits for all clients to be ready while 
all clients wait for server to be up). How do you solve this issue? Thanks.

On Sun, Feb 18, 2018 at 8:49 AM, Sean Roberts 
<srobe...@hortonworks.com<mailto:srobe...@hortonworks.com>> wrote:
Yes. Best method is to monitor the cluster creation status and then trigger 
your post-actions.

--
Sean Roberts

... blame the phone for typos

> On 18 Feb 2018, at 03:30, Lian Jiang 
> <jiangok2...@gmail.com<mailto:jiangok2...@gmail.com>> wrote:
>
> Hi,
>
> I am using terraform and ambari blueprint to setup hadoop cluster in cloud. I 
> want to run scripts on the ambari client hosts to install something (e.g. 
> install ExtJS for ooize, add topology_script.py into hdfs conf folder...) 
> after the hadoop is setup automatically.
>
> What's the recommended way to do this? Should I make the bootstrap scripts 
> running on the ambari client nodes check the cluster creation status?
>
> http://{ambariServerIP}:8080/api/v1/clusters/${CLUSTER_NAME}/requests/1
>
> Thanks for any clue.
>
>

Reply via email to