java - EhCache 的 JGROUP 中出现错误,删除消息发送者不在表中

标签 java hibernate wildfly ehcache jgroups

我的集群中有四个节点,我需要同步它们。当节点 BRJGSD309173 尝试通过 JGROUP 向 BRJGSD333007 发送消息时,服务器 BRJGSD333007 通知以下消息:

11:34:07,759 WARN [org.jgroups.protocols.pbcast.NAKACK] (Incoming-2,maestroCacheManager,BRJGSD333007-24075) BRJGSD333007-24075: dropped message 4787 from BRJGSD309173-7667 (sender not in table [BRJGSD333007-24075]), view=[BRJGSD333007-24075|0] [BRJGSD333007-24075]

jgroups_tcp.xml的以下配置

<?xml version='1.0'?>
 <config>
     <TCP bind_port="7800" 
          max_bundle_size="5M" />
     <TCPPING timeout="3000"
              initial_hosts="brjgsm10.weg.net[7800],brjgsm11.weg.net[7800],brjgsd309173.weg.net[7800],brjgsd333007.weg.net[7800]"
              port_range="10"
              num_initial_members="5"/>
     <VERIFY_SUSPECT timeout="1500"  />
     <pbcast.NAKACK use_mcast_xmit="false"
                    retransmit_timeout="300,600,1200,2400,4800"
                discard_delivered_msgs="true"/>
     <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000"/>
     <pbcast.GMS print_local_addr="true" join_timeout="5000" view_bundling="true"/>
 </config>

还有 ehcache.xml 的片段

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    updateCheck="false" xsi:noNamespaceSchemaLocation="ehcache.xsd" name="maestroCacheManager">
...
    <cache 
        name="objectServiceExecute"
        maxEntriesLocalHeap="100000" 
        eternal="false" >
        <cacheEventListenerFactory
              class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
              properties="replicateAsynchronously=true, replicatePuts=true,
              replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true" />
    </cache>

    <diskStore 
        path="java.io.tmpdir/ehcache" />

    <cacheManagerPeerProviderFactory
        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
        properties="file=jgroups_tcp.xml"
        propertySeparator=";" 
    /> 

    <cache 
        name="org.hibernate.cache.internal.StandardQueryCache" 
        maxElementsInMemory="10000000" 
        eternal="true" 
        memoryStoreEvictionPolicy="LRU" />

    <defaultCache 
        maxElementsInMemory="10000000" 
        eternal="true"
        memoryStoreEvictionPolicy="LRU" >
        <cacheEventListenerFactory
              class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
              properties="replicateAsynchronously=true, replicatePuts=true,
              replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true" />
    </defaultCache>

</ehcache>

最佳答案

这是一个非常奇怪的 JGroups 配置!您缺少故障检测协议(protocol),UNICAST3MERFGE3 等!

上述错误意味着您收到了来自不在集群中的成员的消息,因此该消息被删除。为什么该成员没有加入集群尚不清楚,可能是它没有正确加入。由于您没有任何故障检测协议(protocol),因此它不可能被怀疑和驱逐。

我建议复制 JGroups 附带的 tcp.xml 并将 TCPPING 替换为您的 TCPPING 配置。另请确保在 TCP 中设置 bind_addr,以确保 JGroups 绑定(bind)到正确的接口(interface)。

希望这有帮助, 干杯

关于java - EhCache 的 JGROUP 中出现错误,删除消息发送者不在表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35434321/

相关文章:

java - 如何在 Java 7 中使用一组众所周知的值初始化无符号字节数组?

java - 如何从 url 中隐藏应用程序上下文?

java - ClassNotFoundException 与 ResteasyClientBuilder (JBOSS)

java - 使用 postgres 池简单连接到数据源

java - 为我的 EntityManager 获取空指针异常

java - 使用 JDBC 时拒绝访问数据库

java - 不兼容的类型泛型 Java

sql-server - 取决于数据库 View 的集成测试

java - JPA、 hibernate 、Java。复合主键,其中之一也是外键

java - 使用 Oracle 生成的 SQL 查询语法是旧的