Search code examples
ignite

How to make sure initial replication is completed for a new node (Apache Ignite)?


Here is a use case:

  • I have version 1 of a web app deployed.
  • It uses couple Ignite-powered distributed (configured for replication) Maps, Sets and other data structures.
  • I'm going to deploy v2 of this application and once data is replicated I'm going to shutdown v1 of this app and re-route users (using nginx) to new instance (v2).
  • I can see that Ignite on v1 and v2 can discover each other and automatically perform replication of data structures.

My intention: I don't want to shutdown 1st instance (v1) before all data is replicated to 2nd instance (v2).

Question is: how do I know if initial replication is completed? Is there any event that is fired in such cases, or maybe some other way to accomplish this task?


Solution

  • If you configure you caches to use synchronous rebalancing [1], second node will not complete start process before rebalancing is completed. This way you will guarantee that all the data is replicated to the second node (of course, assuming that you're using fully replicated caches).

    [1] https://apacheignite.readme.io/docs/rebalancing#section-rebalance-modes