[chef] Re: Re: Re: Re: Re: run the chef-client in multiple nodes at a single time


Chronological Thread 
  • From: Dylan Northrup < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: run the chef-client in multiple nodes at a single time
  • Date: Mon, 25 Feb 2013 15:38:33 -0500

You can pass a '-C' option to specify concurrency, but in my experience it sometimes works and sometimes doesn't.

Another option I've found is to specify a DELAY value in my shell call and use that to specify the delay between chef runs for rolling restarts.  For example, if I've got a lot of boxes named 'myhost1' through 'myhost16', I'd do something similar to the following:

  knife ssh roles:myroles "DELAY=$(expr $(hostname | sed -e 's/myhost//') * 60); sleep $DELAY; sudo chef-client"

More often, I'll run that shell command on the command line using tmux and synchronized output.  I use knife to generate a list of hostnames for which I open up a new window with arbitrary many panes in it that are ssh'd to the individual hosts (using https://gist.github.com/dmytro/3984680 for the heavy lifting with a wrapper to execute the knife search command and exit if no nodes are found).

Once the panes are set up, I'll type in the command, then turn off synchronized output to execute it on a single host.  Once the single host checks out, I'll synchronize input again and hit 'enter' to run it on the rest of the boxes.  This way I can monitor input on all hosts during the rolling restart.

Hope this helps!

On Mon, Feb 18, 2013 at 10:44 AM, jfotop < " target="_blank"> > wrote:

Sorry, I missed that... Thanks!




Archive powered by MHonArc 2.6.16.

§