4 Replies Latest reply on Mar 17, 2015 9:18 AM by Mehdi Rakhshani

    Configuration of cluster members in a replicated clustering mode

    Mehdi Rakhshani Newbie

      My prototypes show that in a replicated clustering mode cluster members can be configured differently, for example, when app1 and app2 share the same named cache, app1 can be configured to have maxEntries=1000000 with no file store while app2 is configured to have maxEntries=1000 and a single file store. Both are configured with:

      <clustering mode="replication">

      <stateTransfer chunkSize="0" fetchInMemoryState="true" timeout="240000"/>

      <sync replTimeout="20000"/>

      </clustering>

       

      What I have seen is that if app1 is started first and loads the named cache from the DB, when app2 is started it gets a copy of the cache very quickly (nice).

       

      However, if app1 is brought down and brought back up, app1 gets a copy of only the in-memory portion of the named cache from app2. What has been evicted to the file store of app2 is not sent to app1's cache.

       

      Questions:

       

      • Is there a way to have app1’s cache loaded from all the cache in app2 including what is in its file store?
      • Are there any known issues or concerns with having such a setup?

        

        • 1. Re: Configuration of cluster members in a replicated clustering mode
          Pedro Ruivo Novice

          Hi Mehdi,

           

          Can you post the store configuration from app2?

          What infinispan version are you using?

           

          We always assumed the same configuration in different nodes, but in your example it should work.

           

          Cheers,

          Pedro

          • 2. Re: Configuration of cluster members in a replicated clustering mode
            Mehdi Rakhshani Newbie

            Thanks for the reply. The difference between the two apps' setup would be maxEntries: - app1 (the cache-manager) would have a large enough number that holds all records in memory - app2 (the app-server) would have a much smaller number so that its container (tomcat) memory requirements would not be so great. It would have a single file store. I am using Infinispan 6.0 but would be open to upgrade to a newer version (see another discussion on started in this forum). Configuration file for app2:

            • 3. Re: Configuration of cluster members in a replicated clustering mode
              Pedro Ruivo Novice

              You forgot to put the app2 cache store configuration but I believe you forgot to set fetchPersistentState to true.

              • 4. Re: Configuration of cluster members in a replicated clustering mode
                Mehdi Rakhshani Newbie

                Thank you, that worked. The paste of the configuration file disappeared and it would not let me reply again until 3600 seconds had passed. Anyway, below is the configuration for app2. By changing fetchPersistentState="false" to fetchPersistentState="true" I see that app1 now gets the full cache from app2 not just what is in memory.

                 

                <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"
                            xmlns="urn:infinispan:config:6.0">

                <global>
                  <!-- for distributed cache -->
                  <transport>
                   <properties>
                    <property name="configurationFile" value="jgroups.xml"/>
                   </properties>
                  </transport>
                   </global>
                  
                   <default>
                     <locking
                      isolationLevel="REPEATABLE_READ"
                     />
                     <eviction
                      maxEntries="20000"
                      strategy="LIRS"     
                     />
                     <expiration
                      lifespan="-1"
                     />
                     <persistence passivation="false">
                   <!-- If ignoreModifications is set to true items that are evicted will not be in the store
                     and hence not found -->
                <!--
                -->
                   <singleFile
                    shared="false"
                    fetchPersistentState="false"
                    ignoreModifications="false"
                    purgeOnStartup="true"
                    preload="false"
                    location="Infinispan-SingleFileCacheStore">
                             </singleFile>
                     </persistence>
                  <!-- Configure a local, synchronous -->
                  <clustering mode="local">
                   <sync/>
                  </clustering>
                  <jmxStatistics
                   enabled="true"
                  />
                   </default>

                  
                <namedCache name ="EdiCache">
                  <clustering mode="replication">
                   <stateTransfer chunkSize="0" fetchInMemoryState="true" timeout="240000"/>
                   <sync replTimeout="20000"/>
                  </clustering>
                </namedCache>

                <namedCache name ="BuCache">
                  <clustering mode="replication">
                   <stateTransfer chunkSize="0" fetchInMemoryState="true" timeout="240000"/>
                   <sync replTimeout="20000"/>
                  </clustering>
                </namedCache>

                <namedCache name ="ClusterCache">
                     <eviction
                      maxEntries="2"
                     />
                  <clustering mode="replication">
                   <stateTransfer chunkSize="0" fetchInMemoryState="true" timeout="240000"/>
                   <sync replTimeout="20000"/>
                  </clustering>
                </namedCache>

                </infinispan>