You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "henrique.arroyo" <he...@ifood.com.br> on 2020/06/01 13:04:59 UTC

ignite load Cache and cluster warm up

Hi everyone, I'm developing an application with apache ignite and I'm looking
for some help

I have an ignite cluster deployment on k8s, currently 3 server nodes and 2
client nodes

I'm using a custom implementation of Ignite CacheStore in order to have a
database backup of cache data

The only situation when data will be loaded from database (loadCache() will
be called) is on the event of a total cluster shutdown or failure, in which
case all data would be lost

I'd like some help figuring out the best way to execute the loadCache
routine upon cluster start up
What I need to guarantee is the following:
 - loadCache has to be called only after cluster have reached a minimum
amount of nodes (currently 3 nodes)
 - no cache operation must be allowed from client nodes until the backup is
successfully loaded

Is this currently possible? If you guys could point me to some specific
documentation I would really apreciate it.

Thanks.



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

Re: ignite load Cache and cluster warm up

Posted by akorensh <al...@gmail.com>.
Hi,
 - loadCache has to be called only after cluster have reached a minimum
amount of nodes (currently 3 nodes)

  You can use events to see when nodes join, or use the cluster api to see
how many servers/clients
   are online, and then call loadCache()
   cluster api:
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cluster/ClusterGroup.html
  
   events: https://apacheignite.readme.io/docs/events
    use:
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/events/EventType.html#EVT_NODE_JOINED  
  example:
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/events/EventsExample.java
 
  see: https://apacheignite.readme.io/docs/3rd-party-store#manual
  example:
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java

 - no cache operation must be allowed from client nodes until the backup is
successfully loaded
  You can use a custom message/a message in a given cache/Distributed data
structure
   or a similar mechanism to prevent client cache operations pending a given
condition.
  see: https://apacheignite.readme.io/docs/data-structures
  examples:
https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/datastructures

  and    https://apacheignite.readme.io/docs/messaging

 you can also use a cache lock:
 
https://apacheignite.readme.io/docs/distributed-locks#locks-and-transactions

Thanks, Alex
      



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