How to setup replication on apache directory server

5.2k views Asked by At

I have 2 apacheds services running on workstation (Windows 7). One of the service runs as a windows service and the other one I am running from its jar file from command line using

java -jar "C:\Program Files (x86)\ApacheDS - Instance2\lib\apacheds-service-2.0.0-M15.jar"    "C:\Program Files (x86)\ApacheDS - Instance2\instances\instance2" 

The first apacheds installation is at location C:\Program Files (x86)\ApacheDS and it runs on 10389. The second service runs on port 11389. Using apache directory studio I can connect to both these instances/services running on my workstation and there are no errors on console. By using the following ldif file I have imported setting for Instance 1 which will be the master

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

Then I have also imported following ldif file to Instance 1/master -

dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
changetype: add
ads-replRefreshNPersist: TRUE
ads-replAliasDerefMode: never
ads-replProvPort: 10389
ads-replSearchSizeLimit: 0
ads-replProvHostName: localhost
objectClass: ads-replConsumer
objectClass: ads-base
ads-replUserDn: uid=admin, ou=system
ads-replRefreshInterval: 60000
ads-replUserPassword: secret
ads-replConsumerId: 1
ads-replAttributes: *
ads-replSearchTimeOut: 0
ads-replSearchScope: sub
ads-replSearchFilter: (objectClass=*)
ads-searchBaseDN: ou=system

I added a few users under ou=users, ou=system on the master but nothing gets replicated on the slave. There is no evidence on the consoles of either instances that these two instances are trying to talk and hence I think this is not the right configuration or incomplete configuration as there is nothing I could find on apacheds documentation that needs to be added as part of the consumer configuration on Instance2/Slave. Am I missing something ?

Thanks !

1

There are 1 answers

1
Aniket On BEST ANSWER

There was some bug in apacheds 2.0 - M15 Version regarding replication. That bug has been rectified already and the fix will be in M16. I built 2 separate instances from apacheds svn trunk and built the installers and ran 2 separate instances. Added following settings/config on the Provider/Master (Running on Port 10389) -

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

Added following config to the consumer/slave instance (Running on 11389) -

dn: ads-replConsumerId=1,ou=replConsumers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
changetype: add
ads-replRefreshNPersist: TRUE
ads-replAliasDerefMode: never
ads-replProvPort: 10389
ads-replSearchSizeLimit: 0
ads-replProvHostName: localhost
objectClass: ads-replConsumer
objectClass: ads-base
ads-replUserDn: uid=admin, ou=system
ads-replRefreshInterval: 60000
ads-replUserPassword: secret
ads-replConsumerId: 1
ads-replAttributes: *
ads-replSearchTimeOut: 0
ads-replSearchScope: sub
ads-replSearchFilter: (objectClass=*)
ads-searchBaseDN: ou=system

Restarted both instances and tried adding an entry under Provider and Wow ! it got replicated to the consumer.

Though the configuration I have posted in the question is incorrect, couple of confusing things led to that configuration.

  1. Lack of clear documentation on apacheds website.
  2. Apache ds studio - When you create a connection in apache ds studio to connect to a apacheds service, you can right click on the connection and open its configuration (Which is stored under ou=config. Its basically a GUI for ou=config). When you click on the last tab 'Replication'. The title reads 'All Replication Consumers' with a 'Add' button placed on the right. This is misleading as it gives the user an impression that one needs to add consumer/slave details here and this config should lie on the master/provider side.