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

two databases replicating to one slave server doesn't work



openldap-2.1.30
berkeley db 4.2.52 + 2 patches

With the following setup (two databases), changes are sent twice to the slave
server (logs further below). Obviously, the second time the change is already
there and a replication error occurs.

MASTER
database        bdb
subordinate
suffix          "ou=Branch1,dc=my-domain,dc=com"
rootdn          "cn=Manager,dc=my-domain,dc=com"
directory       /var/lib/ldap-branch
index objectClass eq
access to attr=userPassword
        by anonymous auth
        by self write
        by * none
access to attr=shadowLastChange
        by self write
        by * read
access to *
        by * read
replica host=build-cl9.distro.conectiva tls=no
        suffix="ou=Branch1,dc=my-domain,dc=com"
        bindmethod=simple
        binddn="uid=replicator,dc=my-domain,dc=com"
        credentials="replicator"
replogfile /var/lib/replog/master-replog
database        bdb
suffix          "dc=my-domain,dc=com"
rootdn          "cn=Manager,dc=my-domain,dc=com"
rootpw          changethis
directory       /var/lib/openldap-data
index   objectClass     eq
access to attr=userPassword
        by anonymous auth
        by self write
        by * none
access to attr=shadowLastChange
        by self write
        by * read
access to *
        by * read
replica host=build-cl9.distro.conectiva tls=no
        suffix="dc=my-domain,dc=com"
        bindmethod=simple
        binddn="uid=replicator,dc=my-domain,dc=com"
        credentials="replicator"
replogfile /var/lib/replog/master-replog

I added a "description" attribute under the "uid=replicator" entry. It got sent
twice to the slave server.

/var/lib/slurpd/replica/slurpd.replog:
replica: build-cl9.distro.conectiva
time: 1089386416
dn: uid=replicator,dc=my-domain,dc=com
changetype: modify
add: description
description:: dXN1w6FyaW8gZGUgcmVwbGljYcOnw6Nv
-
replace: entryCSN
entryCSN: 2004070915:20:16Z#0x0001#0#0000
-
replace: modifiersName
modifiersName: cn=Manager,dc=my-domain,dc=com
-
replace: modifyTimestamp
modifyTimestamp: 20040709152016Z
-

LDAP log on the slave:
slapd[24432]: conn=5 fd=17 ACCEPT from IP=10.0.2.177:40993 (IP=0.0.0.0:389)
slapd[24432]: conn=6 fd=20 ACCEPT from IP=10.0.2.177:40994 (IP=0.0.0.0:389)
slapd[24447]: conn=5 op=0 BIND dn="uid=replicator,dc=my-domain,dc=com" method=128
slapd[24447]: conn=5 op=0 BIND dn="uid=replicator,dc=my-domain,dc=com" mech=simple ssf=0
slapd[24447]: conn=5 op=0 RESULT tag=97 err=0 text=
slapd[24441]: conn=6 op=0 BIND dn="uid=replicator,dc=my-domain,dc=com" method=128
slapd[24441]: conn=6 op=0 BIND dn="uid=replicator,dc=my-domain,dc=com" mech=simple ssf=0
slapd[24441]: conn=6 op=0 RESULT tag=97 err=0 text=
slapd[24447]: conn=5 op=1 MOD dn="uid=replicator,dc=my-domain,dc=com"
slapd[24447]: conn=5 op=1 MOD attr=description entryCSN modifiersName modifyTimestamp
slapd[24441]: conn=6 op=1 MOD dn="uid=replicator,dc=my-domain,dc=com"
slapd[24441]: conn=6 op=1 MOD attr=description entryCSN modifiersName modifyTimestamp
slapd[24447]: conn=5 op=1 RESULT tag=103 err=0 text=
slapd[24441]: conn=6 op=1 RESULT tag=103 err=20 text=modify/add: description: value #0 already exists

Just for fun, I replaced one of the replica lines with the IP
address of the slave host instead of its name. That is, I made
the directive different from the other one, but still pointing to
the same host.

Voilá, it started working.
So, instead of:
(...)
replica uri=ldap://build-cl9.distro.conectiva:389
(...)
replica uri=ldap://build-cl9.distro.conectiva:389
(...)

I have:
(...)
replica uri=ldap://10.0.17.107:389
(...)
replica uri=ldap://build-cl9.distro.conectiva:389
(...)

Then it works (yes, I also switched to using "uri" instead of "host"
midtesting, but that alone didn't help).
10.0.17.107 is the IP address of build-cl9.distro.conectiva. Just having
it "different" in the two replica directives seemed to be the trick.

So, is this scenario not supported? Is it a glitch? A bug? Am I mad? :)
Thanks for any input.