hi Slava,
Thanks for detail, I adjust a bit, CacheA and CacheB host on first node with
NodeType as X
<property name="userAttributes">
<map><entry key="NodeType" value="X"/></map>
</property>
While CacheC host on another node which NodeType as Y, when create cache
configuration I let CacheA&B only on Node X, and CacheC on node Y;
CacheConfiguration ccfg = new CacheConfiguration(name);
ccfg.setCacheMode(CacheMode.PARTITIONED);
ccfg.setEagerTtl(true);
ccfg.setName(name);
ccfg.setNodeFilter(new AttributeNodeFilter("NodeType", nodeType));
If I bring up the node X, every events as expected, but Now If I start Node Y,
I still got a lot CacheA and CacheB 's rebalance events.
But Node Y's start or stop should not affect CacheA & CacheB, their partition
never change or rebalance, log after Y started:
[11:05:46] Topology snapshot [ver=2, servers=2, clients=0, CPUs=8, heap=18.0GB]
Received event [evt=CACHE_REBALANCE_STARTED,evt=CacheRebalancingEvent
[cacheName=CacheA, part=-1, discoNode=TcpDiscoveryNode
[id=55063d61-4168-4727-a5b9-1e1622fb57aa, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1,
192.168.10.36, 192.168.56.1, 2001:0:d388:7101:1c4c:155:3f57:f5db],
sockAddrs=[Aaron/192.168.10.36:47501,
/2001:0:d388:7101:1c4c:155:3f57:f5db:47501, /0:0:0:0:0:0:0:1:47501,
/127.0.0.1:47501, /192.168.56.1:47501], discPort=47501, order=2, intOrder=2,
lastExchangeTime=1508900746905, loc=false, ver=2.2.0#20170915-sha1:5747ce6b,
isClient=false], discoEvtType=10, discoTs=1508900746975,
discoEvtName=NODE_JOINED, nodeId8=16c5f906, msg=Cache rebalancing event.,
type=CACHE_REBALANCE_STARTED, tstamp=1508900747387]
Received event [evt=CACHE_REBALANCE_STOPPED,evt=CacheRebalancingEvent
[cacheName=CacheA, part=-1, discoNode=TcpDiscoveryNode
[id=55063d61-4168-4727-a5b9-1e1622fb57aa, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1,
192.168.10.36, 192.168.56.1, 2001:0:d388:7101:1c4c:155:3f57:f5db],
sockAddrs=[Aaron/192.168.10.36:47501,
/2001:0:d388:7101:1c4c:155:3f57:f5db:47501, /0:0:0:0:0:0:0:1:47501,
/127.0.0.1:47501, /192.168.56.1:47501], discPort=47501, order=2, intOrder=2,
lastExchangeTime=1508900746905, loc=false, ver=2.2.0#20170915-sha1:5747ce6b,
isClient=false], discoEvtType=10, discoTs=1508900746975,
discoEvtName=NODE_JOINED, nodeId8=16c5f906, msg=Cache rebalancing event.,
type=CACHE_REBALANCE_STOPPED, tstamp=1508900747387]
Regards
Aaron
[email protected]
From: slava.koptilin
Date: 2017-10-24 20:29
To: user
Subject: Re: Re: Where can we get the partition assignment of a Cache after the
cluster changed?
Hi Aaron,
I just started a single Ignite node as follows:
Ignite ignite =
Ignition.start("examples/config/example-ignite.xml");
IgnitePredicate<Event> rebalanceEventLsnr = evt -> {
System.out.println("Received event [evt=" + evt.name() + ",
evt=" + evt.toString());
return true; // Continue listening.
};
ignite.events().localListen(rebalanceEventLsnr,
EventType.EVT_CACHE_REBALANCE_STOPPED,
EventType.EVT_CACHE_REBALANCE_STARTED);
Thread.sleep(5000);
IgniteCache cache =
ignite.getOrCreateCache(createCacheConfiguration("CacheA"));
IgniteCache cache2 =
ignite.getOrCreateCache(createCacheConfiguration("CacheB"));
and got the following output:
[15:22:39,460][INFO ][exchange-worker-#31%null%][GridCacheProcessor] Started
cache [name=CacheA, mode=PARTITIONED]
Received event [evt=CACHE_REBALANCE_STARTED, evt=CacheRebalancingEvent
[cacheName=CacheA, part=-1, discoNode=TcpDiscoveryNode [...]]
Received event [evt=CACHE_REBALANCE_STOPPED, evt=CacheRebalancingEvent
[cacheName=CacheA, part=-1, discoNode=TcpDiscoveryNode [...]]
[15:22:39,478][INFO
][exchange-worker-#31%null%][GridCachePartitionExchangeManager] Skipping
rebalancing (nothing scheduled) [top=AffinityTopologyVersion [topVer=1,
minorTopVer=1], evt=DISCOVERY_CUSTOM_EVT,
node=1ee1a908-2424-46b0-911b-0a2c70ad68e2]
[15:22:39,480][INFO ][exchange-worker-#31%null%][GridCacheProcessor] Started
cache [name=CacheB, mode=PARTITIONED]
Received event [evt=CACHE_REBALANCE_STARTED, evt=CacheRebalancingEvent
[cacheName=CacheA, part=-1, discoNode=TcpDiscoveryNode [...]]
Received event [evt=CACHE_REBALANCE_STOPPED, evt=CacheRebalancingEvent
[cacheName=CacheA, part=-1, discoNode=TcpDiscoveryNode [...]]
Received event [evt=CACHE_REBALANCE_STARTED, evt=CacheRebalancingEvent
[cacheName=CacheB, part=-1, discoNode=TcpDiscoveryNode [...]]
Received event [evt=CACHE_REBALANCE_STOPPED, evt=CacheRebalancingEvent
[cacheName=CacheB, part=-1, discoNode=TcpDiscoveryNode [...]]
[15:22:39,485][INFO
][exchange-worker-#31%null%][GridCachePartitionExchangeManager] Skipping
rebalancing (nothing scheduled) [top=AffinityTopologyVersion [topVer=1,
minorTopVer=2], evt=DISCOVERY_CUSTOM_EVT,
node=1ee1a908-2424-46b0-911b-0a2c70ad68e2]
So, I see messages for both caches.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/