JBoss AS 7 Cluster / Infinispan Issue
rschamm Aug 30, 2012 3:05 PMHi all,
I have been playing with JBoss AS 7 clustering the last few weeks, and in particular the role of infinispan in clustering.
My test env. is setup more or less as described in this article:
https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto
I use JBoss AS 7 domain mode, with one "master" host and one "slave" host. Further I use the "full-ha" profile for the "other-server-group".
...
<server-group name="other-server-group" profile="full-ha">
...
So in the "master" host I start server "server-three":
...
<server name="server-three" group="other-server-group" auto-start="true">
...
And in the "slave" host I start server "server-six" (I renamed the three slave servers to 4,5 and 6):
...
<server name="server-six" group="other-server-group" auto-start="true">
...
I successfully tested web session replication, sfsb replication and the second-level hibernate cache with this setup.
But when I try and test this bean to use the infinispan "cluster" cache container for my own purposes I start running into issues:
...
@ConcurrencyManagement(ConcurrencyManagementType.CONTAINER)
@Singleton
public class CacheBean
{
@Resource(lookup = "java:jboss/infinispan/container/cluster")
private org.infinispan.manager.CacheContainer container;
private org.infinispan.Cache<String, String> cache;
public CacheBean()
{
}
@PostConstruct
public void start()
{
System.out.println("*********************");
System.out.println("Init cache!!!!");
System.out.println("*********************");
this.cache = this.container.getCache();
}
@Lock(LockType.WRITE)
public void save(String t)
{
cache.put(generateKey(), t);
}
@Lock(LockType.WRITE)
public void clear()
{
cache.clear();
}
@Lock(LockType.READ)
public List<String> getCacheList()
{
List<String> dataList = new ArrayList<String>();
dataList.addAll(cache.values());
return dataList;
}
private String generateKey()
{
String uuid = UUID.randomUUID().toString();
return uuid;
}
}
...
Everything works fine if I start up "master" first and then "slave", and then first use the cache against the master instance. So I wait for the "master" to finish starting up and then start up the "slave". Then I call a servlet using the above bean against the master instance and then I call the same servlet in either "slave" or "master" and everything works fine.
But, if I first use the cache (e.g in a servlet) against the "slave" the page locks up for 60 seconds, and then I see this log in the slave output:
org.infinispan.util.concurrent.TimeoutException: Timed out after 60 seconds waiting for a response from master:server-three/cluster
org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.processCalls(CommandAwareRpcDispatcher.java:333)
org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:132)
org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:492)
org.infinispan.cacheviews.CacheViewsManagerImpl.join(CacheViewsManagerImpl.java:213)
Has anyone see this kind of output before: "Timed out after 60 seconds waiting for a response from master:server-three/cluster" ?
I hope I made some sense. Everything else I tested so far works like a charm, but this last issue is still eluding me.
Thanks all!