Reply
Expert Contributor
Posts: 119
Registered: ‎07-01-2015

postCreateScripts

I tried to configure a script for executing after the cluster is ready, but just for a specific group - for example just for workers nodes. I inserted the postCreateScripts json from cluster into the workers { } section but it did not get executed and the in the logs there is no error of info about it.

 

What would be the best way to execute some scripts after the cluster is up, but just on specific hosts?

Thanks

Cloudera Employee
Posts: 17
Registered: ‎07-25-2017

Re: postCreateScripts

[ Edited ]

The instancePostCreateScripts are run on every instance in the cluster, instead of specific group. On the other hand, bootstrap script is defined per instance template, so you can add it in

1) workers=>instance, and add bootstrapScript property along with tags.

2) or specific instance types, if it applies to all instances of that type

3) or even up in common-instance-properties if it applies to all instances

 

So what you can do, you can use bootstrapScripts or user data to store the group somewhere, and in instancePostCreateScripts, you read value, and depending upon whether the value exists, or the content of the value, you do specific things. Does it make sense?

 

Btw if you don't mind, do you want to give more details about the script that you would like to run?

Announcements