You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by se...@web.de on 2001/12/18 23:13:36 UTC

Backup db

Hi,
i read in docu that backuping the db it is neccessary to shutdown the server. is this correct or can i simply copy the db directory without shut down the server? My problem is, that the server should not be offline during backup.

thanx
seb

Re: Backup db

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
Here's a scheme (but I've never tried anything like it).  The idea is to do
software mirroring similar to the hardware mirroring done in fancy storage
systems like EMC's or Sun's.  The idea is to replicate the database in
real-time, shut off mirroring long enough to copy the mirror to a third
location, reconnect the mirror and catch it up to the running db.

You might wrap TeeCollection around (or derive TeeCollection from)
Collection.  TeeCollection has an additional mirror collection specifier and
a queue, along with two methods activate and deactivate.  A write operation
on the underlying collection also queues the operation for the mirror
collection.  A separate thread dequeues and writes to the mirror when the
mirror is active.  This allows you to break the mirror to do a file copy and
then rapidly bring it back to life consistently.

Dealing with the race conditions would probably require a lock on the entire
database as you were deactivating all the mirror collections at a particular
instant (so the backup would be consistent).  The lock would be released as
soon as all the collections were deactivated.  Then the each collection
could be reactivated after it was copied, amortizing the catchup.

Jeff
----- Original Message -----
From: "Murray Altheim" <mu...@sun.com>
To: <xi...@xml.apache.org>
Sent: Thursday, December 20, 2001 3:22 PM
Subject: Re: Backup db


> > A hot
> > backup facility would be a great feature if someone wants to tackle
> > working on it.
>
> What would your suggestion be as to the best approach? Would serializing
> the objects to disk (as Java serializations or as XML serializations?),
> performing some type of freeze-access-and-copy of the file system, or
> something else?



Re: Backup db

Posted by Murray Altheim <mu...@sun.com>.
Kimbro Staken wrote:
> 
> I'd think a per collection write lock and copy on each collection would
> work, but it could be tough to acquire the locks on a busy system. Also if
> a collection is large an exclusive write lock on the entire collection
> could really tie it up for a long time. For a fairly simple solution it
> could work until a more granular solution could be created.

I've been considering hooking Xindice up with jCVS (java-based CVS), so
perhaps I'll spend some time over the break seeing if this makes sense.
Basically, a commit on each Document added to a Collection. That'd be
as granular as one liked.

Murray

...........................................................................
Murray Altheim, Staff Engineer          <mailto:murray.altheim&#64;sun.com>
Java and XML Software
Sun Microsystems, 1601 Willow Rd., MS UMPK17-102, Menlo Park, CA 94025

       Ernst Martin comments in 1949, "A certain degree of noise in 
       writing is required for confidence. Without such noise, the 
       writer would not know whether the type was actually printing 
       or not, so he would lose control."

Re: Backup db

Posted by Kimbro Staken <ks...@dbxmlgroup.com>.
I'd think a per collection write lock and copy on each collection would 
work, but it could be tough to acquire the locks on a busy system. Also if 
a collection is large an exclusive write lock on the entire collection 
could really tie it up for a long time. For a fairly simple solution it 
could work until a more granular solution could be created.

It's actually already possible to export the entire database to XML files 
and then import to restore. That will be really slow if there are a large 
number of documents, but it would work today to get a backup without 
shutting down the server.

On Thursday, December 20, 2001, at 04:22 PM, Murray Altheim wrote:

> Kimbro Staken wrote:
>>
>> You can copy the directory, but it isn't really safe to do so. Shutting
>> down the server insures that the data is completely consistent. A hot
>> backup facility would be a great feature if someone wants to tackle
>> working on it.
>
> What would your suggestion be as to the best approach? Would serializing
> the objects to disk (as Java serializations or as XML serializations?),
> performing some type of freeze-access-and-copy of the file system, or
> something else?
>
> Murray
>
> .........................................................................
> ..
> Murray Altheim, Staff Engineer          
> <mailto:murray.altheim&#64;sun.com>
> Java and XML Software
> Sun Microsystems, 1601 Willow Rd., MS UMPK17-102, Menlo Park, CA 94025
>
>        Ernst Martin comments in 1949, "A certain degree of noise in
>        writing is required for confidence. Without such noise, the
>        writer would not know whether the type was actually printing
>        or not, so he would lose control."
>
>
Kimbro Staken
XML Database Software, Consulting and Writing
http://www.xmldatabases.org/


Re: Backup db

Posted by Murray Altheim <mu...@sun.com>.
Kimbro Staken wrote:
> 
> You can copy the directory, but it isn't really safe to do so. Shutting
> down the server insures that the data is completely consistent. A hot
> backup facility would be a great feature if someone wants to tackle
> working on it.

What would your suggestion be as to the best approach? Would serializing
the objects to disk (as Java serializations or as XML serializations?),
performing some type of freeze-access-and-copy of the file system, or 
something else? 

Murray

...........................................................................
Murray Altheim, Staff Engineer          <mailto:murray.altheim&#64;sun.com>
Java and XML Software
Sun Microsystems, 1601 Willow Rd., MS UMPK17-102, Menlo Park, CA 94025

       Ernst Martin comments in 1949, "A certain degree of noise in 
       writing is required for confidence. Without such noise, the 
       writer would not know whether the type was actually printing 
       or not, so he would lose control."

Re: Backup db

Posted by Kimbro Staken <ks...@dbxmlgroup.com>.
You can copy the directory, but it isn't really safe to do so. Shutting 
down the server insures that the data is completely consistent. A hot 
backup facility would be a great feature if someone wants to tackle 
working on it.

On Tuesday, December 18, 2001, at 03:13 PM, <se...@web.de> wrote:

> Hi,
> i read in docu that backuping the db it is neccessary to shutdown the 
> server. is this correct or can i simply copy the db directory without 
> shut down the server? My problem is, that the server should not be 
> offline during backup.
>  
> thanx
> seb
>
Kimbro Staken
XML Database Software, Consulting and Writing
http://www.xmldatabases.org/