ApacheDS Multi Master configuration

I am looking for help with ApacheDS Multi Master solution. I'm new to setting up LDAP solutions and so it is quite possible that I am making some pretty simple mistakes.

I have two CentOS VMs running - LDAP1 and LDAP2. Each VM has a running ApacheDS solution. LDAP1 runs ApacheDS on port 10389, and LDAP2 runs ApacheDS on port 10399.

I can connect to both servers using Apache Directory Studio without issue and see the default structures listed.

Then I imported the SevenSeas structure into LDAP1 and enabled DEBUG for LDAP1 and LDAP2 for replication by uncommenting the lines in / instances / default / conf / log 4j.properties

log4j.logger.org.apache.directory.server.PROVIDER_LOG = DEBUGGING log4j.logger.org.apache.directory.server.CONSUMER_LOG = DEBUGGING

Then I try to create a MultiMaster config in the following tutorial: http://joacim.breiler.com/apacheds/ch08s02.html

1) I turn on the replication handler in LDAP1 by importing the following LDIF

dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config 
changetype: modify 
add: ads-replReqHandler 
ads-replReqHandler: org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler

      

2) Then enable the replication handler on LDAP2 by importing the same LDIF as above

3) Then I restart both the LDAP1 and LDAP2 ApacheDS servers.

4) After rebooting the server, I check the apacheDS.log and see the following entries (on both LDAP1 and LDAP2)

[08:41:28] DEBUG [org.apache.directory.server.PROVIDER_LOG] - initializing the syncrepl provider
[08:41:28] DEBUG [org.apache.directory.server.PROVIDER_LOG] - Starting the replication consumer manager
[08:41:28] DEBUG [org.apache.directory.server.PROVIDER_LOG] - no replica logs found to initialize
[08:41:28] DEBUG [org.apache.directory.server.PROVIDER_LOG] - syncrepl provider initialized successfully

      

5) Then I import the following LDIF to LDAP2 (no errors)

dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config 
objectClass: ads-base 
objectClass: ads-replConsumer 
objectClass: top 
ads-replAliasDerefMode: never 
ads-replAttributes: * 
ads-replConsumerId: 1 
ads-replProvHostName: ldap1
ads-replProvPort: 10389 
ads-replRefreshInterval: 60000 
ads-replRefreshNPersist: true 
ads-replSearchFilter: (objectClass=*) 
ads-replSearchScope: sub 
ads-replSearchSizeLimit: 0 
ads-replSearchTimeOut: 0 
ads-replUserDn: uid=admin,ou=system 
ads-replUserPassword:: c2VjcmV0 
ads-searchBaseDN: o=SevenSeas

      

6) Then I import the following LDIF to LDAP1

dn: ads-replConsumerId=2,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config 
objectClass: ads-base 
objectClass: ads-replConsumer 
objectClass: top 
ads-replAliasDerefMode: never 
ads-replAttributes: * 
ads-replConsumerId: 2 
ads-replProvHostName: ldap2
ads-replProvPort: 10399 
ads-replRefreshInterval: 60000 
ads-replRefreshNPersist: true 
ads-replSearchFilter: (objectClass=*) 
ads-replSearchScope: sub 
ads-replSearchSizeLimit: 0 
ads-replSearchTimeOut: 0 
ads-replUserDn: uid=admin,ou=system 
ads-replUserPassword:: c2VjcmV0 
ads-searchBaseDN: o=SevenSeas

      

7) Then I try to restart the apacheDS LDAP1 and LDAP2 servers and push the following error on both servers. (Reported in ApacheDS.log

08:52:42] ERROR [org.apache.directory.server.config.ConfigPartitionReader] - An error occured while reading the configuration DN 'ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config' for the objectClass 'ads-replConsumer':
ERR_04274 Can't find an OID for the name ads-base
[08:52:42] ERROR [org.apache.directory.server.UberjarMain] - Failed to start the service.
org.apache.directory.server.config.ConfigurationException: An error occured while reading the configuration DN 'ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config' for the objectClass 'ads-replConsumer':
ERR_04274 Can't find an OID for the name ads-base
        at org.apache.directory.server.config.ConfigPartitionReader.read(ConfigPartitionReader.java:641)
        at org.apache.directory.server.config.ConfigPartitionReader.read(ConfigPartitionReader.java:600)
        at org.apache.directory.server.config.ConfigPartitionReader.read(ConfigPartitionReader.java:600)
        at org.apache.directory.server.config.ConfigPartitionReader.readConfig(ConfigPartitionReader.java:754)
        at org.apache.directory.server.config.ConfigPartitionReader.readConfig(ConfigPartitionReader.java:718)
        at org.apache.directory.server.config.ConfigPartitionReader.readConfig(ConfigPartitionReader.java:690)
        at org.apache.directory.server.ApacheDsService.start(ApacheDsService.java:177)
        at org.apache.directory.server.UberjarMain.start(UberjarMain.java:76)
        at org.apache.directory.server.UberjarMain.main(UberjarMain.java:54)

      

8) Then I reverted the pre-import config to allow server reboots

9) If I remove the following line from the LDIF used in step 5/6, then I can start the servers.

objectClass: ads-base  

      

10) Debugging (on both LDAP1 and LDAP2) reflects replication is working

[09:02:31] DEBUG [org.apache.directory.server.PROVIDER_LOG] - initializing the syncrepl provider
[09:02:31] DEBUG [org.apache.directory.server.PROVIDER_LOG] - Starting the replication consumer manager
[09:02:31] DEBUG [org.apache.directory.server.PROVIDER_LOG] - no replica logs found to initialize
[09:02:31] DEBUG [org.apache.directory.server.PROVIDER_LOG] - syncrepl provider initialized successfully

      

11) Then I log into LDAP2 and can't see the o = SevenSeas section - Which tells me that replication didn't work? Did I miss a stage?

UPDATE I was able to make more progress. While using Apache Directory Studio tool - I came across server config tabs (right click on LDAP connection). Among the tabs is the "Replication" tab. This allows you to add users. In LDAP1, I added that the consumer points to LDAP2 and to LDAP2. I added for the consumer to point to LDAP1 where BASEDN was ou = system. It looks like the consumer id should match the id given in clause 5/6.

Then I restarted both LDAP servers.

When the servers restarted, I could see them talking to each other (via the debug version). I did edit the ou_system section on LDAP1 and this was replicated to LDAP2. I than did an edit on the ou = system partition on LDAP2 and this was replicated to LDAP1.

My problem is that I cannot replicate other partitions - no matter what the BASE DN is in the consumer config.

+3


source to share


1 answer


I think we started working on the same problem at the same time. Replication to a custom partition seems to work when you set the cache to 1000 for the partition.



+1


source







All Articles