1 Reply Latest reply on Sep 12, 2013 8:12 AM by lincolnthree

    How do you create a distributed cache on AS7 or EAP6.1(.1)?

    lincolnthree

      This is basically a simple question. I've got EAP6.1 running on OpenShift in an HAProxy cluster, however OpenShift does clustering, and I'm trying to set up a scalable distributed cache. This is what I have so far in my server config:

       

      <cache-container name="cluster" aliases="ha-partition" jndi-name="java:jboss/infinispan/cluster" default-cache="default">

                                      <transport lock-timeout="60000" />

                                      <distributed-cache name="default" mode="SYNC" owners="2" start="LAZY">

                                                <locking isolation="REPEATABLE_READ"/>

                                                <file-store passivation="true" preload="true" path="cache-data">

                                                </file-store>

                                      </distributed-cache>

      </cache-container>

       

      What I am seeing is each gear/node starts up, and appears to connect to the cluster, but when I populate the cache, and directly access the object from another node, it's null (a cache miss) and thus forces a full repopulation of the data from the origin. More specifically, I'm using the GridFilesystem API to store some filesystems, but those filesystems only appear to be accessible on the node on which they were stored into the cache/grid. Have I missed something obvious? What am I doing wrong here?

       

      I think this log means that the cache is scaling up, but I'm obviously not sure what this really means:

      2013/09/11 16:37:04,641 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-1,shared=tcp) ISPN000094: Received new cluster view: [redoculous.rhcloud.com/cluster|1] [redoculous.rhcloud.com/cluster, 5230d040e0b8cd836e00001e.rhcloud.com/cluster]

      2013/09/11 16:40:42,793 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-3,shared=tcp) ISPN000094: Received new cluster view: [redoculous.rhcloud.com/cluster|2] [redoculous.rhcloud.com/cluster, 5230d040e0b8cd836e00001e.rhcloud.com/cluster, 5230d14a5973ca9c680005f7.rhcloud.com/cluster]

      2013/09/11 16:45:06,250 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-5,shared=tcp) ISPN000094: Received new cluster view: [redoculous.rhcloud.com/cluster|3] [redoculous.rhcloud.com/cluster, 5230d040e0b8cd836e00001e.rhcloud.com/cluster, 5230d14a5973ca9c680005f7.rhcloud.com/cluster, 5230d3af5973ca9c6800064b.rhcloud.com/cluster]

       

      Possibly relevant log items:

      2013/09/11 10:38:02,812 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 39) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.

      And one more:

      2013/09/11 12:10:26,321 INFO  [org.jboss.as.clustering.infinispan] (http-/127.13.158.1:8080-3) JBAS010281: Started repository.cache cache from cluster container

      2013/09/11 12:10:27,020 INFO  [org.infinispan.jmx.CacheJmxRegistration] (http-/127.13.158.1:8080-4) ISPN000031: MBeans were successfully registered to the platform MBean server.

      2013/09/11 12:10:27,025 INFO  [org.jboss.as.clustering.infinispan] (http-/127.13.158.1:8080-4) JBAS010281: Started repo.cache.filesystem cache from cluster container

      2013/09/11 12:10:27,032 INFO  [org.infinispan.jmx.CacheJmxRegistration] (http-/127.13.158.1:8080-4) ISPN000031: MBeans were successfully registered to the platform MBean server.

      2013/09/11 12:10:27,032 INFO  [org.jboss.as.clustering.infinispan] (http-/127.13.158.1:8080-4) JBAS010281: Started repo.cache.metadata cache from cluster container

      Help appreciated. Thanks!

        • 1. Re: How do you create a distributed cache on AS7 or EAP6.1(.1)?
          lincolnthree

          As it turns out, I was calling getCache("namedSomethingElse")  with a name that was not defined in my cache config. Apparently Infinispan defaults to a local cache in that case. Creating named caches in standalone.xml for everything i needed seemed to do the trick:

           

          <cache-container name="cluster" aliases="ha-partition" jndi-name="java:jboss/infinispan/cluster" default-cache="default">

                          <transport lock-timeout="60000" />

                          <distributed-cache name="default" mode="SYNC" owners="2" start="LAZY">

                            <locking isolation="REPEATABLE_READ"/>

                            <file-store passivation="true" preload="true" path="cache-data"></file-store>

                            <eviction strategy="LRU" max-entries="10000"/>

                         </distributed-cache>

                         <distributed-cache name="repository.cache.filesystem" mode="SYNC" owners="2" start="LAZY">

                            <locking isolation="REPEATABLE_READ" />

                            <file-store passivation="true" preload="true" path="cache-data"></file-store>

                            <eviction strategy="LRU" max-entries="10000"/>

                         </distributed-cache>

                         <replicated-cache name="repository.cache.metadata" mode="SYNC">

                            <file-store passivation="true"></file-store>

                            <locking isolation="REPEATABLE_READ" />

                            <eviction strategy="LRU" max-entries="10000"/>

                         </replicated-cache>

          </cache-container>