Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 7. Migrating the database type from BDB to LMDB on an existing DS instance
If you have an instance with the Berkeley Database (BDB) backend, you can change the BDB on this instance to Lightning Memory-Mapped Database (LMDB).
Migration from BDB to LMDB is available only for instances with Directory Server version 12.5 or later.
In mixed environment, consider the following limitations:
- You cannot use a backup to restore an instance with a different database type, because backup and restore formats are tied to this type.
- You cannot mix backends with different types on an instance.
However, the following mix of implementations is possible:
- You can mix instances with different backend types on a host.
- You can mix replicas with different types in your replicated topology.
Currently, you can use only the command line to migrate from BDB to LMDB or backwards.
7.1. Migrating the database type from BDB to LMDB using dsctl Link kopierenLink in die Zwischenablage kopiert!
You can use the dsctl utility to automatically migrate the Berkeley Database (BDB) backend on an instance to the Lightning Memory-Mapped Database (LMDB).
Prerequisites
-
You have
rootpermissions.
Procedure
Start the migration from BDB to LMDB:
dsctl instance_name dblib bdb2mdb
# dsctl instance_name dblib bdb2mdb ... Backends importation 0.000000% (userroot) Backends importation 100%Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command sets the
nsslapd-backend-implementglobal configuration parameter tomdband calculates the database size that you can adjust by setting thensslapd-mdb-max-sizeparameter value.Remove the migration
.ldiffile and the old database:dsctl instance_name dblib cleanup
# dsctl instance_name dblib cleanup cleanup dbmapdir=/var/lib/dirsrv/slapd-instance_name/db dbhome=/dev/shm/slapd-instance_name dblib=mdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Note that you can migrate back from LMDB to BDB by using the dsctl instance_name dblib mdb2bdb command.
Verification
-
Check that the
nsslapd-backend-implementconfiguration parameter value is set tomdb:
dsconf -D "cn=Directory Manager" ldap://server.example.com backend config get | grep nsslapd-backend-implement
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend config get | grep nsslapd-backend-implement
Enter password for cn=Directory Manager on ldap://server.example.com: password
nsslapd-backend-implement: mdb
7.2. Manually migrating the database type from BDB to LMDB Link kopierenLink in die Zwischenablage kopiert!
Use manual migration from the Berkeley Database (BDB) backend on an instance to the Lightning Memory-Mapped Database (LMDB) in the following cases:
-
The migration by the
dsctlutility cannot be performed. - You want to set LMDB configuration attributes manually.
Prerequisites
-
You have
rootpermissions. - You have the Directory Manager password.
Procedure
- Export all your databases to an LDIF file as described in Exporting data using the command line while the server is offline.
Determine the LMDB database maximum size by clarifying the existing databases size and adding a safety margin of 20%. Skip this step if you migrate back from LMDB to BDB.
Clarify the existing databases size:
du -hs /var/lib/dirsrv/slapd-instance_name/db/*/
# du -hs /var/lib/dirsrv/slapd-instance_name/db/*/ 1.8GBCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the safety margin of 20%:
1.8 GB + 20% = 2.16 GB
1.8 GB + 20% = 2.16 GBCopy to Clipboard Copied! Toggle word wrap Toggle overflow You require the maximum database size in the future steps.
Change the database type to LMDB on the instance and restart the instance:
dsconf instance_name backend config set --db-lib mdb dsctl instance_name restart
# dsconf instance_name backend config set --db-lib mdb Successfully updated database configuration # dsctl instance_name restart Instance "instance_name" has been restartedCopy to Clipboard Copied! Toggle word wrap Toggle overflow When you migrate back from LMDB to BDB, set the
--db-liboption tobdb.Set the LMDB maximum size to the value you calculated in the previous steps (2.16 GB) in bytes and restart the instance:
dsconf instance_name backend config set --mdb-max-size 2319282339 dsctl instance_name restart
# dsconf instance_name backend config set --mdb-max-size 2319282339 Successfully updated database configuration # dsctl instance_name restart Instance "instance_name" has been restartedCopy to Clipboard Copied! Toggle word wrap Toggle overflow The command sets the
nsslapd-mdb-max-sizeconfiguration parameter value.NoteSkip this step if you migrate back from LMDB to BDB.
- Import all databases from the LDIF file as described in Importing data using the command line while the server is offline.
Verification
-
Check that the
nsslapd-backend-implementconfiguration parameter value is set tomdb:
dsconf -D "cn=Directory Manager" ldap://server.example.com backend config get | grep nsslapd-backend-implement
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend config get | grep nsslapd-backend-implement
Enter password for cn=Directory Manager on ldap://server.example.com: password
nsslapd-backend-implement: mdb