OpenLDAP - Programmatically update slapd configuration

5/30/2019

I'm using slapd-mdb and I'm looking for a way to programmatically update "maxsize" parameter using ldapmodify or similar: http://manpages.courier-mta.org/htmlman5/slapd-mdb.5.html

My main problem is that I have a huge dataset and I need more space.

Any suggestions on how to update OpenLDAP configuration programmatically would be appreciated.

My environment is Kubernetes and I deployed OpenLDAP as a container.

-- Michel Gokan
kubernetes
ldap
openldap

1 Answer

6/3/2019

The "Quickstart" section of the OpenLDAP documentation includes a mdb sample configuration:

dn: olcDatabase=mdb,cn=config 
objectClass: olcDatabaseConfig 
objectClass: olcMdbConfig 
olcDatabase: mdb 
OlcDbMaxSize: 1073741824 
olcSuffix: dc=<MY-DOMAIN>,dc=<COM> 
olcRootDN: cn=Manager,dc=<MY-DOMAIN>,dc=<COM> 
olcRootPW: secret 
olcDbDirectory: /usr/local/var/openldap-data 
olcDbIndex: objectClass eq
  • Replace the placeholders in olcSuffix, olcRootDN and olcRootPW with your values, change the OlcDbMaxSize value to suit your requirement.

  • Import your configration database:

su root -c /usr/local/sbin/slapadd -n 0 -F /usr/local/etc/slapd.d -l /usr/local/etc/openldap/slapd.ldif
  • Start SLAPD:
su root -c /usr/local/libexec/slapd -F /usr/local/etc/slapd.d
-- Richard Neish
Source: StackOverflow