Bacula-users

Re: [Bacula-users] How to prevent two clients to run at the same time

2009-06-22 05:43:13
Subject: Re: [Bacula-users] How to prevent two clients to run at the same time
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 22 Jun 2009 11:38:39 +0200
Hi,

22.06.2009 10:44, Frank Altpeter wrote:
> Hi list,
> 
> I'm running a bacula server with almost 100 clients on it. For
> historical and data saving reasons, each client has its own block of
> Client, Job, Storage, and Pool definition (based on client's
> fqdn).Data is saved to disk, and then, by external scripts, rotated to
> tape. According the current configuration, all clients are started via
> one Schedule on the same time and bacula is managing the run based on
> a MaximumConcurrentJobs set to 12, which runs fine so far.
> But, there's two clients, which I need to configure in a way, that
> it's impossible for them to run simultaneously. The one client is a
> vmware host system, and the other client is a vmware guest system on
> this host. And sometimes it happens that they both run in parallel
> which takes down performance on both systems.
> Because of the current structure, I'm not able to just define a
> dedicated Pool resource for these two clients and put a
> MaximumConcurrentJobs=1 into it (which AFAIK would be the easiest
> solution for default environments). So I'm searching for alternative
> solutions for my problem, which is not "start client a on 16:00 and
> client b 12 hours later"  :)
> 
> Any hints for funny solutions welcome :)

You could do some semi-manual locking with a mutex:

Let those two jobs use a run before job script that does the following:
- loop until a specified flag file (the mutex) does not exist or a 
timeout occurs
  - sleep a few minutes
- if timed out, exit with a return code of >0 so Bacula will cancel 
the job
- create the flag file

As the run after job, delete the flag file.

Some additional logic to make the mutex check be immune to race 
conditions would be needed, which needs some thinking :-)

> Besides that, wouldn't it a good point to have the
> MaximumConcurrentJobs config option also for the Schedule resource ?

Probably.

An easier solution might be to only schedule one of these jobs and 
start the other one in a run after job script, for example, so they 
unconditionally run sequentially.

Arno

-- 
Arno Lehmann
IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück
www.its-lehmann.de

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>