Gemfire WAN Gateway-sender configuration

663 views Asked by At

We are using the Gemfire WAN topology and have problems setting up the gateway-senders.

Couple of assumptions: - Replicated regions - Serial gateway-senders - manual-start is false for all gateway-senders

Let's say we have 2 clusters, within each cluster, we have 2 members (Member A and Member B)

Member A's cache.xml

<gfe:gateway-sender id="gateway-sender-A" parallel="false" remote-distributed-system-id="2" manual-start="false" /> 
<gfe:replicated-region name="data" scope="DISTRIBUTED_NO_ACK"> 
<gfe:replicated-region name="subData" data-policy="REPLICATE" scope="DISTRIBUTED_ACK"> 
<gfe:gateway-sender-ref bean="gateway-sender-A"/> 
</gfe:replicated-region> 
</gfe:replicated-region> 

Member B's cache.xml

<gfe:gateway-sender id="gateway-sender-B" parallel="false" remote-distributed-system-id="2" manual-start="false" /> 
<gfe:replicated-region name="data" scope="DISTRIBUTED_NO_ACK"> 
<gfe:replicated-region name="subData" data-policy="REPLICATE" scope="DISTRIBUTED_ACK"> 
<gfe:gateway-sender-ref bean="gateway-sender-B"/> 
</gfe:replicated-region> 
</gfe:replicated-region>

There is a problem when we run start up the two members within one cluster. It raises this error:

java.lang.IllegalStateException: Cannot create Region /data with [gateway-sender-A] gateway sender ids because another cache has the same region defined with [gateway-sender-B] gateway sender ids

Looking at the "High Availability for Gateway Senders" documentation, our understanding is that we can create 2 gateway-senders, in which only one will be doing the sending at a given point in time. Ultimately, we want to have 2 gateway senders (one in each member) for one cache region, one as the primary sender and the other as the secondary sender.

Thanks

2

There are 2 answers

0
Work of Art On BEST ANSWER

After changing the sender-ids to the same for both members, we have another problem:

java.lang.IllegalStateException: Cannot create Gateway Sender "some-gateway-sender-id" with manual start "false" because another cache has the same Gateway Sender defined with manual start "true

It seems like our problem was the inconsistent format.

Member A used XML format

<?xml version="1.0"?> <!DOCTYPE cache PUBLIC "-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN" "http://www.gemstone.com/dtd/cache8_0.dtd">

Member B used Spring Gemfire Data format

xmlns:gfe="http://www.springframework.org/schema/gemfire" xsi:schemaLocation="http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd"> <gfe:gateway-sender ...>

We switched to using the Spring Gemfire Data format for both members, and it solved both issues.

TL;DR, the gateway-senders need to have the same ids if they are in the same cluster and use consistent cache xml formats.

0
Xiawei Zhang On

From Geode documentation, it says

For serial Senders, Queue HA is achieved by configuring identical serial Senders in multiple members. The Queue is replicated between the members.

So if the two gateway senders in member A and B is doing the same job (except their primary/secondary roles), you should use "identical" setting.

Among gateway senders, there will be one that manages to acquire a specific distributed lock and becomes the primary sender, usually the first one comes up. I don't see a property to force one to become primary.

Geode is the open source version of Gemfire if you wonder.