I have a two node JBoss AS 7.1.1.FINAL cluster setup in the following way -
- master - running on Ubuntu Server 12.10 (VirtualBox VM)
- slave - running on Windows 7 (VirtaulBox host machine)
I have deployed a Spring web application on both nodes and I'm trying to set up a working replicated cache. My problem is that the cache does not seem to be replicated even though the clustering apparently works.
My config -
in domain.xml (both on master and slave)
<subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="cluster">
<cache-container name="cluster" aliases="ha-partition" default-cache="default" jndi-name="java:jboss/infinispan/cluster" start="EAGER">
<transport lock-timeout="60000" />
<replicated-cache name="default" mode="SYNC" batching="true">
<locking isolation="REPEATABLE_READ"/>
</replicated-cache>
</cache-container>
</subsystem>
This is pretty much the default config in domain.xml, except for the jndi-name and the EAGER start.
In spring configuration -
<infinispan:container-cache-manager id="cacheManager" cache-container-ref="springCacheContainer" />
<jee:jndi-lookup id="springCacheContainer" jndi-name="java:jboss/infinispan/cluster" />
With this set up, the caching works, but its not replicated. The caches seem to operate independently of each other. Also, the EAGER start seems to have no effect. The caches seem to be initialized only when they are first used.
from master log (first time cache is used)-
[Server:server-one] 03:25:55,756 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ajp-192.168.2.13-192.168.2.13-8009-3) ISPN000078: Starting JGroups Channel
[Server:server-one] 03:25:55,762 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ajp-192.168.2.13-192.168.2.13-8009-3) ISPN000094: Received new cluster view: [master:server-one/cluster|1] [master:server-one/cluster, slave:server-one-slave/cluster]
[Server:server-one] 03:25:55,763 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ajp-192.168.2.13-192.168.2.13-8009-3) ISPN000079: Cache local address is master:server-one/cluster, physical addresses are [192.168.2.13:55200]
[Server:server-one] 03:25:55,769 INFO [org.infinispan.factories.GlobalComponentRegistry] (ajp-192.168.2.13-192.168.2.13-8009-3) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL
[Server:server-one] 03:25:55,851 INFO [org.jboss.as.clustering.infinispan] (ajp-192.168.2.13-192.168.2.13-8009-3) JBAS010281: Started cluster cache from cluster container
from slave log (first time cache is used)-
[Server:server-one-slave] 03:29:38,124 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ajp--192.168.2.10-8009-2) ISPN000078: Starting JGroups Channel
[Server:server-one-slave] 03:29:38,129 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ajp--192.168.2.10-8009-2) ISPN000094: Received new cluster view: [master:server-one/cluster|1] [master:server-one/cluster, slave:server-one-slave/cluster]
[Server:server-one-slave] 03:29:38,130 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ajp--192.168.2.10-8009-2) ISPN000079: Cache local address is slave:server-one-slave/cluster, physical addresses are [192.168.2.10:55200]
[Server:server-one-slave] 03:29:38,133 INFO [org.infinispan.factories.GlobalComponentRegistry] (ajp--192.168.2.10-8009-2) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL
[Server:server-one-slave] 03:29:38,195 INFO [org.jboss.as.clustering.infinispan] (ajp--192.168.2.10-8009-2) JBAS010281: Started cluster cache from cluster container
I don't think this is a udp/multicast issue, as I have mod_cluster, HornetQ and Quartz set up in this cluster and they all work as expected.