How to run a job on a single node of a selected node set

870 views
Skip to first unread message

Alexander Lehmann

unread,
Aug 15, 2015, 11:52:40 AM8/15/15
to rundeck-discuss
Ok, I have to following use-case:

I want to run a job repeatedly but only on one of a set of nodes and I wonder if there a scheduler rule or something similar for that possible.

Assume I have a node-set of machines that can run a specific job, e.g. that have the necessary resources and configs available (e.g. a mounted filesystem or a database access configured) and are currently available (this is all determined with attribute searches I assume). The job is taking long (like a few hours), so it doesn't make sense to run it on more than one node.

I want to run the job with a cron type scheduler once a day only once (i.e. on one node), if I have more than once node available, I could either imagine some kind of round robin based on the date, first in set available or a random selection of one node from the set.

If I either directly set a node name, I would be out of luck if this machine is no longer up or if I add a attribute or tag to select the node, this would have to changed to rotate the machine, so I wonder if there is some kind of first(node-set) or random(node-set) selection available (if that makes sense, I am not sure if my use-case is a valid one).

(I have asked a similar question yesterday on IRC, but I have tried to better summarize the question now, I hope).


bye, Alexander


Alex Honor

unread,
Aug 15, 2015, 12:11:48 PM8/15/15
to rundeck...@googlegroups.com
Hi Alexander,

I think what you need is found in a new kind of plugin called "Orchestrator". There's actually an example that suits your need here: https://github.com/rundeck/rundeck/blob/development/examples/example-java-orchestrator-plugin/src/main/java/org/rundeck/plugin/example/RandomSubsetOrchestratorPlugin.java

You'll have to build it from source to try it. Let us know if you need any help with that.

Thanks

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/6213e8fd-1ab3-467e-b150-5f80815b70a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alex Honor

[SimplifyOps, Inc | a...@simplifyops.com ]

Be sure to comment and vote on Rundeck Feature Development!

Alexander Lehmann

unread,
Aug 15, 2015, 6:23:36 PM8/15/15
to rundeck-discuss
Thanks, that is exactly what I was thinking. I got this working by compiling the project from source.

Emil Varona

unread,
Oct 20, 2015, 4:41:14 AM10/20/15
to rundeck-discuss
Hello,
I have a similar use case where I have a data scrub that should only run once on any of many hosts in our APP tier but only once to avoid data corruption. It sounds like this plug-in might serve my needs but the link is dead. Would you please let me know where I can find this plugin? Thanks.

Cheers,
--Emil Varona

Greg Schueler

unread,
Oct 20, 2015, 12:59:52 PM10/20/15
to rundeck...@googlegroups.com
The recent Rundeck 2.6.0 release includes a set of 3 utility Orchestrator plugins, including the "Random Subset" orchestrator.  You can set the node filter in your job, choose Random Subset orchestrator and set the count to "1" to only execute on 1 node out of your selected nodes.


Reply all
Reply to author
Forward
0 new messages