[chef] Re: app deployments w/ chef


Chronological Thread 
  • From: Graham Christensen < >
  • To:
  • Subject: [chef] Re: app deployments w/ chef
  • Date: Thu, 10 Oct 2013 14:32:20 -0500


On Thursday, October 10, 2013 at 2:25 PM, Wes Morgan wrote:

2. When running chef-client on nodes that already have some version of the app(s) running, make sure that they all run the same version and upgrade simultaneously and atomically (or as close to that as possible). So, for example, if you were storing a git rev in a data bag as the "current version I want deployed" and then one node kicked off its regular chef-client run and upgraded to that, the other nodes running that app would then still be on an old version of that code. That shouldn't happen, but it would with the simplest use of the Chef deploy resource and the splayed, regular interval chef-client runs.
 The only way I've sanely been able to handle this is do breaking deployments in two parts, so the old version and the new CAN coexist in production for some period of time. This involves (and it is what I do, for example, for DB migrations: )

1. Creating a release which adds new columns to the database and writes to them, as well as the old columns, while still reading from the old columns.
2. Waiting for the deployment to be consistent
3. Creating a second deployment which reads from the new columns and drops the old columns.

Graham




Archive powered by MHonArc 2.6.16.

§