azrael6619 2013-11-28 11:04 采纳率: 0%
浏览 3412

java使用ehcache jgroups 无法数据同步问题

网上找不到答案,求帮忙。

我现在用ehcache jgroups在两台服务器上无法同步(同一台上也不行),tcp和udp都不行,但是单机是可以,而且用rmi是可以的。

 **下面我贴上我的udp的配置文件,两台服务器配置相同** 

xsi:noNamespaceSchemaLocation="ehcache.xsd">

<diskStore path="E:/database" />  
<cacheManagerPeerProviderFactory  
    class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"  
    properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;  
        mcast_send_buf_size=150000;mcast_recv_buf_size=80000):  
        PING(timeout=2000;num_initial_members=6):  
        MERGE2(min_interval=5000;max_interval=10000):  
        FD_SOCK:VERIFY_SUSPECT(timeout=1500):  
        pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):  
        UNICAST(timeout=5000):  
        pbcast.STABLE(desired_avg_gossip=20000):  
        FRAG:  
        pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;  
        shun=false;print_local_addr=true)"  
    propertySeparator="::" />  
<cache name="UserCache" maxEntriesLocalHeap="1000"  
    eternal="false" timeToIdleSeconds="1000" timeToLiveSeconds="1000"  
    overflowToDisk="false">  
    <cacheEventListenerFactory  
        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"  
        properties="replicateAsynchronously=true, replicatePuts=true,replicateUpdates=true, replicateUpdatesViaCopy=true,replicateRemovals=true" />  
    <!--   
    <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory"/>  
     -->  
</cache>  

 **下面我贴上我的tcp的配置文件,两台服务器配置相同** 

xsi:noNamespaceSchemaLocation="ehcache.xsd">

<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"  
    properties="connect=TCP(start_port=7800):  
    TCPPING(initial_hosts=192.2.2.57[7800],192.2.2.59[7800];port_range=10;timeout=3000;  
    num_initial_members=3;up_thread=true;down_thread=true):  
    VERIFY_SUSPECT(timeout=1500;down_thread=false;up_thread=false):  
    pbcast.NAKACK(down_thread=true;up_thread=true;gc_lag=100;retransmit_timeout=3000):  
    pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;  
    print_local_addr=false;down_thread=true;up_thread=true)"   
    propertySeparator="::" />  

<defaultCache maxElementsInMemory="10000" eternal="true"  
    overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="0"  
    diskPersistent="false" diskExpiryThreadIntervalSeconds="120">  
    <cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"  
        properties="replicateAsynchronously=true, replicatePuts=true,  
            replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true"/>  
</defaultCache>  

<cache name="UserCache" maxElementsInMemory="10000" eternal="true"  
    overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="0"  
    diskPersistent="false" diskExpiryThreadIntervalSeconds="120">  
    <cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"  
        properties="replicateAsynchronously=true, replicatePuts=true,  
            replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true"/>  
</cache>  

好心人帮忙解答下,谢谢!

单机都可以用,同步就不行。

  • 写回答

1条回答

  • azrael6619 2013-12-02 02:24
    关注

    怎么没一个人呀。。求帮忙

    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)