Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

postCreateScripts

postCreateScripts

Master Collaborator

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

1 REPLY 1
Highlighted

Re: postCreateScripts

Cloudera Employee

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?

Don't have an account?
Coming from Hortonworks? Activate your account here