How to Fix MDB Map Full Error
Table of Contents
Date: 11-04-2022
Overview
The MDB backend requires a setting called maxsize/olcDbMaxSize, which sets the maximum on-disk size (in bytes) of its data.mdb file. When the amount of data inside the data.mdb file reaches the maximum size, the MDB database will no longer accept any writes.
If slapd refuses to add/modify entries, check the slapd logs for the following error message:
MDB_MAP_FULL: Environment mapsize limit reached (-30792)If this message is present, you must increase the value of the maxsize/olcDbMaxSize setting to allow for more data to be added.
Increasing olcDbMaxSize (cn=config)
Create the following .ldif file:
# File: UpdateDbMaxSize.ldif
#
dn: olcDatabase={N}mdb,cn=config
changetype: modify
replace: olcDbMaxSize
olcDbMaxSize: <new size in bytes>
-The {N} represents the database number in the slapd configuration directory.
Use the ldapmodify command to set the new value in the configuration:
ldapmodify -xH ldap:/// -D dc=example,dc=com -W -f UpdateDbMaxSize.ldifThe setting takes effect immediately and does not require a restart of
slapdor a reload of the backend database.
Increasing maxsize (slapd.conf)
- Open the
slapd.confconfiguration file - Update the value of the
maxsizesetting with the new value in bytes - Test the configuration change with the
slaptestutility:
slaptest -vf /opt/symas/etc/openldap/slapd.conf- If
slaptestsucceeds, restart theslapddaemon/service; the change will not take effect until this is done.
systemctl restart slapd