Ldap – issue with master and slave ldap configuration

ldapopenldap

I am configuring master and slave ldap configuration.

Initially I installed LDAP in Master machine and also installed on slave machine

   apt-get install -y slapd ldap-utils

while installing LDAP in master machine I configured master ldap with the details as follows:

master details

ubuntu.somedc.local
domain somedc.local
dc=somedc,dc=local

slave details

slave.mysomedc.local
domain mysomedc.local
dc=mysomedc,dc=local

In master machine i configured slave configuration inside slapd.conf file
This is the configuration that was made in slapd.conf file of master machine

        replica uri=ldap://ldaptest.somedc.local:389
        binddn="cn=somecommonname,dc=somedc,dc=local"
        bindmethod=simple credentials=********

        replogfile      /var/lib/ldap/replog

here ldaptest.somecommonname.local is my slave machine fqdn ,389 is ldap port
now i restart the replica server's slapd process i.e of ,master

/etc/init.d/slapd restart 

In slave machine i configured master configuration inside slapd.conf file
This is the configuration that was made in slapd.conf file of slave machine

updatedn cn=somecommonname,dc=somedc,dc=local
updateref ldap://ubuntu.somedc.local

here ubuntu.somedc.local is my fqdn in master server

After doing configuration i am adding users in master ldap server by using following method and expecting these users replication in slave
ldap server but the users are not showing in slave configuration.

level1.ldif file

        dn: cn=somecommonname,dc=somedc,dc=local
        objectClass: inetOrgPerson
        objectClass: posixAccount
        cn: somecommonname
        givenName: somename
        sn: office
        uid: someuid
        uidNumber: 14000
        gidNumber: 14000
        homedirectory: false
        userPassword: ********

as like that above format i created so many users and i add those users to ldap using ldapadd

ldapadd -x -D cn=admin,dc=somedc,dc=local -W -f level1.ldif

Even i am not able to do replication

To do replication i exported the master's database

slapcat -l level1.ldif 

then I copied the content to slave server using scp command, copying then if users modified in master automatically changed in slave.

  scp -r filename slave ip:root/

adding this to the slave machine.

I am not sure whether I am following correct procedure or not. If this procedure is not correct then please guide me to follow correct procedure.

Best Answer

It looks like you're attempting to use slapd.conf and slurpd.

slapd.conf is depriciated and you ought to be using slapd.d.

However, your main problem is that you're trying to use slurpd, which was completely removed in OpenLDAP 2.4. You should instead setup a syncrepl provider on your master server, and a syncrepl consumer on your "slave" (replica) server.

Related Topic