- From: Seth Falcon <
>
- To:
- Subject: [chef] Re: Re: Save from recipe data to chef server
- Date: Fri, 15 Nov 2013 08:48:58 -0800
writes:
>
It is 'possible' to do this with Chef, though I can't guarantee Chef will
>
do it well. This sort of coordination is not what Chef excels at, and if
>
it is really important I would recommend using something better at
>
coordination, like Zookeeper. That said, here are some possible Chef
>
solutions:
+1 on the caveats. Chef Server doesn't provide orchestration primitives
at this time.
It is something that we discuss adding and it always helps to examples
of what would be useful.
>
3. Databags are another option. These have many of the same caveats as
>
using Node attributes as it is hard to guarantee and atomic update. The
>
most likely failure scenario is two nodes read that no one has the lock and
>
both try to add it. Since databags always overwrite with the latest data,
>
they will both 'write' the lock and proceed to cheerfully destroy
>
data.
While it really is not a good idea, if you are going go down this route,
I'd recommend using the presence/absence of a data bag (not data bag
item).
api.post("data", {:name => "lock1"})
This will only succeed if there is not already such a data bag (returns
409 if a bag named lock1 already exists). Top-level data bags are about
as light weight as you can get and get you closest to the atomic CAS
thing.
+ seth
--
Seth Falcon | Development Lead | Opscode | @sfalcon
Archive powered by MHonArc 2.6.16.