Replicating Data Between Clusters
You can use the WAN Replication feature to automatically replicate data in map or cache data structures from one cluster to another.
Use Cases
WAN Replication supports the following use cases:
-
Set up a disaster recovery strategy, using a failover client. If one cluster fails, the failover client can switch to an alternative cluster with minimal disruption to service.
-
Migrate data to a new cluster before shutting down your original cluster.
Terminology
Term | Description |
---|---|
Publisher cluster, also known as the active cluster |
Sends or transfers data to another cluster, using WAN Replication |
Consumer cluster, also known as the passive cluster |
Receives data from another cluster, using WAN Replication |
Active-Passive replication |
One-way replication. Data updates on a publisher cluster are automatically copied to a consumer cluster. Use this configuration for migrating data between clusters. |
Active-Active replication |
Uses a pair of publisher clusters for two-way replication. Data updates on either cluster are automatically copied to the other cluster of the pair. Use this configuration with a failover client. |
Before you Begin
-
You need two Viridian Serverless clusters or two Viridian Dedicated clusters. You cannot replicate data between one Viridian Serverless cluster and one Viridian Dedicated cluster.
Make sure that each cluster is configured with the same settings. For example, if one cluster contains cluster-side modules or persistence, the other cluster must too.
Set Up WAN Replication
Set up WAN Replication between two clusters.
-
Sign into the Hazelcast Viridian console and select the cluster that you want to use as a publisher cluster.
If you want to set up a pair of clusters in an Active-Active configuration, select either cluster. -
Go to Manage > WAN Replications and then click + Create New Replication.
The details of the cluster you selected appear on the left side of the page. This is the Active cluster. Any data updates performed on this cluster are automatically copied to the other cluster of the pair.
-
Click Advanced Settings. Either leave the default options for the following parameters, or update them to suit your use case.
-
Queue Full Behavior: Lets you decide what to do when the replication events queue is full.
-
THROW_EXCEPTION
: Throws aWanReplicationQueueFullException
when the queue is full. Processing of replication events stops until action is taken. -
THROW_EXCEPTION_ONLY_IF_REPLICATION_ACTIVE
: As above, but this option is only triggered when both clusters connected by WAN replication are active. -
DISCARD_AFTER_MUTATION
: Discards replication events when the queue is full. This option is only suitable for non-critical data.
-
-
Queue Capacity: Sets the maximum size for the replication events queue. When this limit is reached, the Queue Full Behavior is triggered.
-
Batch Size: Sets the maximum size of replication events that are sent in a single batch.
-
Batch Max Delay Millis: By default, all replication events are delayed by one second (1000 milliseconds) before they are sent to the other cluster of the pair, unless they exceed the Batch Size.
-
-
Now configure the other cluster of the pair on the right side of the page.
-
From the 2nd Cluster Name list, select the correct cluster.
-
From the Replication Type list, select the correct behavior for your second cluster:
-
Active: Sends and receives data updates.
-
Passive: Receives only data updates.
-
-
Click Save This Replication. WAN Replication is set up.
If you want to replicate all data between the two clusters immediately, click Sync. This option is useful when you’re migrating data from one cluster to another. Otherwise, WAN Replication is triggered when a data update is made to a publisher cluster.
Verify WAN Replication
Check that data is successfully replicated between two clusters that are connected by WAN Replication.
-
Connect a client to your publisher cluster and write some data to a map. You can use either cluster in an Active-Active pair.
-
Open the dashboard of the other cluster and scroll down to Map Metrics. Check the Entry Count chart for new map entries. If you’ve written or synched other data types, check the relevant section of Management Center.
You can check the status of WAN Replication from Management Center for your publisher cluster. From the dashboard of your cluster select Management Center, then go to Cluster > WAN Replication.
Delete a Cluster that uses WAN Replication
Learn how to delete a cluster that has WAN Replication set up.
Before you start, check that all the data you need has been replicated to another cluster.
-
Select the cluster that you want to delete.
-
Go to Manage > WAN Replications.
-
Click Delete and confirm your deletion.
-
When the deletion is complete, go to the dashboard of your cluster.
-
Click Delete and confirm your deletion of your cluster.