[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: observation/question on partial replication



Dan Shriver wrote:

> If I have a directory setup where the slaves each contain a data
> that are non-overlaping subtrees in the master (all the slaves
> put together do not necessarily = the master though) I can only
> get replication to function if I do the following:
>         1) load master .dbb with replicant(s) for binding to
>            slave
>         2) load master .dbb with the branch points to each of
>            the subtrees I am interested in replicating
>         3) copy master .dbb's to slave(s)
>
> I do not understand why step 2 is required (once the replicant
> is populated I should be able to push down any relevant changes
> to the slaves).  It seems that the slave (not having the branch
> to put data on has nothing "to attach data" to, even if you are
> trying to skip step 2 by replicating the branch down.

You cannot add an entry unless all the tree up to its parent
is present.

>
> Step 2 is very non-inutitive in my opinion.  Furthermore, I
> think openLDAP would be easier (and less spooky) if copying
> .dbb's was not necessary (eliminate step 1 also) especially
> since copying .dbb's can cause data corruption.

It can (and does) cause corruption only if you copy files
without stopping the master.

You should understand that replication has no information
on the status of the database before the replication process
was put in place. So, unless you start with both master and
slave perfectly empty (or possibly with barely the root entry),
you need to align master and slave by hand. There are two
possibilities: you copy the db files, or you use slapcat on the
master and slapadd (or ldapadd) on the slave, which is not
exactly the same, but produces the same result.

I understand that what you wish is a wise slurpd that keeps
in sync master and slave regardless of the status of the db
when replication is set up. Well, this implies two different
operations: 1) propagate each change the master undergoes,
triggered by the master itself, and 2) periodically perform
consistency checks on master and slave, triggered by some
external event. teh slurpd deamon performs task 1), while
nobody does task 2), which should not be needed unless
strange things happen to your dbs. All you need is a warm
start of the slave, which is best performed by copying the
files. Notice that, if when you decide to replicate things your
master is already populated by a large amount of entries,
the sync would require quite a lot, surely not comparable to
moving a dozen of files :)

Pierangelo.

--
Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 | mailto:masarati@aero.polimi.it
via La Masa 34, 20156 Milano, Italy   | http://www.aero.polimi.it/~masarati