[chef] Re: Re: Re: How to deploy to nodes synchronously ?


Chronological Thread 
  • From: Robby Grossman < >
  • To:
  • Subject: [chef] Re: Re: Re: How to deploy to nodes synchronously ?
  • Date: Mon, 30 Jul 2012 20:32:25 -0400

Another option is to use the knife command with a search that will find and all the nodes, setting concurrency to some number less than your total nodes.

For example:

knife ssh "role:app_server" "sudo chef-client" -C 10

Will call chef-client on all nodes that have the "app_server" role, executing only 50 at a time. This guarantees that no more than 10 nodes will ever be mid-deploy during execution.


-- 
Robby Grossman

On Monday, July 30, 2012 at 8:26 PM, Irvin Fan wrote:

Hi Daniel,

Thanks for the tip. I think it works even though I was looking for a more precise control.

Irvin

On Mon, Jul 30, 2012 at 4:23 PM, Daniel Condomitti < " target="_blank"> > wrote:
You can use the -s option when calling chef-client:

$ chef-client -h
Usage: chef-client (options)
...
    -s, --splay SECONDS              The splay time for running at intervals, in seconds


On Monday, July 30, 2012 at 4:20 PM, Irvin Fan wrote:

I'm new to chef and still trying to understand how it works. I searched the FAQ and couldn't find the answer to this. Please forgive me if the question has been answered before.

Let's say I have 100 nodes running chef-client daemon. If I update the config for those nodes in chef-server my understanding is that all those chef-clients will detect the changes for its own node and go ahead to do whatever the recipes say to do. How can I control the process synchronously. I don't want all my 100 nodes updating at the same time because the update process may require restarting Apache. I know one way to do it is to run the chef-client in non-daemon mode. e.g. run "knife ssh <node> chef-client" on nodes one by one. I'm wondering is it possible to still run the chef-client in daemon mode but control the process on server side so that the update happens one node at a time? Maybe I can update the setting one node at a time. But how can I know the chef-client on a particular node is done so that I can move to update the setting for next node?

Thanks

Irvin






Archive powered by MHonArc 2.6.16.

§