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

Re: DB_CONFIG file

Thank you for your help, so I understand that the DB_CONFIG file is always needed.
what are the file __db.00x?
If I want to save the ldap directory, is it suffisant to save the *.bdb (after slapd stop) or do I have to save also the other files (alock, __db*, log.*) ?
what happens with the log files, do i have to delete them regularly or do i have to save them (as mentionned in db_archive documentation) and delete them after?

I write also some remarqs below (specially at the end for the creation of DB_CONFIG)

At 16:00 29/03/06 +0200, Buchan Milne wrote:
On Tuesday 28 March 2006 16:09, Lise Didillon wrote:
> Hello,
> I use db-4.2.52 and openldap 2.3.19.
> It's the firts time I use db berkeley, and i have some questions
> 1-
> why DB_CONFIG file is needed  with slapadd and not required with ldapadd?

DB_CONFIG isn't required in either case, but in both cases, performance will
be bad without one.

> I explain what I'm doing:
> I set in slapd.conf the following db_config parameters: set_cachesize,
> set_lg_bsize, set_lg_regionmax, set_lg_max, set_lg_dir

What do you set these to (which will help evaluate some of your questions

the values are very inconsistant for moment because I am at the beginning of the work!!
I will recalculate them (I've seen the method on the openldap.org Faq-O-Matic)
set_cachesize 0 2097152 1
set_lg_bsize 2097152
set_lg_regionmax 262144
set_lg_max 1048576
set_lg_dir /var/log/db

> I have two ldif file to populate my ldap directory, one for  use with
> slapadd, one for use with ldapadd.
> when I don't have a DB_CONFIG file in the same directory as the ldap
> directory files (/var/openldap-data)  if I use slapadd to populate my ldap
> directory, it will output the following message:
> "bdb_db_open: Warning - No DB_CONFIG file found in directory
> /var/openldap-data: (2) Expect poor performance for suffix ou=confAdmin"
> and creat  a log.0000000001 file , five __db.00x files, alock file and the
> *.bdb files
> If I put a DB_CONFIG file, then slapadd don't output warning, doesn't creat
> the log.0000000001 file

If you use slapadd without the -q flag, it will still create the log files,
but in the location you set with set_lg_dir.

Hum, sorry i did'nt see that

> ,  creats the five files __db.001 to __db.005 (but
> they haven't the same size), creats  the bdb files with same size
> I don't understand why DB_CONFIG seems to be required for proper use,
> because when you run slapadd you specifie the slapd.conf file  (-f option).

slapd.conf is the configuration file for the slapd daemon, not the Berkeley
database library.

Eg, smb.conf is the configuration file for the smbd daemon, but you may still
have to configure some settings in the OpenLDAP library configuration file
(ldap.conf) or the Kerberos library configuration file (/etc/krb5.conf).

> Is the DB_CONFIG really needed?

If you want any kind of performance with more than ~1000 entries ...

it's approximatively the number of entries I want to manage correctly. But if there is only 500 entries you really tell me that I don't need to creat a DB_CONFIG file?

> 2-
> instead of that if I start ldap and use ldapadd to populate my ldap
> directory, without any DB_CONFIG file, it works fine and does'nt output any
> warning

ldapadd doesn't know anything about the database backend or library etc, since
it is operating over the LDAP protocol ...

However, I am quite sure that slapd (essentially ldapadd's interface to the
database backend) will have complained about this (via syslog).

> BUT any DB_CONFIG file is created at this time. so is that ok?  I have read
> in the slapd-bdb man page that if you have dbconfig directives in the
> slapd.conf then they will be written to the DB_CONFIG file if no such file
> existed.


The options set using this directive will
only be written to the DB_CONFIG file if no such file existed at
server startup time. This allows one to set initial values with-
out overwriting/destroying a DB_CONFIG file that was already
customized through other means.

You will then have a DB_CONFIG file anyway.

No I didn't find any DB_CONFIG file exept one but in the directory where I do the "tar xfz" to get the openldap sources (/usr/local/src/openldap-2.3.19/servers/slapd/DB_CONFIG), so I can't imagine that db is able to find it. Have you an idea?


AFAIK, this was added more to allow initial DB_CONFIG population when adding a
new bdb database via back-config than to place an initial DB_CONFIG with
using slapd.conf files.

Buchan Milne
ISP Systems Specialist