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

Re: DB_CONFIG file



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 
below)?

> 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.

> ,  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 ...

> 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.

Yes: 

"
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.

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
B.Eng,RHCE(803004789010797),LPIC-2(LPI000074592)

Attachment: pgpmPZkhU4kPC.pgp
Description: PGP signature