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:
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 thedc=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”. - 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 thehub.example.com
host as a hub for thedc=example,dc=com
suffix. Additionally, the server creates thecn=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:# 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"
Important
The replica ID must be a unique integer between1
and65534
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:
# 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
This command creates a replication agreement namedexample-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:# dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt --help
- Verify whether the initialization was successful:
# 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.
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 thedc=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”. - 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 theconsumer.example.com
host as a consumer for thedc=example,dc=com
suffix. Additionally, the server creates thecn=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:
# 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. - 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
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 themenu.
- Select the
dc=example,dc=com
suffix and click . - 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 thehub.example.com
host as a hub for thedc=example,dc=com
suffix. Additionally, the server creates thecn=replication manager,cn=config
user with the specified password and allows this account to replicate changes for the suffix to this host. - Click.
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 themenu.
- Select the
dc=example,dc=com
suffix and click . - 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 between1
and65534
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.
- Add the replication agreement and initialize the hub:
- Open themenu, and select the suffix.
- On thetab, click , 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.
- Verify whether the initialization was successful:
- Open themenu.
- Select theentry.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 themenu.
- Select the
dc=example,dc=com
suffix and click . - 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 theconsumer.example.com
host as a consumer for thedc=example,dc=com
suffix. Additionally, the server creates thecn=replication manager,cn=config
user with the specified password and allows this account to replicate changes for the suffix to this host. - Click.
Configuring the Hub as a Supplier for the Consumer
On the
consumer.example.com
host:
- Add the replication agreement and initialize the consumer:
- Open themenu, and select the suffix.
- On thetab, click , 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.
- Verify whether the initialization was successful:
- Open themenu.
- Select theentry.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.