[infinispan-dev] Got a local cache despite it is configured as distributed

Pierrick HYMBERT pierrick.hymbert at gmail.com
Wed Feb 3 14:11:52 EST 2016


Thanks for your feedback. There is no firewall, server nodes are on the
same host, I use default full-ha jgroups config. You can check the code in
the link, I also attached domain configuration.

I found a workaround  by configuring cache definition programatically (that
is unexpected, I guess there is an issue in
wildfly-clustering-infinispan-extension artifact...):

// this.myAppCache = this.cacheContainer.getCache("myAppCache");
this.cacheContainer.defineConfiguration("dist", new ConfigurationBuilder()
.clustering()
.cacheMode(CacheMode.DIST_SYNC)
.hash().numOwners(2)
.build()
);
this.myAppCache = this.cacheContainer.getCache("dist");

And now it works:

2016-02-02 12:20:25,925 INFO [org.hypik.test.jboss.eap7.server.TestService]
(EJB default - 7) Produce new cache entry 1454404825925 on node
master:server-one
2016-02-02 12:20:26,008 INFO [org.hypik.test.jboss.eap7.server.TestService]
(EJB default - 8) Cache size on node master:server-one = 172

2016-02-02 12:20:26,009 INFO [org.hypik.test.jboss.eap7.server.TestService]
(EJB default - 5) Cache size on node master:server-two = 172


Le mar. 2 févr. 2016 17:30, Sanne Grinovero <sanne at infinispan.org> a écrit :

> Hi,
> that's unlikely to be an Infinispan bug as we have many tests and
> other features relying on it.
> It probably is a networking configuration problem: if you start
> multiple servers in a cluster but they do not manage to connect to
> each other they will start as independent nodes (disconnected from
> each other) and effectively behave like they were configured in LOCAL
> mode.
>
> I would suggest to check your JGroups stack for it using the network
> interface that you intended, it using a correct Discovery protocol for
> your environment, and possibly details like your firewall?
>
> On 2 February 2016 at 08:19, Pierrick HYMBERT
> <pierrick.hymbert at gmail.com> wrote:
> > Hi all,
> >
> > I am blocked to deploy a test app that use a distributed infinispan
> (8.0.1)
> > cache within 2 wildfly (10.0.0) domain nodes and a cache entry producer
> > deployed as clustered singleton service.
> >
> > Your feedback/advise are really appreciated!
> >
> > Cache definition:
> >
> >                 <cache-container name="my-cache-container">
> >                     <transport lock-timeout="60000"/>
> >                     <distributed-cache name="myAppCache" mode="SYNC">
> >                         <transaction mode="NONE"/>
> >                         <eviction strategy="NONE"/>
> >                     </distributed-cache>
> >                 </cache-container>
> >
> > Sample code:
> >
> >   @Resource(lookup =
> "java:jboss/infinispan/container/my-cache-container")
> >   private EmbeddedCacheManager cacheContainer;
> >
> >   private Cache<Long, Long> myAppCache;
> >
> >   @PostConstruct
> >   public void startNotClustered() throws NamingException {
> >     this.myAppCache = this.cacheContainer.getCache("myAppCache");
> >     ...
> >   }
> >
> >   ...
> >
> >   @Schedule(hour = "*", minute = "*", second = "*")
> >   public void consume() {
> >     logger.info("Cache size on node {} = {}",
> >         System.getProperty("jboss.node.name"), myAppCache.size());
> >   }
> >
> >
> > Server one sample logs:
> > 2016-01-31 14:52:03,789 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 1) Produce new cache entry 1454241123789 on node
> > master:server-one
> > 2016-01-31 14:52:04,005 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 2) Cache size on node master:server-one = 35
> > 2016-01-31 14:52:04,796 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 3) Produce new cache entry 1454241124796 on node
> > master:server-one
> > 2016-01-31 14:52:05,006 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 4) Cache size on node master:server-one = 36
> > 2016-01-31 14:52:05,801 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 5) Produce new cache entry 1454241125801 on node
> > master:server-one
> > 2016-01-31 14:52:06,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 6) Cache size on node master:server-one = 37
> > 2016-01-31 14:52:06,807 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 7) Produce new cache entry 1454241126807 on node
> > master:server-one
> > 2016-01-31 14:52:07,005 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 8) Cache size on node master:server-one = 38
> > 2016-01-31 14:52:07,813 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 9) Produce new cache entry 1454241127813 on node
> > master:server-one
> > 2016-01-31 14:52:08,006 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 10) Cache size on node master:server-one = 39
> > 2016-01-31 14:52:08,817 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 1) Produce new cache entry 1454241128817 on node
> > master:server-one
> > 2016-01-31 14:52:09,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 2) Cache size on node master:server-one = 40
> >
> > Server two logs:
> > 2016-01-31 14:51:56,006 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 4) Cache size on node master:server-two = 0
> > 2016-01-31 14:51:57,008 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 5) Cache size on node master:server-two = 0
> > 2016-01-31 14:51:58,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 6) Cache size on node master:server-two = 0
> > 2016-01-31 14:51:59,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 7) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:00,006 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 8) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:01,008 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 9) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:02,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 10) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:03,006 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 1) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:04,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 2) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:05,008 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 3) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:06,006 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 4) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:07,006 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 5) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:08,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 6) Cache size on node master:server-two = 0
> > 2016-01-31 14:52:09,007 INFO
> [org.hypik.test.jboss.eap7.server.TestService]
> > (EJB default - 7) Cache size on node master:server-two = 0
> >
> >
> > I have attached all necessary info to investigate, but I am not sure
> > attachement is allowed, so you can see source and logs here:
> >
> https://www.dropbox.com/s/l1uhmfg5tkjkikw/infinispan-issue-wildfly-10.0.0.zip?dl=0
> >
> > С уважением / Cordialement / Best regards,
> >
> > Pierrick HYMBERT
> >
> > _______________________________________________
> > infinispan-dev mailing list
> > infinispan-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20160203/f86e6d07/attachment.html 


More information about the infinispan-dev mailing list