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

<p>My main problem is that I have a huge dataset and I need more space.</p>

<p>Any suggestions on how to update OpenLDAP configuration programmatically would be appreciated.</p>

<p>My environment is Kubernetes and I deployed OpenLDAP as a container.</p>

<p>The <a href="http://www.openldap.org/doc/admin24/quickstart.html" rel="nofollow noreferrer">"Quickstart"</a> section of the OpenLDAP documentation includes a mdb sample configuration:</p>

<pre><code>dn: olcDatabase=mdb,cn=config 
objectClass: olcDatabaseConfig 
objectClass: olcMdbConfig 
olcDatabase: mdb 
OlcDbMaxSize: 1073741824 
olcSuffix: dc=&lt;MY-DOMAIN&gt;,dc=&lt;COM&gt; 
olcRootDN: cn=Manager,dc=&lt;MY-DOMAIN&gt;,dc=&lt;COM&gt; 
olcRootPW: secret 
olcDbDirectory: /usr/local/var/openldap-data 
olcDbIndex: objectClass eq
</code></pre>

<ul>
<li><p>Replace the placeholders in <code>olcSuffix</code>, <code>olcRootDN</code> and <code>olcRootPW</code>  with your values, change the <code>OlcDbMaxSize</code> value to suit your requirement.</p></li>
<li><p>Import your configration database:</p></li>
</ul>

<pre><code>su root -c /usr/local/sbin/slapadd -n 0 -F /usr/local/etc/slapd.d -l /usr/local/etc/openldap/slapd.ldif
</code></pre>

<ul>
<li>Start SLAPD:</li>
</ul>

<pre><code>su root -c /usr/local/libexec/slapd -F /usr/local/etc/slapd.d
</code></pre>
