我有多个Jboss节点在不同的VM上以独立模式运行。我正在使用分布式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, cluster=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]没有成员通过无穷大缓存发现。
网络域相同,集群名称相同。我在这里做错了什么?如何使两个节点形成一个集群?如何与每个节点进行通信?
提亚
发布于 2020-09-25 07:22:41
第一个问题可能是防火墙。在两个节点上禁用防火墙并在没有它们的情况下进行测试(您应该在修改规则之后再次启动它们)。
使用no-arg JChannel构造函数,默认为udp.xml;默认情况下,PING协议在228.8.8.8:45588上传送hello消息;检查多播是否在您的计算机上正确路由(例如使用netcat/nc)。
如果这没有帮助,那么启用TRACE日志记录可以获得更多的洞察力。
https://stackoverflow.com/questions/64047291
复制相似问题