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

Re: Copying trees from one consumer to another

Nick Urbanik wrote:
Dear Howard,

Thank you for taking the time to answer.

On 22/06/10 07:34 -0700, Howard Chu wrote:
Nick Urbanik wrote:
Dear Folks,

With slurpd, copying a tree from one slave to another was like this:
1. stop slapd on both slaves.
2. netcat the directory across from one slave to the other.
3. stop slurpd on master
4. edit slurpd.status to make the time and replication number match
     by copying that for the source to that for the destination slave.
5. start everything back up.

My question with syncrepl is:

How do I copy the database for a tree from one consumer to another
consumer (of the same producer) so that the newly copied replica knows
where its replication should continue from?

Is the state for replication of the database stored in the contextCSN
of the suffix entry?

If so, does that mean that with syncrepl, the above operation is
reduced to the following three steps?

1. Stop slapd on both consumers.
2. Netcat the database from one to the other.
3. start both consumers.

The procedures you described would only have worked in the past if
all of the servers had identical architecture.

Yes, the slaves are in a cluster of eight, and are all the same

The only supported means for copying databases is using slapcat and
slapadd, which use LDIF and are architecture-independent.

But in the case where the consumers are all the same architecture, do
you see a problem with making binary copies of the database?

There is no need to stop the first consumer when running slapcat.

This puzzles me; with hundreds of updates happening per minute, some
changes will be missed during the slapcat.  Will syncrepl cope and make
the new slave identical to the master?

I quote from

    Slapcat can be run while slapd is active. However, one runs the risk
    of an inconsistent database- not from the point of slapd, but from the
    point of the applications using LDAP. For example, if a provisioning
    application performed tasks that consisted of several LDAP operations,
    and the slapcat took place concurrently with those operations, then
    there might be inconsistencies in the LDAP database from the point of
    view of that provisioning application and applications that depended
    on it. One must, therefore, be convinced something like that won't

The note here says you must convince yourself...

As already noted in other posts, the contextCSN is recorded in the suffix entry of the DB, and all replication state is based on that contextCSN. This is always the first entry that slapcat will output. As such, the contextCSN in this LDIF represents the state of that database when the slapcat began. It is possible for updates to occur while slapcat is running that will alter its output, of course. But when the consumer connects to the provider, it will sync up on everything based on the contextCSN.

  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/