You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by siva <si...@bizruntime.com> on 2018/07/12 11:17:48 UTC

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/

Re: Need to Use Both Native and Cache store Persistence

Posted by Mikael <mi...@telia.com>.
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/
>
>


Re: Need to Use Both Native and Cache store Persistence

Posted by Denis Magda <dm...@apache.org>.
Since you're going to use 3rd party and Ignite persistence together
consider the following note:
https://apacheignite.readme.io/docs/3rd-party-store#section-using-3rd-party-persistence-together-with-ignite-persistence

--
Denis

On Thu, Jul 12, 2018 at 4:17 AM siva <si...@bizruntime.com> 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/
>

Re: Need to Use Both Native and Cache store Persistence

Posted by Вячеслав Коптилин <sl...@gmail.com>.
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.

[1]
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/CacheConfiguration.html#setNodeFilter-org.apache.ignite.lang.IgnitePredicate-
[2]
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/IgniteConfiguration.html#setUserAttributes-java.util.Map-

Thanks,
S.

чт, 12 июл. 2018 г. в 14:17, siva <si...@bizruntime.com>:

> 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/
>