Limit reactions to percentage of hosts

10 views
Skip to first unread message

Tyler Couto

unread,
Oct 14, 2016, 4:04:24 PM10/14/16
to salt-...@googlegroups.com
We have a situation where we restart tomcat based on certain logs or a hanging http request. We have to maintain certain number of available servers while we restart others, and we do this currently by maintaining lock files on an NFS mount and conditionally restarting when the number of lock files is below a threshold.
I am wondering if there is a way to do this in salt. I can imagine a log triggering an event on the salt event bus and then using a reactor to restart the server. I know in the orchstration module I can specify the percent of machines to run parallel jobs on, but I can’t see if it’s possible to do in this case. 
Has anyone done this before? Does anyone have any suggestions?

Thanks, 
Tyler

Seth House

unread,
Oct 14, 2016, 4:11:35 PM10/14/16
to salt users list
The Reactor isn't well suited to complex operations, but you can use
the Reactor to kick off an Orchestrate run. It sounds like you already
know how to approach this using Orchestrate and that's a better
workflow anyway. That way you can test the Orchestrate file as your
building it just by calling it at the CLI. Once it's "done" then you
can just call that same thing from the Reactor.
> --
> You received this message because you are subscribed to the Google Groups
> "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to salt-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages