How to Increase Size of OpenLDAP MDB Database – MDB_MAP_FULL Error Fix

ldapopenldapslapdUbuntu

I'm getting this error related to slapd service (OpenLDAP server) in syslog

mdb_idl_insert_keys: c_put id failed: MDB_MAP_FULL: Environment
mapsize limit reached (-30792)

This error comes when I'm trying to add new users on OpenLDAP, I'm using MDB database and After searching for cause of this error I came to know my MDB database size if full and I need to increase the maxsize of database but how I do that? I'm using cn=config style configuration and my OpenLDAP version is 2.44.

Best Answer

Turns out I need to change value of olcDbMaxSize attribute in my database configuration file.

I tried below and it worked.

Step 1: Create ldif file(filename.ldif) with below contents

dn: olcDatabase={2}mdb,cn=config
changetype: modify
add: olcDbMaxSize
olcDbMaxSize: 1000000000

Note : olcDbMaxSize : size in bytes

Step 2: Import above ldif file to OpenLDAP

ldapmodify -x -W -D 'cn=config' -H ldap:// -f filename.ldif

Step 3:Restart slapd service (This may not be required in cn=config style configuration)

service slapd restart