help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: cfengine cronjob on pool of servers


From: David Masterson
Subject: RE: cfengine cronjob on pool of servers
Date: Fri, 30 Dec 2005 09:57:11 -0800

Christopher Browne wrote:
>> Can cfengine do this? Nicelly, easy and without hacks please!
>> 
>> We need to schedule a script to run on ONLY ONE of the N hosts.
>> The catch is that any host could be down at any moment in the future,
>> so schedulling cronjob on one of the hosts is not a reliable option.
>> Also the job cannot be run more that once (ie cannot be run from
>> multiple hosts).
> 
> This isn't the sort of thing that cfengine is designed to provide
> answers for.
> 
> What you actually need is some sort of central authority; part of the
> point of cfengine is to not have that vulnerability.
> 
> If I had a database server around, I'd be inclined to use it to manage
> this sort of "locking" problem.
> 
> All N hosts would *attempt* to run the cron job; they start by telling
> the DB server "I am the only one that will be running this process."
> Only one would succeed (let's say they all try to insert the desired
> time and job name into a table with unique index on time/job); the
> "winner" gets to continue and run the job.

Simplisticly, that could probably be done by creating (lock) files.  The
cfengine host that creates the file first wins.  Of course, this assumes an
NFS setup and, thus, that is the vulnerability in the scheme.

-- 
David Masterson
VMware, Inc.
Palo Alto, CA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]