Changing a read-only replica to a master

When using read-only basic replication, you might want to change one of the read-only replicas to be the master. Perhaps the machine where the replica server is installed is being upgraded, and you want this replica to now be the master LDAP server.

The following procedure should be followed to change a read-only replica to a master:

  1. If the read-only replica is out of sync with the master server, use the procedure that is described in Recovering from basic replication out-of-sync conditions.
  2. Use the LDAP server MAINTMODE ON operator modify command on the master server and on the replica server to put them into maintenance mode.
  3. Using a root administrator DN, unload all the replica entries (entries that describe replica servers) from the master server. Use a search command, like the one shown in Searching a replica entry, to create LDIF output containing the replica entries for each suffix in the backend. In the LDIF output, remove the replica entry for the read-only replica that is going to become the master. If the master is going to become a read-only replica, add a replica entry for the master in LDIF format to the output.
  4. Using a root administrator DN, run ldapdelete to remove the replica entries from the master.
  5. Using a root administrator DN, run ldapadd to add the unloaded replica entries to the replica server.
  6. Stop the master and replica server.
  7. Remove the masterServer, masterServerDN, and masterServerPW options from the LDAP server configuration file on the replica.
  8. If the original master is being eliminated, the database on the master is no longer needed.
    • For TDBM, drop the TDBM Db2® database. The SPUFI script that is used to create the Db2 database also contains the commands to drop the database.
    • For LDBM, remove all the files in the LDBM database directory. See the description of the databaseDirectory option in Customizing the LDAP server configuration for more information about the location of these files.
  9. If the original master is going to become a replica, add the masterServer, masterServerDN, and masterServerPW options to the LDAP server configuration file on the original master. The masterServer value must point to the new master. See Establishing the root administrator DN and basic replication replica server DN and passwords for more information about alternatives to specifying the masterServerPW option.
  10. Start the new master server and new replica server (if the original master became a replica server).