2 Replies Latest reply on Jan 24, 2013 11:30 AM by Gary Brown

    Cluster problem in AS7.1.3

    Gary Brown Master

      Hi

       

      I have a component deployed to AS 7.1.3.final that programmatically configures a cache manager. From the log it seems like infinispan is establishing a cluster (through jgroups) between two nodes I start on the same machine, with port-offset of 1000.

       

      17:40:43,542 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-1,null) ISPN000094: Received new cluster view: [node1/cluster|1] [node1/cluster, node2/cluster]

       

      However when changes occur to the cache on one node, they don't appear in the cache when accessed on the other node.

       

      The code is:

       

       

              
      GlobalConfiguration glob = new GlobalConfigurationBuilder()
                  
      .nonClusteredDefault() //Helper method that gets you a default constructed GlobalConfiguration, preconfigured for use in LOCAL mode
                  
      .globalJmxStatistics().enable() //This method allows enables the jmx statistics of the global configuration.
                  
      .jmxDomain("...") //prevent collision with non-transactional carmart
                  
      .transport().defaultTransport()
                  
      .build(); //Builds the GlobalConfiguration object
              
      Configuration loc = new ConfigurationBuilder()
                  
      .jmxStatistics().enable() //Enable JMX statistics
                  
      .clustering().cacheMode(CacheMode.REPL_SYNC) //Set Cache mode to LOCAL - Data is not replicated.
                  
      .transaction().transactionMode(TransactionMode.TRANSACTIONAL).autoCommit(false) //Enable Transactional mode with autocommit false
                  
      .lockingMode(LockingMode.PESSIMISTIC).transactionManagerLookup(new GenericTransactionManagerLookup()) //uses GenericTransactionManagerLookup - This is a lookup class that locate transaction managers in the most popular Java EE application servers. If no transaction manager can be found, it defaults on the dummy transaction manager.
                  
      .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) //Sets the isolation level of locking
                  
      .eviction().strategy(EvictionStrategy.NONE)
                  
      .loaders().passivation(false).addFileCacheStore().purgeOnStartup(true) //Disable passivation and adds a FileCacheStore that is purged on Startup
                  
      .build(); //Builds the Configuration object
              
      
      
      
      

       

      This config was based on one of the infinispan quickstarts, although I changed it from CacheMode.LOCAL to REPL_SYNC, which also required the transport to be set on the GlobalConfiguration. Locking mode was also changed to PESSIMISTIC as my code uses explicit locking, and it complained that explicit locking couldn't be performed with optimistic locking mode.

       

      Any suggestions on what might be wrong would be appreciated.

       

      Regards

      Gary

        • 1. Re: Cluster problem in AS7.1.3
          Gary Brown Master

          With trace logging, it showed my cache manager was not clustered - so the previously mentioned message was related to the 'cluster' cache manager in the standalone-full-ha.xml.

           

          So would like to confirm that it is possible to programmatically (or using the infinispan config xml file loading approach) set up a cache manager for use in a cluster, specifically with a replicated cache. Or do cache managers in AS7 have to be defined in the AS7 config files?

           

          Thanks in advance for any pointers.

           

          Regards

          Gary

          • 2. Re: Cluster problem in AS7.1.3
            Gary Brown Master

            This particular issue was because of the .nonClusteredDefault(), which should have been .clusteredDefault(). Still not fully working, but atleast it is now trying to establish the cluster, so making progress