Junning Cluster Scheduled Jobs on Specific nodes

scheduler
datacenter
bitbucket

#1

I am working on a BitBucket plugin that requires me to run job schedules(withCronExpression) on selected nodes within a cluster.

My question is: Is this possible and how can it be done(snippet of code pls)? Since RunMode only provides RUN_ONCE_PER_CLUSTER, or RUN_LOCALLY; which means Once across the whole cluster or Locally (Jobs scheduled to run locally) respectively.

Thank you…


#2

One path I’ve heard discussed at appweek was to run locally, but have addon specific configuration nominating the nodeId to run against. Ie, all nodes run, but check if they are ‘active’ via addon specific config, then exit early if not expected to run. The load balancer could exclude that ‘job runner’ node from web requests. All good, except you do introduce a single point of failure for your job execution…

You’ll have to code this yourself :wink: