I configured my system in this way: Master OpenLDAP 10.100.1.6 and slave OpenLDAP 10.100.1.7
I used this guide: https://www.itzgeek.com/how-tos/linux/configure-openldap-master-slave-replication.html and configured them so as:
vim rpuser.ldif (Master and Slave)
dn: uid=rpuser,dc=mydomain,dc=com
objectClass: simpleSecurityObject
objectclass: account
uid: rpuser
description: Replication Admin User
userPassword: secret
ldapadd -x -W -D "cn=Manager,dc=mydomain,dc=com" -f rpuser.ldif
Enable logging (Slave)
echo "local4.* /var/log/ldap.log" >> /etc/rsyslog.conf
systemctl restart rsyslog
vim /etc/default/slapd (Master)
SLAPD_SERVICES="ldapi:// ldap://LDAP01.mydomain.com"
vim /etc/default/slapd (Slave)
SLAPD_SERVICES="ldapi:// ldap://LDAP02.mydomain.com"
vim syncprov_mod.ldif (Master and Slave)
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulePath: /usr/lib64/openldap
olcModuleLoad: syncprov.la
ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov_mod.ldif
vim syncprov.ldif (Master and Slave)
dn: olcOverlay=syncprov,olcDatabase={2}hdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpSessionLog: 100
ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov.ldif
vim olcserverid.ldif (Master)
dn: cn=config
changetype: modify
add: olcServerID
olcServerID: 101
ldapmodify -Y EXTERNAL -H ldapi:/// -f olcserverid.ldif
vim olcserverid.ldif (Slave)
dn: cn=config
changetype: modify
add: olcServerID
olcServerID: 102
ldapmodify -Y EXTERNAL -H ldapi:/// -f olcserverid.ldif
vim rp.ldif (Slave)
dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=101
provider=ldap://ldap01.mydomain.com:389/
bindmethod=simple
binddn="uid=rpuser,dc=mydomain,dc=com"
credentials=secret
searchbase="dc=mydomain,dc=com"
scope=sub
schemachecking=on
type=refreshAndPersist
retry="30 5 300 3"
interval=00:00:05:00
ldapmodify -Y EXTERNAL -H ldapi:/// -f rp.ldif
The system worked for a few days but now no longer syncs.
This is the ldap.log
Sep 20 12:47:06 BCA-PRD-LDAP02 slapd[5348]: <= bdb_equality_candidates: (entryUUID) not indexed Sep 20 12:47:06 BCA-PRD-LDAP02 slapd[5348]: do_syncrep2: rid=101 LDAP_RES_SEARCH_RESULT (4) Size limit exceeded Sep 20 12:47:06 BCA-PRD-LDAP02 slapd[5348]: do_syncrep2: rid=101 (4) Size limit exceeded Sep 20 12:47:06 BCA-PRD-LDAP02 slapd[5348]: do_syncrepl: rid=101 rc -2 retrying (1 retries left) Sep 20 12:52:06 BCA-PRD-LDAP02 slapd[5348]: <= bdb_equality_candidates: (entryUUID) not indexed