Restarting Tomcat container and Rebalancing
We are running ignite inside a tomcat container. We have two tomcat instances on two different servers each tomcat instance is a server node. In our corporate turnover workflow we stop and restart each tomcat instance in sequence. Example: Deploy new war restart tomcat instance on server A (ignite server node) Deploy new war restart tomcat instance on server B (ignite server node) There is no manual step this sequence is all automated. What I am seeing is on node shutdown and restart we lose cache entries. I am assuming this is happening because a cache rebalance is taking place and because this is automated we are not allowing any time for the rebalance to finish. So Server A restarts and starts to rebalance it's cache from Server B. But before the rebalance finishes we have moved onto restarting Server B. This is how I am shutting down currently: Ignition.stop(ignite.name(), false); Is there anything I can do to ensure that before Server B restarts the rebalance is complete? -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Restarting-Tomcat-container-and-Rebalancing-tp9033.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Restarting Tomcat container and Rebalancing
Hi. You can use events to listen for rebalance completeness: ignite.events().localListen(new IgnitePredicate() { @Override public boolean apply(Event evt) { CacheRebalancingEvent evt = (CacheRebalancingEvent)e; // do some useful stuff return true; } }, EventType.EVT_CACHE_REBALANCE_STOPPED); On Thu, Nov 17, 2016 at 8:03 AM, styriver wrote: > We are running ignite inside a tomcat container. We have two tomcat > instances > on two different servers each tomcat instance is a server node. In our > corporate turnover workflow we stop and restart each tomcat instance in > sequence. Example: > Deploy new war > restart tomcat instance on server A (ignite server node) > Deploy new war > restart tomcat instance on server B (ignite server node) > > There is no manual step this sequence is all automated. What I am seeing is > on node shutdown and restart we lose cache entries. I am assuming this is > happening because a cache rebalance is taking place and because this is > automated we are not allowing any time for the rebalance to finish. So > > Server A restarts and starts to rebalance it's cache from Server B. But > before the rebalance finishes we have moved onto restarting Server B. > > This is how I am shutting down currently: > Ignition.stop(ignite.name(), false); > > Is there anything I can do to ensure that before Server B restarts the > rebalance is complete? > > > > -- > View this message in context: http://apache-ignite-users. > 70518.x6.nabble.com/Restarting-Tomcat-container- > and-Rebalancing-tp9033.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. >
Re: Restarting Tomcat container and Rebalancing
Hi So what I have implemented are two counters. One counter tracks the rebalance start event and one counter tracks the rebalance stop events. I start the stop counter after the first rebalance start event. On shutdown I compare the counters when they are equal I am assuming rebalance is complete and I complete shutdown. This appears to be working with my load tests. Is this the best solution? Or is their a more straightforward way to know that the rebalance has completed between the two server nodes? -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Restarting-Tomcat-container-and-Rebalancing-tp9033p9063.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Restarting Tomcat container and Rebalancing
Hi, You can get to know if rebalancing is started/finished only via events and how you'll use this information is up to you :) Thanks! -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Restarting-Tomcat-container-and-Rebalancing-tp9033p9128.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.