Need to Use Both Native and Cache store Persistence

classic Classic list List threaded Threaded
4 messages Options
siva siva
Reply | Threaded
Open this post in threaded view
|

Need to Use Both Native and Cache store Persistence

Hi,

we need to use both Native and Cache store persistence.
 

Is it possible to devide nodes like only particular nodes need to store
cache store data and other nodes need to store native persistence data.

According to Baseline Topology

Start the node normally(native persistnce disabled for this node). At this
point:

The cluster remains active.
The new node joins the cluster, but it is not added to the baseline
topology.
The new node can be used to store data of caches/tables who do not use
Ignite persistence.
The new node cannot hold data of caches/tables who persist data in Ignite
persistence.
The new node can be used from computation standpoint (Ignite compute grid).

I have followed as above ,but not storing the cache store data in the newly
joined node.Its adding in baseline topology node and giving worning  

Both Ignite native persistence and CacheStore are configured for cache
'cacheStoresivacache'. This configuration does not guarantee strict
consistency between CacheStore and Ignite data storage upon restarts.
Consult documentation for more details.




Thanks
siva












--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Mikael Mikael
Reply | Threaded
Open this post in threaded view
|

Re: Need to Use Both Native and Cache store Persistence

Hi!

Can't you just separate the data so you can keep the native persistence
data in a native persistence enabled region and the cache that needs to
use the cache store in another region without native persistence ?

Mikael

Den 2018-07-12 kl. 13:17, skrev siva:

> Hi,
>
> we need to use both Native and Cache store persistence.
>  
>
> Is it possible to devide nodes like only particular nodes need to store
> cache store data and other nodes need to store native persistence data.
>
> According to Baseline Topology
>
> Start the node normally(native persistnce disabled for this node). At this
> point:
>
> The cluster remains active.
> The new node joins the cluster, but it is not added to the baseline
> topology.
> The new node can be used to store data of caches/tables who do not use
> Ignite persistence.
> The new node cannot hold data of caches/tables who persist data in Ignite
> persistence.
> The new node can be used from computation standpoint (Ignite compute grid).
>
> I have followed as above ,but not storing the cache store data in the newly
> joined node.Its adding in baseline topology node and giving worning
>
> Both Ignite native persistence and CacheStore are configured for cache
> 'cacheStoresivacache'. This configuration does not guarantee strict
> consistency between CacheStore and Ignite data storage upon restarts.
> Consult documentation for more details.
>
>
>
>
> Thanks
> siva
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
>

slava.koptilin slava.koptilin
Reply | Threaded
Open this post in threaded view
|

Re: Need to Use Both Native and Cache store Persistence

In reply to this post by siva
Hello, 

I think the NodeFilter was designed exactly for that case. Please take a look at this method: CacheConfiguration#setNodeFilter() [1]

So, it can be used as follows:
 - for example, you can add a node attribute - "you-custom-attribute" that can be used to determine the fact that a cache should be resided on the given node or not.
 - create a cache with corresponding node filter as follows:
CacheConfiguration persConfig = new CacheConfiguration("persistent-cache")
.setDataRegionName("persistent-region")
.setNodeFilter(new IgnitePredicate<ClusterNode>() {
@Override public boolean apply(ClusterNode node) {
// check node's attribute, and return {@code true} if your cache should reside on the given node.
Boolean persistentNodeAttr = node.attribute("your-custom-attribute");
return (persistentNodeAttr != null && Boolean.TRUE.equals(persistentNodeAttr));
}
});
IgniteCache cache = ignite.getOrCreateCache(persConfig);
CacheConfiguration nonPersConfig = new CacheConfiguration("non-persistent-cache")
.setDataRegionName("non-persistent-region")
.setNodeFilter(new IgnitePredicate<ClusterNode>() {
@Override public boolean apply(ClusterNode node) {
// check node's attribute, and return {@code true} if your cache should reside on the given node.
Boolean persistentNodeAttr = node.attribute("your-custom-attribute");
return (persistentNodeAttr != null && Boolean.FALSE.equals(persistentNodeAttr));
}
})
.setCacheStoreFactory(...);
I hope that the main idea is clear.


Thanks,
S.

чт, 12 июл. 2018 г. в 14:17, siva <[hidden email]>:
Hi,

we need to use both Native and Cache store persistence.


Is it possible to devide nodes like only particular nodes need to store
cache store data and other nodes need to store native persistence data.

According to Baseline Topology

Start the node normally(native persistnce disabled for this node). At this
point:

The cluster remains active.
The new node joins the cluster, but it is not added to the baseline
topology.
The new node can be used to store data of caches/tables who do not use
Ignite persistence.
The new node cannot hold data of caches/tables who persist data in Ignite
persistence.
The new node can be used from computation standpoint (Ignite compute grid).

I have followed as above ,but not storing the cache store data in the newly
joined node.Its adding in baseline topology node and giving worning   

Both Ignite native persistence and CacheStore are configured for cache
'cacheStoresivacache'. This configuration does not guarantee strict
consistency between CacheStore and Ignite data storage upon restarts.
Consult documentation for more details.




Thanks
siva












--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Denis Magda-2 Denis Magda-2
Reply | Threaded
Open this post in threaded view
|

Re: Need to Use Both Native and Cache store Persistence

In reply to this post by siva
Since you're going to use 3rd party and Ignite persistence together consider the following note:

--
Denis

On Thu, Jul 12, 2018 at 4:17 AM siva <[hidden email]> wrote:
Hi,

we need to use both Native and Cache store persistence.


Is it possible to devide nodes like only particular nodes need to store
cache store data and other nodes need to store native persistence data.

According to Baseline Topology

Start the node normally(native persistnce disabled for this node). At this
point:

The cluster remains active.
The new node joins the cluster, but it is not added to the baseline
topology.
The new node can be used to store data of caches/tables who do not use
Ignite persistence.
The new node cannot hold data of caches/tables who persist data in Ignite
persistence.
The new node can be used from computation standpoint (Ignite compute grid).

I have followed as above ,but not storing the cache store data in the newly
joined node.Its adding in baseline topology node and giving worning   

Both Ignite native persistence and CacheStore are configured for cache
'cacheStoresivacache'. This configuration does not guarantee strict
consistency between CacheStore and Ignite data storage upon restarts.
Consult documentation for more details.




Thanks
siva












--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/