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

Re: bdb corruped files and missing last records



I apologize for taking so long to get this to you... I've been burried in
various problems (had a motherboard fail on a primary server at home,
multiple hardware and software problems at work, and, some other issues).

Finally starting to crawl out from under the rubble. :-)

Anyway... To your questions...

Documentation is in the LDAP FAQ in various places, and, google searches
for OpenLDAP BDB Cache will help.  I apologize, I don't remember exactly
where I found all the bits and pieces.

Here are my config file fragments:

>From slapd.conf:

# Entry Cache Size (number of entries)
cachesize       5000

# IDL Cache Size (search results cache, number of searches)
idlcachesize    20000

# Transactional checkpoint
#               kbytes  minutes
checkpoint      512     5
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory       /var/lib/ldap

# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,givenname              eq,pres,sub
index gecos,sn,employeetype             eq,pres,sub
index authorizedService                 eq,pres
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub


Then, in /var/lib/ldap/DB_CONFIG:
# In Memory Cache Size
set_cachesize   0       8388608         0

# Database Flags
#set_flags      DB_TXN_NOSYNC   # Don't immediately flush txn logs.
Dangerous

# Log Values
set_lg_regionmax        1048576
set_lg_max              10485760
set_lg_bsize            2097152
set_lg_dir              /var/lib/ldap/bdb-logs

# Temporary file location
set_tmp_dir             /tmp

Now, Ideally, /var/lib/ldap/bdb-logs should be somewhere else, preferably
on a different filesystem.  That's not feasible in my environment, and,
I'm running some additional risk as a result.

Finally, in the startup, you want to make sure that you perform the
following steps:

slapd_db_recover -h /var/lib/ldap
slaptest -f {yourpath}/slapd.conf
chown -R {ldapuser}.{ldapgroup} /var/lib/ldap
slapd -u {ldapuser} -h {your LDAP URIs} {LDAPOPTIONS} {SLAPDOPTIONS}

Hope that helps.

Owen

Attachment: pgpuSkld90hIR.pgp
Description: PGP signature