【问题标题】:Gemfire WAN Gateway-sender configurationGemfire WAN 网关发送器配置
【发布时间】:2016-12-16 22:06:03
【问题描述】:

我们正在使用 Gemfire WAN 拓扑,但在设置网关发送方时遇到问题。

几个假设: - 复制区域 - 串行网关发件人 - 所有网关发件人的手动启动都是错误的

假设我们有 2 个集群,在每个集群中,我们有 2 个成员(成员 A 和成员 B)

成员 A 的 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> 

成员B的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>

当我们在一个集群中运行启动两个成员时出现问题。它引发了这个错误:

java.lang.IllegalStateException:无法使用 [gateway-sender-A] 网关发件人 ID 创建区域 /data,因为另一个缓存具有使用 [gateway-sender-B] 网关发件人 ID 定义的相同区域

查看“网关发件人的高可用性”文档,我们的理解是我们可以创建 2 个网关发件人,其中只有一个将在给定时间点进行发送。最终,我们希望一个缓存区域有 2 个网关发送者(每个成员一个),一个作为主要发送者,另一个作为辅助发送者。

谢谢

【问题讨论】:

    标签: gemfire spring-data-gemfire


    【解决方案1】:

    来自Geode documentation,它说

    对于串行 Sender,Queue HA 是通过在多个成员中配置相同的串行 Sender 来实现的。队列在成员之间复制。

    因此,如果成员 A 和 B 中的两个网关发件人正在执行相同的工作(除了他们的主要/次要角色),您应该使用“相同”设置。

    在网关发送者中,会有一个设法获得特定的分布式锁并成为主要发送者,通常是第一个出现。我没有看到一个属性来强迫一个人成为主要的。

    Geode 是 Gemfire 的开源版本,如果您想知道的话。

    【讨论】:

      【解决方案2】:

      将两个成员的 sender-ids 更改为相同后,我们遇到了另一个问题:

      java.lang.IllegalStateException:无法创建网关发件人 "some-gateway-sender-id" 手动启动 "false" 因为另一个 缓存具有使用手动启动“true”定义的相同网关发件人

      看来我们的问题是格式不一致。

      会员A使用XML格式

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

      会员B使用Spring Gemfire Data格式

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

      我们切换到对两个成员都使用 Spring Gemfire 数据格式,它解决了这两个问题。

      TL;DR,如果网关发送者在同一个集群中并且使用一致的缓存 xml 格式,则它们需要具有相同的 id。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-12-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多