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.


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

Set Up WAN Replication

Set up WAN Replication between two clusters.

  1. 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.
  2. 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.

  3. 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 a WanReplicationQueueFullException 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.

  4. Now configure the other cluster of the pair on the right side of the page.

  5. From the 2nd Cluster Name list, select the correct cluster.

  6. From the Replication Type list, select the correct behavior for your second cluster:

    • Active: Sends and receives data updates.

    • Passive: Receives only data updates.

  7. 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.

  1. Connect a client to your publisher cluster and write some data to a map. You can use either cluster in an Active-Active pair.

  2. 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.

  1. Select the cluster that you want to delete.

  2. Go to Manage > WAN Replications.

  3. Click Delete and confirm your deletion.

  4. When the deletion is complete, go to the dashboard of your cluster.

  5. Click Delete and confirm your deletion of your cluster.