Infinispan Cluster

Tag: infinispan Author: zwx7265883 Date: 2013-06-03

I need to form a infinispan cluster in distributed mode. This cache is used for storing session data. Currently I am using tomcatInfinispanSessionManager developed by Manik from Jboss team.

I have created the infinispan xml in distributed mode and using two tomcats for testing. Using apache as a load balancer. Each machine has its own copy of infinispan cache entry. When any of the tomcat is shut down the session is retrieved from other infinispan cache.

My question is: how to make this cache entry into an infinispan server (either using hotrod/memcached) that is running on a separate machine?

Other Answer1

If you add a remote cache loader to the cache configuration you have, it'll back up the data in a remote Hot Rod server, assuming you configure the IP:Port address of the Hot Rod server(s) correctly.

However, if you're trying to cluster your session data, I'd highly recommend you download JBoss EAP 6.1, which comes with Infinispan-based cluster-ready session data storage out of the box. The session cache can still be configured with a remote cache loader too, but the configuration will be slightly different since it uses JBoss EAP configuration format.


Thank you very much Galder. I will try using the remote cache loader.
Is this loader is supported in infinispan 5.1 or is it supported from 5.2 and 5.3?
Community level support is limited to the latest version: Infinispan 5.3 currently. For earlier versions, you might need professional support.

Other Answer2

I am using ispn 5.1 version and started the server in hotrod mode. My cache config xml is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi=""
    xmlns="urn:infinispan:config:5.3" xmlns:remote="urn:infinispan:config:remote:5.3">
        <transport clusterName="tomcatSession">
                <property name="configurationFile"
        <globalJmxStatistics enabled="true" />
    <namedCache name="tc_session_ispn-sess-mgr">
        <clustering mode="distribution">
            <l1 enabled="true" lifespan="600000" />
            <remoteStore xmlns="urn:infinispan:config:remote:5.3"
                fetchPersistentState="false" ignoreModifications="false"
                purgeOnStartup="false" remoteCache="myCache" rawValues="true">
                    <server host="" port="11222" />
                <connectionPool maxActive="10" exhaustedAction="CREATE_NEW" />
                <async enabled="true" />

While using this cache config xml I am gettong the following exception

Exception in thread "main" org.infinispan.config.ConfigurationException: ParseError at [row,col]:[39,104]
Message: Unexpected element '{urn:infinispan:config:remote:5.3}remoteStore' encountered
    at org.infinispan.configuration.parsing.Parser.parse(
    at org.infinispan.configuration.parsing.Parser.parse(
    at org.infinispan.manager.DefaultCacheManager.<init>(
    at org.infinispan.manager.DefaultCacheManager.<init>(
    at org.infinispan.manager.DefaultCacheManager.<init>(

Kindly correct me if I am wrong and suggest how to proceed further?


If you're passing in Infinispan 5.3 configuration, you should run Infinispan 5.3 version. The error comes because Infinispan 5.1 can't understand Infinispan 5.3 configuration. Make up your mind ;)
Thank you very much. Used 5.2 version and working fine.