Infinispan remote cache access

495 views Asked by At

I am a newbie to infinispan and learning by experimenting. I need some help after I failed trying to access a remote cache of different name. Here is the my scenario of infinispan client-server mode not embedded.

1) I started node1 in infinispan cluster and set the default remote cache name to node1_cache. --Hotrod Server started

2) Started node2 in infinispan cluster and set the default remote cache name to node2_cache. --Hotrod Server started

Now in from the Hotrod client I can see the RemoteCacheManager can initialize properly and also the cluster is being setup properly and nodes are getting added to each other in the console.

But the problem is from one single client

1)when I am trying to get the RemoteCache using the name node1_cache, I am getting the instance.

2) But when I try to access the node2_cache, it giving me null for the RemoteCache instance.

Now Am I correct in accessing such way or am I missing anything in this ?

Is it not that a single client can access all the caches of all the node configured across the cluster ?

Please guide me. Thank you.

1

There are 1 answers

0
Jimmy USU On

After a good amount of digging about concepts of distributed cache, I figured out the following concept.

1) I was using two cluster-configuration files for two infinispan nodes, one having dist cache name as node1_cache and other node2_cache.

2) What I figured out that if you have multiple caches with different names, then all those caches must be defined in all the configuration files of the infinispan hot-rod servers in the same cluster. That means in this case both config files must have node1_cache and node2_cache name defined. Then only we can access and use both the caches when we say

remoteCacheManager.getCache("cacheName");.