15.4. Cascading Replication

In a cascading replication scenario, one server, a hub, acts both as a consumer and a supplier. It holds a read-only replica and maintains a changelog, so it receives updates from the supplier server that holds the master copy of the data and, in turn, supplies those updates to the consumer. Use cascading replication for balancing heavy traffic loads or to keep master servers based locally in geographically-distributed environments.
The following diagram shows a simple cascading replication scenario:
Cascading Replication

Figure 15.4. Cascading Replication

Note

Multi-master and cascading replication can be combined.
Use the command line or the web console to set up a cascading replication topology. See:

15.4.1. Setting up Cascading Replication Using the Command Line

The following example assumes that you have an existing Directory Server instance running on a host named master.example.com. The following procedures describe how to add a hub named hub.example.com to the topology that receives updates from the master for the dc=example,dc=com suffix. Subsequently, the procedure describes adding a consumer named consumer.example.com that receives updates from the hub server for the suffix.

Preparing the New Hub Server to Join

On the hub.example.com host:
  1. Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide.
  2. In case you created the instance without a database, create the database for the suffix. For example, to create a database named userRoot for the dc=example,dc=com suffix:
    # dsconf -D "cn=Directory Manager" ldap://hub.example.com backend \
        create --suffix="dc=example,dc=com" --be-name="userRoot"
    For details about creating a database for a suffix, see Section 2.1.1, “Creating Suffixes”.
  3. Enable replication for the suffix and create the replication manager account:
    # dsconf -D "cn=Directory Manager" ldap://hub.example.com replication \
        enable --suffix="dc=example,dc=com" --role="hub" \
        --bind-dn="cn=replication manager,cn=config" --bind-passwd="password"
    This command configures the hub.example.com host as a hub for the dc=example,dc=com suffix. Additionally, the server creates the cn=replication manager,cn=config user with the specified password and allows this account to replicate changes for the suffix to this host.

Configuring the Existing Server as a Supplier

On the master.example.com host:
  1. Similarly to the command you ran on the new hub server to join in the section called “Preparing the New Hub Server to Join”, enable replication for the dc=example,dc=com suffix and create a replication manager account:
    # dsconf -D "cn=Directory Manager" ldap://master1.example.com replication \
        enable --suffix="dc=example,dc=com" --role="master" --replica-id=1 \
        --bind-dn="cn=replication manager,cn=config" --bind-passwd="password"

    Important

    The replica ID must be a unique integer between 1 and 65534 for a suffix across all masters in the topology.
    The replication manager account can use the same DN as the one created on the hub.
  2. Add the replication agreement and initialize the hub. For example:
    # dsconf -D "cn=Directory Manager" ldap://master.example.com repl-agmt \
         create --suffix="dc=example,dc=com" --host="hub.example.com" --port=636 \
         --conn-protocol=LDAPS --bind-dn="cn=replication manager,cn=config" \
         --bind-passwd="password" --bind-method=SIMPLE --init \
         example-agreement-master-to-hub
    This command creates a replication agreement named example-agreement-master-to-hub. The replication agreement defines settings, such as the hubs' host name, protocol, and authentication information, which supplier uses when connecting and replicating data to the hub.
    After the agreement was created, Directory Server initializes the hub. To initialize the hub later, omit the --init option. Note that replication does not start before you initialized the consumer. For details about initializing a consumer, see Section 15.7.3, “Initializing a Consumer”.
    For further details about the options used in the command, enter:
    # dsconf -D "cn=Directory Manager" ldap://master.example.com repl-agmt --help
  3. Verify whether the initialization was successful:
    # dsconf -D "cn=Directory Manager" ldap://master.example.com repl-agmt \
         init-status --suffix="dc=example,dc=com" example-agreement-master-to-hub
    Agreement successfully initialized.
    Depending on the amount of data to replicate, the initialization can be time-consuming.

Preparing the new Consumer to Join

On the consumer.example.com host:
  1. Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide.
  2. In case you created the instance without a database, create the database for the suffix. For example, to create a database named userRoot for the dc=example,dc=com suffix:
    # dsconf -D "cn=Directory Manager" ldap://hub.example.com backend \
        create --suffix="dc=example,dc=com" --be-name="userRoot"
    For details about creating a database for a suffix, see Section 2.1.1, “Creating Suffixes”.
  3. Enable replication for the suffix and create the replication manager account:
    # dsconf -D "cn=Directory Manager" ldap://consumer.example.com replication \
        enable --suffix="dc=example,dc=com" --role="consumer" \
        --bind-dn="cn=replication manager,cn=config" --bind-passwd="password"
    This command configures the consumer.example.com host as a consumer for the dc=example,dc=com suffix. Additionally, the server creates the cn=replication manager,cn=config user with the specified password and allows this account to replicate changes for the suffix to this host.

Configuring the Hub as a Supplier for the Consumer

On the hub.example.com host:
  1. Add the replication agreement and initialize the server. For example:
    # dsconf -D "cn=Directory Manager" ldap://hub.example.com repl-agmt \
         create --suffix="dc=example,dc=com" --host="consumer.example.com" --port=636 \
         --conn-protocol=LDAPS --bind-dn="cn=replication manager,cn=config" \
         --bind-passwd="password" --bind-method=SIMPLE --init \
         example-agreement-hub-to-consumer
    After the agreement was created, Directory Server initializes the consumer. To initialize the consumer later, omit the --init option.
  2. Verify whether the initialization was successful:
    # dsconf -D "cn=Directory Manager" ldap://hub.example.com repl-agmt \
         init-status --suffix="dc=example,dc=com" example-agreement-hub-to-consumer
    Agreement successfully initialized.
    Depending on the amount of data to replicate, the initialization can be time-consuming.

15.4.2. Setting up Cascading Replication Using the Web Console

The following example assumes that you have an existing Directory Server instance running on a host named master.example.com. The following procedures describe how to add a hub named hub.example.com to the topology that receives updates from the master for the dc=example,dc=com suffix. Subsequently, the procedure describes adding a consumer named consumer.example.com that receives updates from the hub server for the suffix.

Preparing the New Hub Server to Join

On the hub.example.com host:
  1. Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide.
  2. Open the Directory Server user interface in the web console. See Section 1.4, “Logging Into Directory Server Using the Web Console”.
  3. Select the instance.
  4. In case you created the instance without a database, create the database for the suffix. For details about creating a database for a suffix, see Section 2.1.1, “Creating Suffixes”.
  5. Enable replication for the suffix:
    1. Open the Replication menu.
    2. Select the dc=example,dc=com suffix and click Enable Replication.
    3. Select Hub in the Replication Role field, and enter the DN and password of the replication manager account to create. For example:
      These settings configure the hub.example.com host as a hub for the dc=example,dc=com suffix. Additionally, the server creates the cn=replication manager,cn=config user with the specified password and allows this account to replicate changes for the suffix to this host.
    4. Click Enable Replication.

Configuring the Existing Server as a Supplier

On the master.example.com host:
  1. Open the Directory Server user interface in the web console. See Section 1.4, “Logging Into Directory Server Using the Web Console”.
  2. Select the instance.
  3. Similarly to the settings on the new hub server to join in the section called “Preparing the New Hub Server to Join”, enable replication for the dc=example,dc=com suffix and create a replication manager account:
    1. Open the Replication menu.
    2. Select the dc=example,dc=com suffix and click Enable Replication.
    3. Select Master in the Replication Role field, enter a replica ID, as well as the DN and password of the replication manager account to create. For example:

      Important

      The replica ID must be a unique integer between 1 and 65534 for a suffix across all masters in the topology.
      The replication manager account can use the same DN as the one created on the hub.
    4. Click Enable Replication.
  4. Add the replication agreement and initialize the hub:
    1. Open the Replication menu, and select the suffix.
    2. On the Replication Agreements tab, click Create Agreement, and fill the fields. For example:
      These settings create a replication agreement named example-agreement-master-to-hub. The replication agreement defines settings, such as the hubs' host name, protocol, and authentication information, the supplier uses when connecting and replicating data to the hub.
    3. Select Do Online Initialization in the Consumer Initialization field to automatically initialize the consumer after saving the agreement.
      To initialize the hub later, select Do Not Initialize. Note that replication does not start before you initialized the consumer. For details about initializing a consumer, see Section 15.7.3, “Initializing a Consumer”.
    4. Click Save Agreement.
  5. Verify whether the initialization was successful:
    1. Open the Replication menu.
    2. Select the Agreements entry.
      If the initialization completed successfully, the web console displays the Error (0) Replica acquired successfully: Incremental update succeeded message in the Last Update Status column.
      Depending on the amount of data to replicate, the initialization can be time-consuming.

Configuring the New Consumer to Join

On the consumer.example.com host:
  1. Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide.
  2. Open the Directory Server user interface in the web console. See Section 1.4, “Logging Into Directory Server Using the Web Console”.
  3. Select the instance.
  4. In case you created the instance without a database, create the database for the suffix. For details about creating a database for a suffix, see Section 2.1.1, “Creating Suffixes”.
  5. Enable replication for the suffix:
    1. Open the Replication menu.
    2. Select the dc=example,dc=com suffix and click Enable Replication.
    3. Select Consumer in the Replication Role field, and enter the DN and password of the replication manager account to create. For example:
      These settings configure the consumer.example.com host as a consumer for the dc=example,dc=com suffix. Additionally, the server creates the cn=replication manager,cn=config user with the specified password and allows this account to replicate changes for the suffix to this host.
    4. Click Enable Replication.

Configuring the Hub as a Supplier for the Consumer

On the consumer.example.com host:
  1. Add the replication agreement and initialize the consumer:
    1. Open the Replication menu, and select the suffix.
    2. On the Replication Agreements tab, click Create Agreement, and fill the fields. For example:
      These settings create a replication agreement named example-agreement-hub-to-consumer.
    3. Select Do Online Initialization in the Consumer Initialization field to automatically initialize the consumer after saving the agreement.
      To initialize the consumer later, select Do Not Initialize. Note that replication does not start before you initialized the consumer. For details about initializing a consumer, see Section 15.7.3, “Initializing a Consumer”.
    4. Click Save Agreement.
  2. Verify whether the initialization was successful:
    1. Open the Replication menu.
    2. Select the Agreements entry.
      If the initialization completed successfully, the web console displays the Error (0) Replica acquired successfully: Incremental update succeeded message in the Last Update Status column.
      Depending on the amount of data to replicate, the initialization can be time-consuming.