5 Replies Latest reply on Aug 24, 2015 9:27 AM by pferraro

    session replication to only one node

    jjakub

      Default Wildfly cluster configuration will enable all-to-all session replication - session will be replicated to all nodes in a cluster or all nodes in server group.

       

      I want session to be replicated to only one node - a backup node. I wan't it to be memory effective.

       

      In apache tomcat there is sth like BackupManager in oppose to DeltaManager.

       

      Is it possible to do in Wildfly ? How can I do it most simple way?

       

      Maybe it is possible to do by configuring some multicast addresses creating some subclusters, but I would like to cluster by itself take care of session backup replication.

        • 1. Re: session replication to only one node
          ctomc

          There are many options on how to configure clustering.

          Clustering is backed by infinispan, which has lots of operation modes and configuration options.

           

          for start see Infinispan User Guide

          1 of 1 people found this helpful
          • 2. Re: session replication to only one node
            wdfink

            Which version of WildFly do you use?

            If I look to 9.0x I see that the standalone-ha.xml defines the infinispan caches (web/ejb) as distributed with numOwner=2 which is exact what you want.

             

            If you have further questions you should give us informations about what version do you use, which configuration and use-case you have.

            • 3. Re: session replication to only one node
              pferraro

              Ja kub wrote:

               

              Default Wildfly cluster configuration will enable all-to-all session replication - session will be replicated to all nodes in a cluster or all nodes in server group.

              As of WF8, this is no longer the case.  Our default configuration will only replicate a session to a single node - although any session is still accessible from any node.

               

              I want session to be replicated to only one node - a backup node. I wan't it to be memory effective.

               

              In apache tomcat there is sth like BackupManager in oppose to DeltaManager.

               

              Is it possible to do in Wildfly ? How can I do it most simple way?

               

              Maybe it is possible to do by configuring some multicast addresses creating some subclusters, but I would like to cluster by itself take care of session backup replication.

              The default web session configuration (for both "ha" and "full-ha" server profile) uses a distributed cache, with the number of owners set to 2.  This means that the cluster will only store 2 copies of an given web session, one on node on which the session was created, and another as determined by a consistent hash function.  The old behavior (AS7 and earlier) can be achieved by reverting the cache configuration to a replicated cache.

              1 of 1 people found this helpful
              • 4. Re: session replication to only one node
                jjakub

                Paul thx for response,

                I was mislead (?) by WildFly 8 Clustering and Session Failover (Tech Tip #16)

                     By default, sessions are replicated on all nodes in a server group.

                It seems to me that either Arun or You Paul are mistaken regarding default Wildfly 8 configuration, or I badly understand what I read (I'm esl).

                Possibly by default they are replicated to single node from Wildfly 9, this would be consistent with what Wolf-Dieter wrote.

                Is there any official Wildfly doc in this topic ? Google finds above Arun blog.

                • 5. Re: session replication to only one node
                  pferraro

                  The definitive answer can always be found in the source:

                  https://github.com/wildfly/wildfly/blob/8.0.0.Final/build/src/main/resources/configuration/subsystems/infinispan.xml#L54

                   

                  In 8.0, the default configuration uses a distributed cache with the number of owners set to 4.  We decreased this to 2 in 8.1 and later.

                   

                  Tip #17: Always trust the developer over the marketing guy...

                  1 of 1 people found this helpful