I am new to LDAP and am trying to install it for a computer cluster. I have been going through this technical quick-start guide https://www.openldap.org/doc/admin26/quickstart.html. I have completed all the steps up to 8, but the slapd configuration command at step 9 is giving me trouble.
The guide states - "You are now ready to import your configuration database for use by slapd(8), by running the command: su root -c /usr/local/sbin/slapadd -n 0 -F /usr/local/etc/slapd.d -l /usr/local/etc/openldap/slapd.ldif
"
The command I run is sudo /usr/local/sbin/slapadd -n 0 -F /usr/local/etc/slapd.d -l /usr/local/etc/openldap/slapd.ldif
All the directories listed in the command exist and the corresponding files, symbolic links, and directories also exist. When I run the command, I am met with this error slapadd: could not add entry dn="cn=config" (line=1): Closing DB...
When troubleshooting, I went back to step 8. The end of it states "Note that the specified olcDbDirectory must exist prior to starting slapd(8)." The olcDbDirectory in my slapd.ldif file is /usr/local/var/openldap-data
This directory exists, however I cannot cd into it as I do not have permissions. I was thinking that perhaps this may be one of the reasons for the error I am experiencing. Additionally, in my slapd.d
directory (/etc/ldap/slapd.d
), I have one directory and one file. These are the contents of the directory: 'cn=config' 'cn=config.ldif'
I was reading other posts and read that maybe there are not supposed to be two entries. However, I did not delete anything as I was unsure.
What steps should I take to resolve this issue? I have not found many others with the same error. An important thing to note is that we have tried installing LDAP multiple times previously. Those attempts either failed or gave us unsatisfactory results, so we ended up uninstalling them after. Perhaps we did not uninstall every file which is leading to this error. I appreciate all and any help on this issue. Please let me know if I should provide more information.
Thank you.