[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
don't get running the slapd while using mdb backend
- To: openldap-technical@openldap.org
- Subject: don't get running the slapd while using mdb backend
- From: Meike Stone <meike.stone@googlemail.com>
- Date: Fri, 18 Jan 2013 10:59:21 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=TExSmgvNzM2Lt2cS1gXv1v6Bmk7RjcUAu8Fd5S8j9oA=; b=tbeLH0008qW7IX6/NOvcQRvyOArKx2tHYEkxdRhwAVTZ1KdaUYizOxBW8Mh97e9qvp olZUzUF4OvtQM7jruWM+t3App7vnwuEifEQAS26M1oAaNWpBOLAvLA+n5N5raGqVFenj 9QENgmrhMGKwR/rwkesnL6It9+xXyOfRHdud1KOwE9MmtvDNlBJHXogaSvPUBDaN95Sg 968auHteYWawZaDu2S8xhCOqz6+GsjDcqgrUwDMXNbsD3E3eTWU+ZpQCObpsIkIcbqkK CxLWcT77T+QqedxBUbnG8J2bs8V0BnFYn4y/fC8CNPNr0ma7P+RQnixBQoBd7j2VotoV JnWw==
Hello,
because of problems with bdb (virtual memory using and glibc) and
limitiations (IDL),
I want migrate to mdb.
So my first question:
Does mdb have limitations like bdb it have aka BDB_IDL_LOGN?
Second, I set up an small lab for tests with mdb and don't get the
slapd started
with larger mdb size (10GB).
Here the lab and test:
Start slapd with an empty /var/lib/ldap/ldap.mdb directory
I want reserve 10GByte disk space for mdb (maxsize 10737418240)
error message in syslog
==============================================================
@(#) $OpenLDAP: slapd 2.4.33 $ opensuse-buildservice@opensuse.org
daemon: IPv6 socket() failed errno=97 (Address family not supported
by protocol)
mdb_db_open: database "ou=demo" cannot be opened, err 12. Restore from backup!
backend_startup_one (type=mdb, suffix="ou=demo"): bi_db_open failed! (12)
slapd stopped.
created files from slapd while using
==============================================================
~# du -b /var/lib/ldap/ldap.mdb/*
12288 /var/lib/ldap/ldap.mdb/data.mdb
8192 /var/lib/ldap/ldap.mdb/lock.mdb
I "straced" the start of slapd, here I think is the importand
part:
==============================================================
.
.
.
stat("/var/lib/ldap/ldap.mdb", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mmap(NULL, 2101248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x7fe38f915000
brk(0x7fe3948ae000) = 0x7fe3948ae000
open("/var/lib/ldap/ldap.mdb/lock.mdb", O_RDWR|O_CREAT, 0600) = 9
fcntl(9, F_GETFD) = 0
fcntl(9, F_SETFD, FD_CLOEXEC) = 0
fcntl(9, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=1}) = 0
lseek(9, 0, SEEK_END) = 0
ftruncate(9, 8192) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, 9, 0) = 0x7fe3941e4000
open("/var/lib/ldap/ldap.mdb/data.mdb", O_RDWR|O_CREAT, 0600) = 11
read(11, "", 4096) = 0
mmap(NULL, 10737418240, PROT_READ, MAP_SHARED, 11, 0) = -1 ENOMEM
(Cannot allocate memory)
close(11) = 0
munmap(0x7fe3941e4000, 8192) = 0
close(9) = 0
.
.
.
So I tried to start slapd with the default of maxsize
-- every thing is ok --
==============================================================
If i comment out maxsize 10737418240 (use the default of 10M), start
slapd every thing is fine, slapd starts and create files:
~# du -b /var/lib/ldap/ldap.mdb/*
12288 /var/lib/ldap/ldap.mdb/data.mdb
8192 /var/lib/ldap/ldap.mdb/lock.mdb
As I understand, at first slapd start, the database file will be created
with the full size, but as sparse file? So why I don't see this, if
I use the default (maxsize 10485760)
Here my slapd.configuration file
==============================================================
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/yast.schema
include /etc/openldap/schema/rfc2307bis.schema
pidfile /var/run/slapd/slapd.pid
argsfile /var/run/slapd/slapd.args
modulepath /usr/lib/ldap
moduleload back_mdb
moduleload back_monitor
sizelimit -1
timelimit 300
disallow bind_anon
require authc
gentlehup on
tool-threads 4
serverID 001
database mdb
suffix "ou=demo"
rootdn "cn=admin"
rootpw password
directory /var/lib/ldap/ldap.mdb
loglevel 256
maxsize 10737418240
index objectClass,entryUUID,entryCSN eq
mounted filesystem for database
==============================================================
debld02:/etc/openldap # mount | grep ldap
/dev/sdb5 on /var/lib/ldap type ext3 (rw,relatime)
free space on filsystem
==============================================================
debld02:/etc/openldap # df -h | grep ldap
/dev/sdb5 30G 5.6G 23G 20% /var/lib/ldap
So I tried to create the sparse file manual
==============================================================
~# su -- ldap
~> id
uid=76(ldap) gid=70(ldap) groups=70(ldap)
~> dd if=/dev/zero of=/var/lib/ldap/ldap.mdb/test.sparse bs=1 count=0 seek=10G
0+0 records in
0+0 records out
0 bytes (0 B) copied, 1.3413e-05 s, 0.0 kB/s
~> du -b /var/lib/ldap/ldap.mdb/test.sparse
10737418240 /var/lib/ldap/ldap.mdb/test.sparse
What is going wrong with my test lab?
Thanks Meike