Search code examples
javaignite

Ignite cluster with mixed persistent/non-persistent cache nodes


In my Apache Ignite 2.3 cluster I want to run one node (probably two in the future for a backup) that has my replicated cache persistent on disk. I need to make sure this node is always up while other cache nodes don't have the persistent configuration and therefore access the cache only in memory. These non-persistent nodes can come and go frequently on demand as they are for computing but not for storing data.

When a non-persistent node is connected, what happens when the persistent node goes down? Ideally the cache should go away for the whole cluster but it doesn't. All nodes continue using the cache in memory it seems. But this means the new data will never be on disk and gone after cluster restart. Is my configuration with mixed persistent/non-persistent nodes not common? How would I keep this type of cluster consistant?

Any background help appreciated.


Solution

  • You can set node filter for you cache configuration and exclude compute nodes:

    https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/CacheConfiguration.html#setNodeFilter(org.apache.ignite.lang.IgnitePredicate)

    so the cache will be stored only on the particular set of nodes that you defined.

    To distinct ignite instances, you can use user attributes in ignite configurations: https://apacheignite.readme.io/docs/cluster#section-cluster-node-attributes