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 supplier copy of the data and, in turn, supplies those updates to the consumer. Use cascading replication for balancing heavy traffic loads or to keep supplier servers based locally in geographically-distributed environments. The following diagram shows a simple cascading replication scenario: Figure 15.4. Cascading Replication Note Multi-supplier and cascading replication can be combined. Use the command line or the web console to set up a cascading replication topology. See: Section 15.4.1, "Setting up Cascading Replication Using the Command Line" Section 15.4.2, "Setting up Cascading Replication Using the Web Console" 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 supplier.example.com . The following procedures describe how to add a hub named hub.example.com to the topology that receives updates from the supplier 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: Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide . 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: For details about creating a database for a suffix, see Section 2.1.1, "Creating Suffixes" . Enable replication for the suffix and create the replication manager account: 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 supplier.example.com host: 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: Important The replica ID must be a unique integer between 1 and 65534 for a suffix across all suppliers in the topology. The replication manager account can use the same DN as the one created on the hub. Add the replication agreement and initialize the hub. For example: This command creates a replication agreement named example-agreement-supplier-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.8.3, "Initializing a Consumer" . For further details about the options used in the command, enter: Verify whether the initialization was successful: 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: Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide . 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: For details about creating a database for a suffix, see Section 2.1.1, "Creating Suffixes" . Enable replication for the suffix and create the replication manager account: 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: Add the replication agreement and initialize the server. For example: After the agreement was created, Directory Server initializes the consumer. To initialize the consumer later, omit the --init option. Verify whether the initialization was successful: 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 supplier.example.com . The following procedures describe how to add a hub named hub.example.com to the topology that receives updates from the supplier 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: Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide . Open the Directory Server user interface in the web console. See Section 1.4, "Logging Into Directory Server Using the Web Console" . Select the instance. 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" . Enable replication for the suffix: Open the Replication menu. Select the dc=example,dc=com suffix and click Enable Replication . 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. Click Enable Replication . Configuring the Existing Server as a Supplier On the supplier.example.com host: Open the Directory Server user interface in the web console. See Section 1.4, "Logging Into Directory Server Using the Web Console" . Select the instance. 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: Open the Replication menu. Select the dc=example,dc=com suffix and click Enable Replication . Select Supplier 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 suppliers in the topology. The replication manager account can use the same DN as the one created on the hub. Click Enable Replication . Add the replication agreement and initialize the hub: Open the Replication menu, and select the suffix. On the Replication Agreements tab, click Create Agreement , and fill the fields. For example: These settings create a replication agreement named example-agreement-supplier-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. 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.8.3, "Initializing a Consumer" . Click Save Agreement . Verify whether the initialization was successful: Open the Replication menu. 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: Install Directory Server and create an instance. For details, see the Red Hat Directory Server Installation Guide . Open the Directory Server user interface in the web console. See Section 1.4, "Logging Into Directory Server Using the Web Console" . Select the instance. 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" . Enable replication for the suffix: Open the Replication menu. Select the dc=example,dc=com suffix and click Enable Replication . 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. Click Enable Replication . Configuring the Hub as a Supplier for the Consumer On the consumer.example.com host: Add the replication agreement and initialize the consumer: Open the Replication menu, and select the suffix. 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 . 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.8.3, "Initializing a Consumer" . Click Save Agreement . Verify whether the initialization was successful: Open the Replication menu. 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.

Commands:
dsconf -D "cn=Directory Manager" ldap://hub.example.com backend create --suffix="dc=example,dc=com" --be-name="userRoot"
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 "
dsconf -D "cn=Directory Manager" ldap://supplier1.example.com replication enable --suffix="dc=example,dc=com" --role="supplier" --replica-id=1 --bind-dn="cn=replication manager,cn=config" --bind-passwd=" password "
dsconf -D "cn=Directory Manager" ldap://supplier.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-supplier-to-hub
dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt --help
dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt init-status --suffix=" dc=example,dc=com " example-agreement-supplier-to-hub Agreement successfully initialized.
dsconf -D "cn=Directory Manager" ldap://hub.example.com backend create --suffix="dc=example,dc=com" --be-name="userRoot"
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 "
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
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.