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

Re: using syncrepl for master slave relationship not working



First of all, the usual advice - 2.2.13 is too old, upgrade to the current release (2.2.24) before going any further. I count about 12 syncrepl-related bugs fixed between 2.2.13 and 2.2.24.

Personally I would suggest you use the syncrepl in 2.3 instead, even though 2.3 is only at a beta release now, as the syncrepl provider in 2.3 is much easier to use. However, since it has been totally rewritten in 2.3, you will need to re-read the documentation and make some changes to your slapd.conf files to use it.

More specific notes follow below:

Omar Al-Tabari wrote:

Hi,
I've been trying to get a consumer server started so my client machines can connect to it and authenticate from a central repository, the consumer is taking from another "provider" server, they both share the same suffix, the provider is full of users, while the consumer has only the root of the tree added to it.
the provider slapd.conf is:
*****************************************
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
include /etc/openldap/schema/redhat/autofs.schema


sessionlog 123 100

This sessionlog directive is in the wrong place, it belongs in the "database bdb" section.

the consumers slapd.conf is:

directory       /var/lib/ldap
# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub
index sambaSID                  eq
index sambaPrimaryGroupSID      eq
index sambaDomainName           eq

You should add "index entryUUID eq" here. I don't think it's mentioned in the 2.2 manpage, but it is in the 2.3 documentation.


now as i read this should do replication, when i run the command "slapd -d256 -u ldap -h "ldap:///";, this is what i get:


[root@mc openldap]# slapd -d256 -u ldap -h "ldap:///";
@(#) $OpenLDAP: slapd 2.2.13 (Aug 19 2004 21:22:15) $
root@porky.build.redhat.com:/usr/src/build/440386-i386/BUILD/openldap-2.2.13/openldap-2.2.13/build-servers/servers/slapd


bdb_initialize: Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)
bdb_initialize: Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)
bdb_db_init: Initializing BDB database
slapd starting
request 1 done
<= bdb_equality_candidates: (entryUUID) index_param failed (18)
null_callback : error code 0x32

As I mentioned above, you need an eq index for entryUUID on the consumer.

I got this error message when using -d9:

You need to upgrade to a newer version of OpenLDAP.

ber_scanf fmt (}) ber:
bdb_dn2entry("cn=syncrepl123,dc=test,dc=batelco,dc=jo")
=> bdb_dn2id( "cn=syncrepl123,dc=test,dc=batelco,dc=jo" )
<= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30990)
bdb_modify: dn2entry failed (-30990)
send_ldap_result: conn=4294967295 op=0 p=3
bdb_dn2entry("cn=syncrepl123,dc=test,dc=batelco,dc=jo")
=> bdb_dn2id( "cn=syncrepl123,dc=test,dc=batelco,dc=jo" )
<= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30990)
bdb_add: no write access to parent
send_ldap_result: conn=4294967295 op=0 p=3
null_callback : error code 0x32
be_add failed (50)
put_filter: "(objectClass=*)"
put_filter: simple
put_simple_filter: "objectClass=*"
ber_scanf fmt (m) ber:
==> limits_get: conn=4294967295 op=0 dn="cn=manager,dc=test,dc=bateclo,dc=jo"
=> bdb_search
bdb_dn2entry("dc=ldaptest,dc=batelco,dc=jo")
=> bdb_dn2id( "daptest,dc=batelco,dc=jo" )
<= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30990)
send_ldap_result: conn=4294967295 op=0 p=3
ldap_msgfree
ldap_unbind
ldap_free_connection
ldap_send_unbind
ber_flush: 7 bytes to sd 10
ldap_free_connection: actually freed



i've added this line to the consumer slapd.conf: >>> updateref ldap://ldaptest.batelco.jo any help??

i also read the following in the Syncrepl administration guide:
" When creating a provider database from the LDIF file using /slapadd/ (8), contextCSN and the syncProviderSubentry entry must be created. /slapadd -p -w/ will create a new contextCSN from the entryCSNs of the added entries. It is also possible to create the syncProviderSubentry with an appropriate contextCSN value by directly including it in the ldif file. /slapadd -p/ will preserve the provider's contextCSN or will change it to the consumer's contextCSN if it is to promote a replica to the provider's content. The syncProviderSubentry can be included in the ldif output when /slapcat/ (8) is given the /-m/ flag; the syncConsumerSubentry can be retrieved by the /-k/ flag of /slapcat/ (8).


The session log is configured by

       sessionlog <sid> <limit>

directive, where /<sid>/ is the ID of the per-scope session log in the provider server and /<limit>/ is the maximum number of session log entries the session log store can record. /<sid>/ is an integer no longer than 3 decimal digits. If the consumer server sends a synchronization cookie containing /sid=<sid>/ where /<sid>/ matches the session log ID specified in the directive, the LDAP Sync search is to utilize the session log store."

and i got the feeling i have to do something, but i dont know how or why!! can some one help me out here. please.

In 2.2 there is no way to specify the sid in the syncrepl consumer's slapd.conf, it must be provided on the command line. See the "-c" option in the slapd(8) manpage. For your example configuration "-c rid=123,sid=123" would work.


Your best bet here is to ignore all of that and use OpenLDAP 2.3 instead. All of that nonsense with Sync subentries has been removed in 2.3. There is only one sessionlog per provider in 2.3, so there is no need for a sessionlog ID. And of course, in 2.3 the syncrepl provider actually works. In 2.2 the syncrepl provider will very easily cause deadlocks and hang the entire database.

--
 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support