Problem using BDB replication in OpenLDAP
Software version: Berkeley DB: 4.5.20 OpenLDAP:2.3.30
We want to configure the replication management in OpenLDAP's backend database. All write requests in OpenLDAP master site will spread to OpenLDAP client site for we have configured the backend database replication.
We mend the source code the OpenLDAP according to the rep_mgr example provide by
Berkeley DB.
A test case is executed as follow:
step 1: start openldap server site and client site; step 2: send write requests to the master site; step 3: search the master site and ensure the records are inserted in backend; database successfully;
step 4: search the client site, but not ldap entry is displayed; step 5: kill the client site process and reboot it; step 5: search the client site right now after it reboot;
Result: After step 5(reboot the client site), the search results from client site is same as the master site.
At step 4: If we intend to insert an entry into the openLDAP server with BDB client configuration via ldapadd command, it will return "the entry already exists". After the failed insert operation, if search operation is executed, one entry will be displayed.Once a insert operation is tried, the number of entries in the subsequent search will increase by 1.
My question:
Why we can not search any info during the client is normally running? But once I rebooted the client site, it worked well and could accept search requests? How to solve this problem:)
Why we can not search any info during the client is normally
running? But
once I rebooted the client site, it worked well and could accept search requests? How to solve this problem:)
There are quite a few potential problems with your approach. The first one that comes to mind is that the LDAP server has a cache. If you use BDB replication, without special measures, that cache will not be consistent with the database content. And bad stuff will happen as a result.
If I turn off cache of openldap, and configure the back-bdb as main memory state, the problem you mentioned will not occur any more.
2006/12/14, David Boreham david_list@boreham.org:
Why we can not search any info during the client is normally
running? But
once I rebooted the client site, it worked well and could accept
search
requests? How to solve this problem:)
There are quite a few potential problems with your approach. The first one that comes to mind is that the LDAP server has a cache. If you use BDB replication, without special measures, that cache will not be consistent with the database content. And bad stuff will happen as a result.