Posts

Showing posts with the label slapd

OpenLDAP - alock package is unstable

This morning, After making some changes, I fail to start the slapd service, and this is the error log: Mar 31 10:20:30 SRVR-UParentLDAP slapd[16175]: hdb_db_open: database "dc=my,dc=domain,dc=com": alock package is unstable.                                          Mar 31 10:20:30 SRVR-UParentLDAP slapd[16175]: backend_startup_one (type=hdb, suffix=" dc=my,dc=domain,dc=com "): bi_db_open failed! (-1)                            Mar 31 10:20:30 SRVR-UParentLDAP slapd[16175]: slapd stopped.  This error's related to the file permission of ldap db in /var/lib/ldap/ . So, I just change the owner of those files to openldap: # cd /var/lib/ldap/ # chown openldap:openldap -R ./* Then, start the slapd service again: # service slapd start It works like a charm! Reference:  http://serverfault...

LDAP - Migrate the current LDAP Database to a new domain

Here is how I migrated the current LDAP database to a new domain: * Export the old LDAP database to ldif file. * Delete the old databaes * Create a new LDAP database with new domain name * Modify the exported ldif file above to fit the new domain (the root dn) * Import the modified ldif file into the new database Assuming I have a new domain name: dc=my,dc=new,dc=ldap,dc=domain And I want to move all of the existing LDAP data to the new one. I did the following steps: 0. Backup the old LDAP database: # slapcat -v -l old_ldap.ldif 1. Stop the OpenLDAP server: # service slapd stop 2. Delete old LDAP database: # cd /var/lib/ldap # rm -rf *    3. Make sure LDAP is not running: # nano /var/lib/ldap/DB_CONFIG add these following line and save: #DB_CONFIG set_cachesize 0 150000000 1 set_lg_regionmax 262144 set_lg_bsize 2097152 set_flags DB_LOG_AUTOREMOVE 4. Change the current LDAP settings:...