我是 infinispan 的新手,我正在尝试集群配置。这是我的代码
GlobalConfigurationBuilder globalConfig = GlobalConfigurationBuilder.defaultClusteredBuilder();
globalConfig.transport().clusterName("infiniDistributedCluster").distributedSyncTimeout(30000).globalJmxStatistics().enable().allowDuplicateDomains(Boolean.TRUE);
configBuilder = new org.infinispan.configuration.cache.ConfigurationBuilder();
embeddedCacheManager = new DefaultCacheManager(globalConfig.build());
configBuilder.dataContainer().compatibility().enable().clustering().cacheMode(CacheMode.DIST_SYNC).sync().hash().numOwners(2).l1().lifespan(60000);
embeddedCacheManager.defineConfiguration("TestCache", configBuilder.build());
HotRodServerConfiguration build = new HotRodServerConfigurationBuilder().host(hotRodIpAddress).build();
HotRodServer server = new HotRodServer();
server.start(build, embeddedCacheManager);
我正在尝试从我的 HotRod 客户端获取它。
ConfigurationBuilder remoteBuilder = new ConfigurationBuilder();
remoteBuilder.addServers(serverIP).nearCache().mode(NearCacheMode.LAZY).maxEntries(500);
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(remoteBuilder.build());
remoteCache = remoteCacheManager.getCache("TestCache");
但我收到上述异常。