OpenLDAP

From ResonantWiki

Jump to: navigation, search

Disaster Recovery

OpenLDAP stores its files in /var/lib/ldap/, and we have text dump backups in /etc/ldap/ldifs/. If the primary storage in /var/lib/ldap/ becomes corrupt, the following steps can be taken (as root) to correct it:

  1. Stop slapd (/etc/init.d/slapd stop, or you may have to pkill -9 slapd)
  2. Attempt an in-place repair:
    1. cd /var/lib/ldap
    2. db4.3_recover .
  3. Try restarting slapd (/etc/init.d/slapd start).
  4. If that didn't work, you'll have to restore from backup. Kill slapd again.
    1. cd /var/lib
    2. mv ldap ldap-yyyymmdd
    3. mkdir ldap
    4. cd /etc/ldap/ldifs
    5. slapadd < backup-daily.ldif
  5. Restart slapd. If it isn't working at this point, you're in deeper trouble than I can get you out of with a quick explanation.
Personal tools