小编Pra*_*aju的帖子

将嵌入式和服务器组合为集群Infinispan

作为概念验证,我尝试使用现有应用程序构建一个infinispan集群,该应用程序启动嵌入式缓存和一个或多个独立的infinispan服务器.

同样的问题:https ://developer.jboss.org/thread/261096 Jboss论坛问题参考

我想说明的是,通过简单地启动新下载的infinispan独立服务器,可以实现零配置自动创建集群的方法.所以我的应用程序运行一个嵌入式缓存,它将被新节点自动"连接".

我正在使用infinispan和jgroups的默认配置(见下文).

结果是,我的两个或多个具有嵌入式缓存的应用程序"互相看见",两个或多个独立的infinispan服务器相互看到.但我的节点都没有"看到"独立节点,也看不到我的节点.

我使用infinispan 7.2.3.

我的嵌入式配置就像 -

builder = new ConfigurationBuilder();
    GlobalConfigurationBuilder globalBuilder = GlobalConfigurationBuilder.defaultClusteredBuilder();
    if (enableDiskPersistance)
    {
        builder.jmxStatistics().enable().persistence().passivation(true).addSingleFileStore().location("data/cacheData").async().threadPoolSize(15).flushLockTimeout(15000).transaction().transactionMode(TransactionMode.TRANSACTIONAL);
        builder.eviction().strategy(EvictionStrategy.LIRS).maxEntries(10000L).expiration().maxIdle(-1, TimeUnit.SECONDS);
        builder.clustering().cacheMode(CacheMode.DIST_ASYNC).l1().enable();
    }
    else
    {
        builder.jmxStatistics().enable().transaction().transactionMode(TransactionMode.TRANSACTIONAL);
        builder.clustering().cacheMode(CacheMode.DIST_ASYNC).hash().numOwners(2).numSegments(20).l1().enable().compatibility().enable().locking().lockAcquisitionTimeout(30000).concurrencyLevel(1000);
    }

    globalBuilder.transport().clusterName("clustered").nodeName( "embededNode" )
    .addProperty( "configurationFile", "jgroups.xml").globalJmxStatistics().enable().allowDuplicateDomains(true).jmxDomain("CLEARINSIGHT").build();
    cacheManager = new DefaultCacheManager(globalBuilder.build(),builder.build());

    org.infinispan.Cache<String, Object> cache = cacheManager.getCache( "default" );
Run Code Online (Sandbox Code Playgroud)

和Jgroups.xml是 -

 <config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-3.2.xsd">

    <UDP
     mcast_addr="${jgroups.udp.mcast_addr:234.99.54.14}"
     mcast_port="${jgroups.udp.mcast_port:45688}"
     tos="8"
     ucast_recv_buf_size="20m"
     ucast_send_buf_size="640k"
     mcast_recv_buf_size="25m"
     mcast_send_buf_size="640k"
     max_bundle_size="31k"
     ip_ttl="${jgroups.udp.ip_ttl:2}"
     enable_diagnostics="false"
     bundler_type="sender-sends-with-timer"

     thread_naming_pattern="pl"

     thread_pool.enabled="true"
     thread_pool.min_threads="2"
     thread_pool.max_threads="30"
     thread_pool.keep_alive_time="60000"
     thread_pool.queue_enabled="true"
     thread_pool.queue_max_size="100"
     thread_pool.rejection_policy="Discard" …
Run Code Online (Sandbox Code Playgroud)

jboss jboss-cache infinispan

5
推荐指数
0
解决办法
653
查看次数

标签 统计

infinispan ×1

jboss ×1

jboss-cache ×1