Pavel, I'd like to receive notifications when a node left / joined the cluster.
Gone through discovery notifications. But, In my application it would be more appropriate to receive notification after re-balance / a backup partition in a node becomes primary. On Tue, Mar 1, 2016 at 9:36 PM, Pavel Tupitsyn <[email protected]> wrote: > Kamal, > > In replicated mode all data is already on every node, so there is no need > to rebalance. > http://apacheignite.gridgain.org/docs/cache-modes > > On Tue, Mar 1, 2016 at 6:58 PM, Kamal C <[email protected]> wrote: > >> Vladimir, >> >> I had included the re-balance event types in *example-default.xml. *I'm >> able to receive REBALANCE notifications when cache mode is set to >> partitioned. >> >> Does re-balancing won't trigger when cache mode is replicated ? >> >> -- >> Kamal >> On 29-Feb-2016 7:07 PM, "Vladimir Ozerov" <[email protected]> wrote: >> >>> Kamal, >>> >>> You should enable these event type in configuration. See >>> IgniteConfiguration.setIncludeEventTypes(int >>> ...) method. >>> >>> Vladimir. >>> >>> On Mon, Feb 29, 2016 at 12:00 PM, Kamal C <[email protected]> wrote: >>> >>>> Hi, >>>> >>>> I have a replicated ignite cache with 3 nodes. I want to listen for >>>> data rebalance notifications in all the nodes whenever a new node joined / >>>> left the cluster. >>>> >>>> Using Ignite Events, I'd tried to register for cache re-balance >>>> notifications. But, I'm unable to receive any notifications. >>>> >>>> CacheConfiguration<String, Integer> cacheCfg = new >>>> CacheConfiguration<>("cache_name"); >>>> cacheCfg.setCacheMode(CacheMode.REPLICATED); >>>> >>>> >>>> IgniteCache<String, Boolean> cache = ignite.getOrCreateCache(cacheCfg); >>>> >>>> ignite.events(ignite.cluster().forCacheNodes("cache_name")).localListen( >>>> new IgnitePredicate<CacheRebalanacingEvent>() { >>>> >>>> private static final long serialVersionUID = 1L; >>>> >>>> @Override >>>> public boolean apply(CacheRebalanacingEvent e) >>>> { >>>> if(e.cacheName.equals("cache_name")) { >>>> logger.info("Received rebalancing Event : >>>> {}", e); >>>> } >>>> return true; >>>> } >>>> }, EventType.EVTS_CACHE_REBALANCE); >>>> >>>> >>>> >>>> >>>> *In logs,* WARN [2016-02-29 13:01:31,661] [main] >>>> (Log4JLogger.java:480) - Added listener for disabled event type: >>>> CACHE_REBALANCE_STARTED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_STOPPED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_PART_LOADED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_PART_UNLOADED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_OBJECT_LOADED >>>> WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_OBJECT_UNLOADED >>>> WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_PART_DATA_LOST >>>> >>>> >>>> How to receive REBALANCE_STOPPED notification ? >>>> >>>> -- >>>> Kamal >>>> >>>> >>> >
