Replicated Cache not replicating

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

Replicated Cache not replicating

I am using the following configuration for Replicated Data grid:

      <property name="cacheConfiguration">
            <list>
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="cache*"/>
                    <property name="cacheStoreFactory">
                        <bean class="org.apache.ignite.configuration.IgniteReflectionFactory">
                            <property name="componentClass" value="com.somepackage.someclass"/>
                        </bean>
                    </property>
                    <property name="cacheMode" value="REPLICATED"/>
                    <property name="readThrough" value="true"/>
                </bean>
            </list>
        </property>

I have 2 servers running ignite, and I connect with a third client to them to get/set cache requests. Once my process is done, I waited 5 minutes, took down one ignite server and re-ran my process.

I was expecting all cache requests to be stored entirely in the second running ignite instance (meaning replicated there), but found out that it was not the case, and the second ignite instance called again to retrieve cache data.

What am I doing wrong, why are the ignite instances not replicating?

Thanks in advance
Denis Magda Denis Magda
Reply | Threaded
Open this post in threaded view
|

Re: Replicated Cache not replicating

Hi,

Please see below

On 9/13/2015 2:04 PM, levaly wrote:

> I am using the following configuration for Replicated Data grid:
>
>        <property name="cacheConfiguration">
>              <list>
>                  <bean
> class="org.apache.ignite.configuration.CacheConfiguration">
>                      <property name="name" value="cache*"/>
>                      <property name="cacheStoreFactory">
>                          <bean
> class="org.apache.ignite.configuration.IgniteReflectionFactory">
>                              <property name="componentClass"
> value="com.somepackage.someclass"/>
>                          </bean>
>                      </property>
>                      <property name="cacheMode" value="REPLICATED"/>
>                      <property name="readThrough" value="true"/>
>                  </bean>
>              </list>
>          </property>
>
> I have 2 servers running ignite, and I connect with a third client to them
> to get/set cache requests. Once my process is done, I waited 5 minutes, took
> down one ignite server and re-ran my process.
>
> I was expecting all cache requests to be stored entirely in the second
> running ignite instance (meaning replicated there), but found out that it
> was not the case, and the second ignite instance called again to retrieve
> cache data.
Is this second ignite instance the one that has been restarted before?
When a node/instance is restarted it will load data from a cache store
on demand (when a value is requested) or depending on
CacheStore.loadCache() implementation.

If you don't start a node that has been shut down then this is a
different case. Please clarify what is your case exactly.

--
Denis

>
> What am I doing wrong, why are the ignite instances not replicating?
>
> Thanks in advance
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Replicated-Cache-not-replicating-tp1373.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

levaly levaly
Reply | Threaded
Open this post in threaded view
|

Re: Replicated Cache not replicating

Actually it is not being restarted, it is being shut down.
Denis Magda Denis Magda
Reply | Threaded
Open this post in threaded view
|

Re: Replicated Cache not replicating

So, if I understand you properly you're expecting the data to be stored
on a node that was performing the first request.
Since this is a client node the cache data is not replicated on it.

However, you can enable a near cache on the client to boost your queries:
https://apacheignite.readme.io/v1.0/docs/near-caches

--
Denis

On 9/14/2015 1:28 PM, levaly wrote:
> Actually it is not being restarted, it is being shut down.
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Replicated-Cache-not-replicating-tp1373p1381.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.