[chef] RE: Several machines with the same role - how to restart service node by node?


Chronological Thread 
  • From: "Fouts, Chris" < >
  • To: " " < >
  • Subject: [chef] RE: Several machines with the same role - how to restart service node by node?
  • Date: Wed, 11 Feb 2015 14:19:59 +0000
  • Accept-language: en-US

Look at Chef push jobs https://docs.chef.io/push_jobs.html. You can setup an algorithm to search all your front end machines, then iterate through your search results to

 

front_end_machines.each do |fe|

  knife job start “cookbook_to_restart_machine” fe

end

 

Chris

 

From: Rafał Radecki [mailto:
Sent: Wednesday, February 11, 2015 4:55 AM
To:
Subject: [chef] Several machines with the same role - how to restart service node by node?

 

Hi Everyone :)

 

I have a set of frontend machines with a loadbalancer on top of them. There is a need to restart a service on all of them once a new delivery package comes. I now how to do this but I do not know how to force chef to perform the restart on one node at a time FOR SURE. Loadbalancer can be asked for the status of all frontends and a decision which frontend should be made based on returned info but there is a possibility for race conditions in this case.

 

Have you done something similar? What do you propose?

 

BR,

Rafal.




Archive powered by MHonArc 2.6.16.

§