Search code examples
ignitedistributed-caching

Moving data from one node to other node in same cluster in Apache Ignite


In a baseline cluster of 8 nodes, we have data in the partitioned template without backup. Assume I have avg 28K entries in all 8 nodes in SampleTable(@Cache). Total data = 28K*8 = 224K entries.

CREATE TABLE SampleTable(....) WITH "template=partitioned"

Now I want to shut down one node and before shutting down I want to move data from 8th Node to other nodes so approx 32K (32K*7=224K) entries to 7 nodes. Can I move data from any node to other nodes?

How can I move all the data from one node to other nodes (cluster) before shutting down that node? Keeping the data balanced and distributed in rest 7 nodes.

I created the table (SampleTable) using create statement and inserted data using insert statement (using JDBC connection).

Persistence is enabled.


Solution

  • I think that the most straightforward way is using backups. Anyway, if you need to avoid data loss, using backups (or/and persistence) is a must.

    As a simple workaround you can try the following steps:

    1. You can scan local data on the node, which you want to shut down, using ScanQuery and store the data in a database.
    2. After that, shut down the node and exclude it from baseline.
    3. Upload data from a database.