Red Hat Training

A Red Hat training course is available for Red Hat Directory Server

15.12. Removing a Supplier from the Replication Topology

Removing a supplier cleanly from the replication topology is more complex than simply removing the supplier entry. This is because every supplier in the topology stores information about other suppliers, and they retain that information even if a supplier suddenly becomes unavailable.
Information about the replication topology, that is all suppliers which supply updates to each other and other replicas within the same replication group, is contained in a set of metadata called the replica update vector (RUV). The RUV contains information about the supplier such as its ID and URL, its latest change state number (CSN) on the local server, and the CSN of the first change. Both suppliers and consumers store RUV information, and they use it to control replication updates.
To remove a supplier cleanly, its metadata must be removed along with the configuration entries.
  1. On the replica to remove, put the database into read-only mode to prevent any updates.
    # ldapmodify -D "cn=Directory Manager" -W -x -p 389 -h
    dn: cn=userRoot,cn=ldbm database,cn=plugins,cn=config
    changetype: modify
    replace: nsslapd-readonly
    nsslapd-readonly: on
    Allow a few minutes for the replica to flush all of its pending changes.
  2. On all other suppliers in the topology, delete the replication agreement with the replica to be removed.
    # ldapmodify -D "cn=Directory Manager" -W -x -p 389 -h
    dn: cn=Agmt_with_dead-replica,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
    changetype: delete
  3. On the replica to remove, get the replica ID for the replica to remove. This is in the nsds5replicaid attribute in the configuration entry.
    # ldapsearch -xLLL -D "cn=Directory Manager" -W -s sub -b cn=config objectclass=nsds5replica nsds5replicaid
    dn: cn=dead-replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
    nsds5replicaid: 55
  4. On the replica to remove, remove all replication agreement entries and its own configuration entry.
    # ldapmodify -D "cn=Directory Manager" -W -x -p 389 -h
    dn: cn=to_replica1,cn=dead-replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
    changetype: delete
    dn: cn=to_replica2,cn=dead-replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
    changetype: delete
    dn: cn=dead-replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
    changetype: delete
  5. On one of the other master servers in the topology, run the clean command on the replica ID:
    # ldapmodify -a -D "cn=Directory Manager" -W -p 389 -h -x
    dn: cn=clean 55, cn=cleanallruv, cn=tasks, cn=config
    objectclass: extensibleObject
    replica-base-dn: dc=example,dc=com
    replica-id: 55
    cn: clean 55
    It is possible to monitor the progress of the task on the other replicas by searching on the tombstone entry on each replica:
    # ldapsearch -xLLL -D "cn=Directory Manager" -W -h -b "dc=example,dc=com" '(&(nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff)(objectclass=nstombstone))' nsds50ruv