Jboss多节点中的Infinispan分布式缓存通信问题

问题描述

我在以独立模式运行的不同VM上有多个Jboss节点。我正在使用分布式Infinispan缓存。 下面是我当前正在使用的代码。

JChannel jchannel = new JChannel();
jchannel.setDiscardOwnMessages(false);
jchannel.setName("losci_qa");
JGroupsTransport transport = new JGroupsTransport(jchannel);

manager = new DefaultCacheManager(GlobalConfigurationBuilder.defaultClusteredBuilder()
          .transport().transport(transport).nodeName(cacheClusterName+"-node").clusterName(cacheClusterName)
          .build());

ConfigurationBuilder c = new ConfigurationBuilder();
c.clustering().cacheMode(CacheMode.DIST_SYNC).hash().numOwners(numOwners).numSegments(numSegments).capacityFactor(capacityFactor).build();
c.invocationBatching().enable();
c.transaction().transactionMode(TransactionMode.TRANSACTIONAL).lockingMode(LockingMode.PESSIMISTIC);
manager.defineConfiguration(DIST,c.build());

以上代码在单个节点上成功运行。 问题是,当我想与两个节点通信此缓存时,它不起作用。当我在上面的代码中运行时,其打印在日志下方。

服务器1日志:

2020-09-24 12:16:45,637 INFO  [org.infinispan.factories.GlobalComponentRegistry] (default task-1) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.11.Final
2020-09-24 12:16:45,823 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000078: Starting JGroups channel losci_qa
2020-09-24 12:16:45,839 INFO  [stdout] (default task-1)
2020-09-24 12:16:45,839 INFO  [stdout] (default task-1) -------------------------------------------------------------------
2020-09-24 12:16:45,840 INFO  [stdout] (default task-1) GMS: address=losci_qa,cluster=losci_qa,physical address=10.100.101.82:60774
2020-09-24 12:16:45,840 INFO  [stdout] (default task-1) -------------------------------------------------------------------
2020-09-24 12:16:47,845 INFO  [org.jgroups.protocols.pbcast.GMS] (default task-1) losci_qa: no members discovered after 2003 ms: creating cluster as first member
2020-09-24 12:16:47,858 INFO  [org.infinispan.CLUSTER] (default task-1) ISPN000094: Received new cluster view for channel losci_qa: [losci_qa|0] (1) [losci_qa]
2020-09-24 12:16:47,865 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000079: Channel losci_qa local address is losci_qa,physical addresses are [10.10.10.82:60774]

服务器2日志:

2020-09-24 17:17:07,686 INFO  [org.infinispan.factories.GlobalComponentRegistry] (default task-1) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.11.Final
2020-09-24 17:17:07,936 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000078: Starting JGroups channel losci_qa
2020-09-24 17:17:07,958 INFO  [stdout] (default task-1)
2020-09-24 17:17:07,958 INFO  [stdout] (default task-1) -------------------------------------------------------------------
2020-09-24 17:17:07,958 INFO  [stdout] (default task-1) GMS: address=losci_qa,physical address=10.100.101.83:39828
2020-09-24 17:17:07,958 INFO  [stdout] (default task-1) -------------------------------------------------------------------
2020-09-24 17:17:09,966 INFO  [org.jgroups.protocols.pbcast.GMS] (default task-1) losci_qa: no members discovered after 2007 ms: creating cluster as first member
2020-09-24 17:17:09,981 INFO  [org.infinispan.CLUSTER] (default task-1) ISPN000094: Received new cluster view for channel losci_qa: [losci_qa|0] (1) [losci_qa]
2020-09-24 17:17:09,989 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000079: Channel losci_qa local address is losci_qa,physical addresses are [10.10.10.83:39828]
通过Infinispan缓存

没有发现成员

网络域相同,群集名称相同。 我在这里做错了什么?如何建立两个节点的集群?我该如何与每个节点通信?

TIA

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)