The customization scripts are executed when certain events occur:
initialize: occurs at boot
configure: occurs once the cluster configuration file
/opt/clusterware/etc/config.yml file is detected (this is usually immediately available unless manually launching a cluster)
start: occurs once
configure phase has completed (this event often starts services)
node-started: occurs once
start complete (the node is ready)
fail: occurs should the
config.yml file not be detected after 300s
member-join: occurs when a new node has joined the cluster
member-leave: occurs when a node has left the cluster
Scripts for each of these events receive the following parameters:
If the node has not yet been configured (i.e. it is a clean boot, not a reboot), then the only parameter received is a literal
once. Otherwise no parameters are supplied.
- 1: The name of the event being run (allowing a single script to be reused for multiple events), e.g.
- 2: The role of the instance, i.e.
master (login/head node) or
slave (compute node)
- 3: The name of the cluster (allowing a single script to behave differently for particularly named clusters)
As above, plus:
- 4: Path to a file that contains information about the member
- 5: Hostname of the member
- 6: IP address of the member
We'll have additional documentation explaining customization scripts in greater detail in the near future, but hopefully this is enough to get you going!
This is most easily accomplished by writing a
configure script that checks to see whether the node it's running on has the
master role, e.g.
if [ "$2" == "master" ]; then
git clone https://github.com/jason/jobscripts
To easily determine the username of the "admin" user for the cluster, you can make use of the fact that their UID is always 1000. Something like
id -un 1000 should output their name which you can then make use of in the customization scripts.
Please keep us posted with what you come up with or what other information would be useful!