4 Replies Latest reply on Aug 5, 2014 2:39 PM by Paris Apostolopoulos

    Wildfly 8.1, standalone-ha, use of Infinispan (lib mode) - simple clustering- any hints? tips?

    Paris Apostolopoulos Newbie

      Hello in my local machine I am spawning 2 instances of a standard Wildfly 8.1 server (MacoSX. JDK7)


      Start server one : standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=nodeOne
      Start server two : standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=nodeTwo -Djboss.socket.binding.port-offset=100


      No problem with the above, I am deploying a fairly complex ear, that is using infinispan in library mode in order to configure 2 named-caches that I want to be 'replicated'. I am using Wildfly libs (so I am exposing the jars bundled with the server in order to be used in my code imports).


      <sub-deployment name="xxx-cache.jar">
                  <module name="org.infinispan" services="import"/>
                  <module name="org.infinispan.commons" services="import"/>

      In order to configure my caches I am not using the standalone.xml files but a specific infinispan-config.xml , the reason is that the same configuration and ear is currently being deployed on another application server, so I want to keep some sort of common config/code base. Up until now the caches configured by the file below in Local non relicated mode, where working very well. The server was picking my configuration, from a startup ejb at the moment, and was initialising the 2 caches.


      I need some hints or help with the configuration on clusterd mode, this is my infinispan-cofig.xml


              <transport  clusterName="omniacluster"/>
          <default />
          <namedCache name="restSessionCache">
              <eviction strategy="LIRS" maxEntries="2000"/>
              <clustering mode="REPL">
                  <stateTransfer  chunkSize="0"  fetchInMemoryState = "false"  timeout ="2000"/>
                  <sync replTimeout="2000"/>
          <namedCache name="environmentCache">
              <clustering mode="REPL">
                  <stateTransfer  chunkSize="0"  fetchInMemoryState = "false"  timeout ="2000"/>
                  <sync replTimeout="2000"/>
              <eviction strategy="NONE"/>

      It is being initialised like that in a @Startup Bean


          private void createManager(){
                  manager = new DefaultCacheManager("infinispan-config.xml");
              } catch (IOException e){
              restSessionCache = manager.getCache("restSessionCache");
              environmentCache = manager.getCache("environmentCache");
              /*  methods to load data from the DB to the cache */


      I need some hints or help with the configuration on clusterd mode . My questions are


      1. Is there the proper way on a 2 node standalone-ha cluster to use the bundled Infinispan jars to configure my replicated caches?

      2. Do I need to provide any extra jgroups.xml configuration?


      At the time being, I can not see my caches on the 2 nodes to replicate data. Any tips or hints to the right direction would be much appreciated!


      Many thanks!