Apache Ignite:用于Ignite DataGrid的setNodeFilter不起作用

问题描述 投票:0回答:1

我已将服务器和客户端peerClassLoadingEnabled标志设置为true。我能够看到peerClassLoadingEnabled适用于计算任务。

但是,在使用CacheConfiguration.setNodeFilter(...)在特定节点集上创建缓存时,我在服务器端看到以下错误。

2018-01-26 07:52:28,563][INFO ][exchange-worker-#42][time] Started exchange init [topVer=AffinityTopologyVersion [topVer=29, minorTopVer=0], crd=true, evt=NODE_JOINED, evtNode=649c5360-7060-40cf-9454-ad6d08be2a7c, customEvt=null, allowMerge=true]
[2018-01-26 07:52:28,563][INFO ][exchange-worker-#42][GridDhtPartitionsExchangeFuture] Finish exchange future [startVer=AffinityTopologyVersion [topVer=29, minorTopVer=0], resVer=AffinityTopologyVersion [topVer=29, minorTopVer=0], err=null]
[2018-01-26 07:52:28,564][INFO ][exchange-worker-#42][time] Finished exchange init [topVer=AffinityTopologyVersion [topVer=29, minorTopVer=0], crd=true]
[2018-01-26 07:52:28,564][INFO ][exchange-worker-#42][GridCachePartitionExchangeManager] Skipping rebalancing (nothing scheduled) [top=AffinityTopologyVersion [topVer=29, minorTopVer=0], evt=NODE_JOINED, node=649c5360-7060-40cf-9454-ad6d08be2a7c]
[2018-01-26 07:52:29,963][INFO ][grid-nio-worker-tcp-comm-0-#25][TcpCommunicationSpi] Accepted incoming communication connection [locAddr=/10.0.0.3:47100, rmtAddr=/183.82.140.186:31996]
**[2018-01-26 07:52:41,461][ERROR][tcp-disco-msg-worker-#3][TcpDiscoverySpi] Failed to unmarshal discovery custom message.
class org.apache.ignite.IgniteCheckedException: Failed to find class with given class loader for unmarshalling (make sure same versions of all classes are available on all nodes or enable peer-class-loading) [clsLdr=sun.misc.Launcher$AppClassLoader@764c12b6,**

基于日志,它看起来DataNodeFilter类应该从客户端迁移到服务器并且找不到类。 cacheCfg.setNodeFilter(new DataNodeFilter());

我已经启用了PeerClassLoading标志,如上所述

为什么会发生这种情况的任何想法?

apache ignite
1个回答
3
投票

不幸的是,对等类加载不适用于与CacheConfiguration相关的任何事情。缓存配置通过发现消息分发,并且不会对其应用对等类加载。

此处的解决方法是使用可配置的节点过滤器,该过滤器将部署在所有节点上。例如,Ignite中提供了AttributeNodeFilter。它可以根据配置的节点属性过滤掉节点。

© www.soinside.com 2019 - 2024. All rights reserved.