From atporter at gmail.com  Wed May 26 20:05:25 2010
From: atporter at gmail.com (Aaron Porter)
Date: Wed, 26 May 2010 11:05:25 -0700
Subject: [Csync2] Running multiple processes
Message-ID: <AANLkTimowpzI2veI2lRGNL6UuRc8MISENWT9lauv7lzY@mail.gmail.com>

I'd like to be able to run multiple simultaneous csync2's from a
single host, and cursory review didn't how any reason why I shouldn't.
Anything wrong with this approach? I also moved the lock file into
/var/run, saving state in /etc offends my coworkers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multiple_locks.patch
Type: text/x-patch
Size: 3837 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/csync2/attachments/20100526/23838b68/attachment.bin>

From lars.ellenberg at linbit.com  Thu May 27 14:21:10 2010
From: lars.ellenberg at linbit.com (Lars Ellenberg)
Date: Thu, 27 May 2010 14:21:10 +0200
Subject: [Csync2] Running multiple processes
In-Reply-To: <AANLkTimowpzI2veI2lRGNL6UuRc8MISENWT9lauv7lzY@mail.gmail.com>
References: <AANLkTimowpzI2veI2lRGNL6UuRc8MISENWT9lauv7lzY@mail.gmail.com>
Message-ID: <20100527122110.GJ26213@soda.linbit>

On Wed, May 26, 2010 at 11:05:25AM -0700, Aaron Porter wrote:
> I'd like to be able to run multiple simultaneous csync2's from a
> single host, and cursory review didn't how any reason why I shouldn't.

So sqlite contention has caused you some pain.

Thanks for suggesting your patch,
I'll have a closer look later, and will comment on your approach.

Meanwhile, please have a look at the patch series posted to this list by
Ard van Breemen. Maybe you can reuse some of his work, and extend it
with your needs.

http://projects.kwaak.net/twiki/bin/view/CSync2/WebHome

I have some of those merged already,
but not yet pushed back into public SVN.

Should do that sometime soon.

> Anything wrong with this approach? I also moved the lock file into
> /var/run, saving state in /etc offends my coworkers.

NACK.

This is not a "lock file", it actually is a sentinel,
more like a (temporary) configuration choice.
It should have been named "/etc/csync2.disable" or some such.

It belongs there, and will typically not exist.

Nothing is "saving state" there.
The admin may chose to create that file if need be.

csync2 only checks for existence of that file,
and exits, if it exists.

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD? and LINBIT? are registered trademarks of LINBIT, Austria.

From atporter at gmail.com  Thu May 27 19:28:04 2010
From: atporter at gmail.com (Aaron Porter)
Date: Thu, 27 May 2010 10:28:04 -0700
Subject: [Csync2] Running multiple processes
In-Reply-To: <20100527122110.GJ26213@soda.linbit>
References: <AANLkTimowpzI2veI2lRGNL6UuRc8MISENWT9lauv7lzY@mail.gmail.com>
	<20100527122110.GJ26213@soda.linbit>
Message-ID: <AANLkTilSZJLdC1_n-e_B01gzQzhUaYTawh08Di4y-7S4@mail.gmail.com>

On Thu, May 27, 2010 at 5:21 AM, Lars Ellenberg
<lars.ellenberg at linbit.com> wrote:
> Meanwhile, please have a look at the patch series posted to this list by
> Ard van Breemen. Maybe you can reuse some of his work, and extend it
> with your needs.
>
> http://projects.kwaak.net/twiki/bin/view/CSync2/WebHome

Ahh, interesting. This is looking to address many of the same issues,
but to solve a slightly different problem. My file count is larger,
but fortunately I don't have anything like the update frequency he's
attacking. I also have the benefit of being able to easily carve my
data into different trees and simply run multiple instances -- lets me
not have to worry as much about blowing up the db tables since my
"dumb" approach avoids the contention issue by isolating users.

From lars.ellenberg at linbit.com  Fri May 28 10:34:57 2010
From: lars.ellenberg at linbit.com (Lars Ellenberg)
Date: Fri, 28 May 2010 10:34:57 +0200
Subject: [Csync2] Running multiple processes
In-Reply-To: <AANLkTilSZJLdC1_n-e_B01gzQzhUaYTawh08Di4y-7S4@mail.gmail.com>
References: <AANLkTimowpzI2veI2lRGNL6UuRc8MISENWT9lauv7lzY@mail.gmail.com>
	<20100527122110.GJ26213@soda.linbit>
	<AANLkTilSZJLdC1_n-e_B01gzQzhUaYTawh08Di4y-7S4@mail.gmail.com>
Message-ID: <20100528083457.GS26213@soda.linbit>

On Thu, May 27, 2010 at 10:28:04AM -0700, Aaron Porter wrote:
> On Thu, May 27, 2010 at 5:21 AM, Lars Ellenberg
> <lars.ellenberg at linbit.com> wrote:
> > Meanwhile, please have a look at the patch series posted to this list by
> > Ard van Breemen. Maybe you can reuse some of his work, and extend it
> > with your needs.
> >
> > http://projects.kwaak.net/twiki/bin/view/CSync2/WebHome
> 
> Ahh, interesting. This is looking to address many of the same issues,
> but to solve a slightly different problem. My file count is larger,
> but fortunately I don't have anything like the update frequency he's
> attacking. I also have the benefit of being able to easily carve my
> data into different trees and simply run multiple instances -- lets me
> not have to worry as much about blowing up the db tables since my
> "dumb" approach avoids the contention issue by isolating users.

You may also just use different config files (which end up using
different data base files, anyways)

csync2 -C ${CONFIGNAME} [... usual csync2 options here ...]

will use /var/lib/csync2/${HOSTNAME}_${CONFIGNAME}.db

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD? and LINBIT? are registered trademarks of LINBIT, Austria.

