Mcollective sequencial execution
Mcollective is a tool to handle parallel job execution in group of systems with a message passing system as middlleware. Its effective in performing tasks like checking the status of a service, or restarting a service and much more.
Though it specialises in parallel job execution a certain set of tasks are better executed sequencially, for that purpose from Mcollective 2.0 Direct addressing is introduced with which batch processing can be performed. Direct addressing is the method of querying a system directly without performing a broadcast discovery, ofcourse the system or set of sytem's identity needs to be known to perform this.
In batch processing though there is provision to stop execution midway by aborting(Ctrl + C), this has to be performed without any knowledge of which systems were affected by the action or what was their result. I hope such a feature comes out in the future releases but for now a simple client script can do the trick...
#!/usr/bin/ruby
require 'mcollective'
include MCollective::RPC
mc = rpcclient("rpcutil")
mc.discover(:nodes => ["node1","node2"]) #custom discovery
printrpc mc.ping #execution
sleep(2)
printrpc mc.ping({"identity" => "node3"}) #discovery and execution
printrpcstats
mc.disconnect
With little changes all the agents can be run sequentially with the output displayed as and when they are executed....






