0

We are using the multi-site WAN configuration. We have two clusters across geographical distances in North America and Europe.

Context: Cluster 1 has two members A and B that are both gateway senders. Cluster B has two members C and D that are both gateway receivers. When member A in cluster 1 starts, it reads data from database and loads it into the gemfire cache which gets sent to the cluster 2. Everything so far is good.

Problem: If both members in Cluster 2 are restarted at the same time, they lose all the gemfire regions/data. At that point, we could restart member A in cluster 1, it again loads data from the DB and gets pushed to cluster B. But we would prefer to avoid the restart of member A and without persisting to hard disk.

Is there a solution where if cluster 2 is restarted, it can request a full copy of data from cluster 1?

Not sure if it's possible, but could we somehow setup peer to peer for the gateway receivers in cluster 2 (on top of WAN), so they would be updated automatically upon restart.

Thanks

Work of Art
  • 53
  • 1
  • 5

1 Answers1

0

Getting a full copy of data over WAN is not supported at this time. What you could do instead is run a function on all members of site A, that simply iterates over all data and puts it back again in the region. i.e something like:

public void execute(FunctionContext context) {
  RegionFunctionContext ctx = (RegionFunctionContext)context;
  Region localData = PartitionRegionHelper.getLocalDataForContext(ctx);
  for (Object key : localData.keySet()) {
    Object val = localData.get(key);
    localData.put(key, val);
  }
}
Swapnil
  • 1,191
  • 7
  • 8
  • Thanks, this function would need to be run manually every time we need a copy right? – Work of Art Feb 06 '17 at 21:24
  • Yes. Unfortunately, I do not think there is any public API where you can plug in this behavior, so it would have to be manual. – Swapnil Feb 06 '17 at 22:51