I'm trying to configure replication between two hosts using the following as a guideline:
https://www.server-world.info/en/note?os=CentOS_7&p=openldap&f=5
Here are some notes I have based on the setup I've done:
##### REPLICATION ON Master #####
[root@ldap01 ~]# more mod_syncprov.ldif dn: cn=module,cn=config objectClass: olcModuleList cn: module olcModulePath: /usr/lib64/openldap olcModuleLoad: syncprov.la
[root@ldap01 ~]# ldapadd -Y EXTERNAL -H ldapi:/// -f mod_syncprov.ldif SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 adding new entry "cn=module,cn=config"
[root@ldap01 ~]# more syncprov.ldif dn: olcOverlay=syncprov,olcDatabase={2}hdb,cn=config objectClass: olcOverlayConfig objectClass: olcSyncProvConfig olcOverlay: syncprov olcSpSessionLog: 100 [root@ldap01 ~]#
[root@ldap01 ~]# ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov.ldif SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 adding new entry "olcOverlay=syncprov,olcDatabase={2}hdb,cn=config"
[root@ldap01 ~]#
##### REPLICATION ON Slave #####
[root@ldap02 ~]# more syncrepl.ldif dn: olcDatabase={2}hdb,cn=config changetype: modify add: olcSyncRepl olcSyncRepl: rid=001 provider=ldap://172.19.33.42:389/ bindmethod=simple binddn="cn=admin,dc=ZZZ,dc=ZZZ" credentials=password searchbase="dc=ZZZ,dc=ZZZ" scope=sub schemachecking=on type=refreshAndPersist retry="30 5 300 3" interval=00:00:05:00
[root@ldap02 ~]# ldapadd -Y EXTERNAL -H ldapi:/// -f syncrepl.ldif SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 modifying entry "olcDatabase={2}hdb,cn=config"
[root@ldap02 ~]#
# Testing LDAP ldapsearch -x -b 'uid=testaccount,ou=People,dc=ZZZ,dc=ZZZ'
Both LDAP hosts work in the sense that I can authenticate to them. But replication is not working.
Please help.
TIA
--On Wednesday, August 21, 2019 2:41 PM -0400 sami's strat sami.strat@gmail.com wrote:
I'm trying to configure replication between two hosts using the following as a guideline:
If you already have an existing database, you likely need to slapcat it on the master, re-import it with slapadd, using the -q and -w flags so that a correctly contextCSN value can be stored at the database root. Then export that database and import it on the replica with the -q passed to slapadd so that the replica has a valid sync cookie.
I would also note that back-hdb is deprecated, back-mdb is the supported backend, and the default build from RedHat/CentOS should generally be updated to the current release if you want to do replication. I also strongly advise configuring delta-syncrepl based replication rather than standard sync replication.
For a current version of OpenLDAP, you have three options:
a) You can use the builds from the LTB project found at https://ltb-project.org/documentation/openldap-rpm#yum_repository. These install into /usr/local, so are isolated from the system libraries, etc. Fixes made after 2.4.48 will not be included in these builds.
b) You can use the drop-in replacement builds from Symas: https://repo.symas.com/sofl/rhel7/. Any critical fixes post 2.4.48 will be added to these builds.
c) You can build and maintain your own OpenLDAP packages.
Regards, Quanah
--
Quanah Gibson-Mount Product Architect Symas Corporation Packaged, certified, and supported LDAP solutions powered by OpenLDAP: http://www.symas.com
openldap-technical@openldap.org