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

Re: Corrupt LDAP DB ...

On Thursday 27 October 2005 07:52 am, C.Lee Taylor wrote:
> Greetings ...
> 	For quite some time, we seem to be getting corrupt LDAP DB.  LDAP just
> stops working and we can't restarted.  Have done slap slapindex -v -c,
> but that just hangs.
I have experienced this problem before.  It was an ldap server I had running 
in UML (UserModeLinux) under Gentoo.  The problem was not related to openldap 
at all though.  I believe it was with the UML server.  A crash would result 
in corrupt database files that were inaccessible in the way that you 

> 	So, currently, we restart all the LDAP servers in readonly mode, dump
> the DB and restart LDAP in normal mode.  If a server falls overs, we
> rsync a readonly DB over the broke LDAP and start working again.

My hack was to create a cron job that would backup the ldap database nightly, 
then I wrote a small script to rm -r /var/lib/openldap-data, slapadd <backup 
file>, chown ldap -R /var/lib/openldap-data, /etc/init.d/slapd start...  This 
was not a production server, so I could get away with not putting effort into 

My point isn't necessarily that you are not alone, but rather, the issue in my 
case seemed to be resultant of the server itself crashing or causing 
problems, not openldap.  Perhaps these servers share similar problems 
external to openldap, and the result is corrupting your databases.