15.9. Removing a Directory Server Instance from the Replication Topology

In certain situations, such as hardware outages or structural changes, administrators want to remove Directory Server instances from a replication topology. This section explains the details about removing an instance.

15.9.1. Removing a Consumer or Hub from the Replication Topology

To remove a consumer or hub from the replication topology:
  1. If the host to remove is a hub and also a supplier for other servers in the topology, configure other masters or hubs to replicate data to these servers. If these servers have no other supplier configured and you remove the hub, these servers become isolated from the replication topology. For details about configuring replication, see:
  2. On the host to remove, set the database into read-only mode to prevent any updates:
    # ldapmodify -D "cn=Directory Manager" -W -p 389 -h host-to-remove.example.com -x
    
    dn: cn=userRoot,cn=ldbm database,cn=plugins,cn=config
    changetype: modify
    replace: nsslapd-readonly
    nsslapd-readonly: on
  3. On all masters that have a replication agreement with the host to remove, delete the replication agreements. For example:
    # dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt \
         delete --suffix="dc=example,dc=com" agreement_name
  4. On the consumer or hub to remove disable replication for all suffixes. For example:
    # dsconf -D "cn=Directory Manager" ldap://host-to-remove.example.com replication \
         disable --suffix="dc=example,dc=com"
    Disabling replication automatically deletes all replication agreements for this suffix on this server.

15.9.2. Removing a Master from the Replication Topology

Removing a master cleanly from the replication topology is more complex than simply removing a 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. If the replica to be removed is also a supplier for other servers in the topology, configure other masters or hubs to replicate data to these servers. If these servers have no other supplier configured and you remove the master, these servers become isolated from the replication topology. For details about configuring replication, see:
  2. On the master to remove:
    1. Set the database into read-only mode to prevent any updates. For details, see Section 2.2.2.1, “Setting a Database in Read-Only Mode”.
    2. Wait until all other servers in the topology received all data from this master. To verify, ensure that the CSN on other servers is equal or greater than the CSN on the master to remove. For example:
      # ds-replcheck online -D "cn=Directory Manager" -w password -m ldap://server1.example.com:389 -r ldap://server2.example.com:389 -b dc=example,dc=com
      ================================================================================
               Replication Synchronization Report  (Tue Mar  5 09:46:20 2019)
      ================================================================================
       
       
      Database RUV's
      =====================================================
       
      Master RUV:
        {replica 1 ldap://server1.example.com:389} 5c7e8927000100010000 5c7e89a0000100010000
        {replicageneration} 5c7e8927000000010000
       
      Replica RUV:
        {replica 1 ldap://server1.example.com:389} 5c7e8927000100010000 5c7e8927000400010000
        {replica 2 ldap://server2.example.com:389}
        {replicageneration} 5c7e8927000000010000
    3. Display the replica ID:
      # dsconf -D "cn=Directory Manager" ldap://replica-to-remove.example.com replication get --suffix="dc=example,dc=com" | grep -i "nsds5replicaid"
      nsDS5ReplicaId: 1
      In this example, the replica ID is 1. Remember your replica ID for the last step of this procedure.
  3. On all suppliers that have a replication agreement with the replica to remove, delete the replication agreements. For example:
    # dsconf -D "cn=Directory Manager" ldap://server.example.com repl-agmt \
         delete --suffix="dc=example,dc=com" agreement_name
  4. On the replica to remove, disable replication for all suffixes. For example:
    # dsconf -D "cn=Directory Manager" ldap://replica-to-remove.example.com replication \
         disable --suffix="dc=example,dc=com"
    Disabling replication automatically deletes all replication agreements for this suffix on this server.
  5. On one of the remaining masters in the topology, clean the RUVs for the replica ID. For example:
    # dsconf -D "cn=Directory Manager" ldap://server.example.com repl-tasks \
         cleanallruv --suffix="dc=example,dc=com" --replica-id=1
    The command requires to specify the replica ID displayed in an earlier step of this procedure.