Sample replication topology

Use the example of a basic replication topology to set up your replication topology correctly.

If you are not sure whether your topology is set up correctly, you can compare it against this example. This topology assumes that there is a suffix in the server configuration for o=sample.

This example file sets up a master server that is called masterhost with a replica called replicahost.
Note: This DN must be unique and cannot be same as any already existing DN's.
version: 1

dn: cn=replication, cn=localhost
objectclass: container

dn: cn=simple, cn=replication, cn=localhost
replicaBindDN: cn=master
replicaCredentials: ldap
description: simple bind credentials
objectclass: ibm-replicationCredentialsSimple

dn: o=sample
objectclass: organization
objectclass: ibm-replicationContext

dn: ibm-replicaGroup=default,o=sample
objectclass: ibm-replicaGroup

dn: ibm-replicaServerId=masterhost-389,ibm-replicaGroup=default,o=sample
ibm-replicationserverismaster: true
cn: masterhost
description: master
objectclass: ibm-replicaSubentry

dn: cn=replicahost,ibm-replicaServerId=masterhost-389,\
ibm-replicaGroup=default,o=sample
ibm-replicaconsumerid: replicahost-389
ibm-replicaurl: ldap://replicahost:389
ibm-replicaCredentialsDn: cn=simple, cn=replication, cn=localhost
description: masterhost to replicahost
objectclass: ibm-replicationAgreement
Add the example file to masterhost with following command:
ldif2db -r yes -i in
After the file is loaded, export the data from the database by using the following command:
db2ldif -o out
The server configuration file for masterhost must contain:
dn: cn=Configuration

ibm-slapdServerId: masterhost-389
The configuration file for replicahost must contain:
dn: cn=Configuration

ibm-slapdServerId: replicahost-389
and the following entry
dn: cn=master server, cn=configuration
cn: master server
ibm-slapdMasterDn: cn=master
ibm-slapdMasterPW: ldap
ibm-slapdMasterReferral: ldap://masterhost:389
objectclass: ibm-slapdReplication
Both masterhost and replicahost require the replicated subtree suffix in their configuration files:
dn: cn=Directory,cn=RDBM Backends,cn=IBM Directory,cn=Schemas,cn=Configuration
...
ibm-slapdSuffix: o=sample