Syncronize WAN replicated data
WAN syncronization allows you to overcome out-of-sync issues with WAN replicated data.
See Synchronizing WAN clusters for more detailed information about the configuration and behavior of WAN syncronization in Hazelcast.
For a worked example, see the Synchronize WAN replicated data tutorial.
Prerequisites for WAN syncronization
Before you create and configure a WanSync resource, you must create the following:
- At least one
Hazelcastresource and oneMapresource for the source Hazelcast cluster. - A target Hazelcast cluster that is accessible from the source cluster.
- A
WanReplicationCR that points to the target cluster.
Configure the WAN syncronization resource
To configure WAN syncronization, you must create a WanSync resource. For more detailed information, see the API reference.
To create a WanSync resource you must use the existing WanReplication CR. This means that the WanSync resource reuses the existing and running WAN replication process.
apiVersion: hazelcast.com/v1alpha1
kind: WanSync
metadata:
name: wansync-sample
spec:
wanReplicationResourceName: wan-replication-sample
Configure delta WAN syncronization
To configure delta WAN syncronization for the Hazelcast cluster, do the following:
- Configure Merkle tree for the
Mapresource. - Set
syncConsistencyCheckStrategytoMERKLE_TREESin theWanReplicationresource. - Create the
WanSyncresource. The createdWanSyncautomatically uses Delta WAN Synchronization.
apiVersion: hazelcast.com/v1alpha1
kind: Map
metadata:
name: map-sample
spec:
hazelcastResourceName: hazelcast
merkleTree:
depth: 10
---
apiVersion: hazelcast.com/v1alpha1
kind: WanReplication
metadata:
name: wan-replication-sample
spec:
resources:
- name: map-sample
kind: Map
targetClusterName: dev
endpoints: "198.51.100.252"
syncConsistencyCheckStrategy: "MERKLE_TREES"
---
apiVersion: hazelcast.com/v1alpha1
kind: WanSync
metadata:
name: wansync-sample
spec:
wanReplicationResourceName: wan-replication-sample
Checking the status of a WAN syncronization
After creating the WanSync resource, run the following command to see the WAN syncronization status:
kubectl get wansync wansync-sample
The output is similar to the following:
NAME STATUS
wansync-sample-sample Completed