1 2 Previous Next 19 Replies Latest reply on Apr 30, 2018 4:04 PM by Vamshi Krishna

    HowTo enable session-replication in EAP7 ..?

    Vamshi Krishna Newbie

      Hey folks,

       

      I have a requirement to enable session replication on JBoss EAP7 in a clustered environment using full-ha profile domain mode, from different sources I heard some of the configuration is already defined in jboss(domain.xml) but i am not sure what configuration settings are those and what needs to be changed..... any help on how to configure it would be greatly appreciated thanks in advance  !!

        • 1. Re: HowTo enable session-replication in EAP7 ..?
          Paul Ferraro Master

          This behavior is enabled by adding <distributable/> to your web application's web.xml.  When used with the "ha" or "full-ha" profile, session replication should work without any additional configuration changes.

          • 2. Re: HowTo enable session-replication in EAP7 ..?
            Vamshi Krishna Newbie

            Thanks pferraro Sorry, i failed to mention that I have F5 in front of my appServer and I don't have webServer. When I looked at the infinispan subsystem I see the configuration for server and web are different, do I need to make any changes to server section as the cache currently says default cache and not "dist". Also any changes required to make in jgroups if I need to use tcp over udp ?

             

                        <subsystem xmlns="urn:jboss:domain:infinispan:4.0">

                            <cache-container name="server" aliases="singleton cluster" default-cache="default" module="org.wildfly.clustering.server">

                                <transport lock-timeout="60000"/>

                                <replicated-cache name="default" mode="SYNC">

                                    <transaction mode="BATCH"/>

                                </replicated-cache>

                            </cache-container>

             

                            <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">

                                <transport lock-timeout="60000"/>

                                <distributed-cache name="dist" mode="ASYNC" l1-lifespan="0" owners="2">

                                    <locking isolation="REPEATABLE_READ"/>

                                    <transaction mode="BATCH"/>

                                    <file-store/>

                                </distributed-cache>

                                <distributed-cache name="concurrent" mode="SYNC" l1-lifespan="0" owners="2">

                                    <file-store/>

                                </distributed-cache>

                            </cache-container>

             

                            <cache-container name="ejb" aliases="sfsb" default-cache="dist" module="org.wildfly.clustering.ejb.infinispan">

                                <transport lock-timeout="60000"/>

                                <distributed-cache name="dist" mode="ASYNC" l1-lifespan="0" owners="2">

                                    <locking isolation="REPEATABLE_READ"/>

                                    <transaction mode="BATCH"/>

                                    <file-store/>

                                </distributed-cache>

                            </cache-container>

                            <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">

                                <transport lock-timeout="60000"/>

                                <local-cache name="local-query">

                                    <eviction strategy="LRU" max-entries="10000"/>

                                    <expiration max-idle="100000"/>

                                </local-cache>

                                <invalidation-cache name="entity" mode="SYNC">

                                    <transaction mode="NON_XA"/>

                                    <eviction strategy="LRU" max-entries="10000"/>

                                    <expiration max-idle="100000"/>

                                </invalidation-cache>

                                <replicated-cache name="timestamps" mode="ASYNC"/>

                            </cache-container>

                        </subsystem>

            • 4. Re: HowTo enable session-replication in EAP7 ..?
              Paul Ferraro Master

              When I looked at the infinispan subsystem I see the configuration for server and web are different, do I need to make any changes to server section as the cache currently says default cache and not "dist".

               

              Don't be confused by the names.  Only the "web" cache-container is involved in web session replication  (you can override this, but that is another story).  By default, a <distributable/> web application will store session data in a cache configured using the configuration of the default-cache of the "web" cache container.

               

              Also any changes required to make in jgroups if I need to use tcp over udp ?

              To use a TCP-based protocol stack, you can do one of a few things:

              1. Change the stack of the default-channel as defined by the JGroups subsystem.

              e.g.

              <channels default="ee">
              
              
                  <channel name="ee" stack="tcp"/>
              
              
              </channels>
              

               

              2. Create a new JGroups channel that uses the "tcp" stack and configure your web cache-container to use it.

              e.g.

              <channel name="foo" stack="tcp"/>

               

              <cache-container name="web">
              
              
                <transport channel="foo"/>
              
              
                <!-- ... -->
              
              
              </cache-container>
              
              • 5. Re: HowTo enable session-replication in EAP7 ..?
                Vamshi Krishna Newbie

                Thanks pferraro, sorry i am new to this topic I might be asking too many questions.... So by default the "server" cache-container is default-cache which is replicated cache is that correct understanding ? I have F5 in front of my appServer does the "server" cache-container default configuration still best to implement session replication or do I have to make any changes in absence of webServer ..? And the session replication can happen in a cluster with multiple jvms/servers in it, can the session replication work between two different profiles.

                 

                Can session replication be implemented between GREEN and BLUE, does the below architecture work or do i need to update.

                Host A - DC (Master)

                Either one of GREEN/BLUE will be active at any instance of time.

                GREEN

                profile-full-ha-1

                Host B - Cluster1 - JVM1

                Host C- Cluster1 - JVM2

                 

                profile-full-ha-2

                BLUE

                Host D - Cluster2 - JVM1

                Host E - Cluster2 - JVM2

                • 6. Re: HowTo enable session-replication in EAP7 ..?
                  Paul Ferraro Master

                  vamshi1413  wrote:

                  So by default the "server" cache-container is default-cache which is replicated cache is that correct understanding ?

                  Yes - but this has nothing to do with web session replication.  The "web" cache container is used for that.  You can easily modify the default cache of the "web" cache container to use a replicated cache (instead of a distributed cache), if that is your requirement.

                   

                  I have F5 in front of my appServer does the "server" cache-container default configuration still best to implement session replication or do I have to make any changes in absence of webServer ..?

                  Stick with the "web" cache-container for web session configuration.  The "server" cache-container is intended for different use cases (e.g. singleton services/deployments, etc.).

                   

                  The absence of a web server shouldn't impact the configuration of the cache used for web sessions.  Just make sure you have sticky sessions enabled in F5.

                   

                  And the session replication can happen in a cluster with multiple jvms/servers in it, can the session replication work between two different profiles.

                   

                  Can session replication be implemented between GREEN and BLUE, does the below architecture work or do i need to update.

                  Host A - DC (Master)

                  Either one of GREEN/BLUE will be active at any instance of time.

                  GREEN

                  profile-full-ha-1

                  Host B - Cluster1 - JVM1

                  Host C- Cluster1 - JVM2

                   

                  profile-full-ha-2

                  BLUE

                  Host D - Cluster2 - JVM1

                  Host E - Cluster2 - JVM2

                  A "profile" is just a set of shared configuration - it has no direct implication for how servers are clustered, but rather how they are managed.

                  You can certainly setup replication between GREEN and BLUE - but you'll have to be more descriptive. Are GREEN and BLUE different physical locations (e.g. separate sites/data centers)?  Is there some reason why hosts B, C, D, and E cannot for a cluster?  If so, you'll want to setup cross-site replication - see the documentation for that.

                  Otherwise, just use traditional session replication.

                  • 7. Re: HowTo enable session-replication in EAP7 ..?
                    Vamshi Krishna Newbie

                    Stick with the "web" cache-container for web session configuration.  The "server" cache-container is intended for different use cases (e.g. singleton services/deployments, etc.).

                     

                    The absence of a web server shouldn't impact the configuration of the cache used for web sessions.  Just make sure you have sticky sessions enabled in F5.

                    B, C, D & E are in same network/datacenter.

                    Wow, all these time I was thinking that "server" cache-container was for applications that are for servers which don't have web server thanks for clarifying

                     

                    A "profile" is just a set of shared configuration - it has no direct implication for how servers are clustered, but rather how they are managed.

                    You can certainly setup replication between GREEN and BLUE - but you'll have to be more descriptive. Are GREEN and BLUE different physical locations (e.g. separate sites/data centers)?  Is there some reason why hosts B, C, D, and E cannot for a cluster?  If so, you'll want to setup cross-site replication - see the documentation for that.

                    Otherwise, just use traditional session replication.

                     

                    B, C, D & E are in the same network/data center.

                     

                    Coming to BLUE n GREEN model, currently I have GREEN active(running) and BLUE is inactive(down) in F5 and if there is a new requirement or change that need to be deployed then we deploy to BLUE which is inactive at that moment and test to make sure everything is ok and then add BLUE to F5 and take down GREEN. Then we will have BLUE in active and GREEN in inactive mode at the end of the deploy that way we are HA.

                    • 8. Re: HowTo enable session-replication in EAP7 ..?
                      Paul Ferraro Master

                      B, C, D & E are in the same network/data center.

                       

                      Coming to BLUE n GREEN model, currently I have GREEN active(running) and BLUE is inactive(down) in F5 and if there is a new requirement or change that need to be deployed then we deploy to BLUE which is inactive at that moment and test to make sure everything is ok and then add BLUE to F5 and take down GREEN. Then we will have BLUE in active and GREEN in inactive mode at the end of the deploy that way we are HA.

                      OK - I see. I would recommend configuring a single cluster across all hosts (as opposed to 2 separate clusters with a relay) using a replicated-cache to store web session data.

                      • 9. Re: HowTo enable session-replication in EAP7 ..?
                        Vamshi Krishna Newbie

                        OK - I see. I would recommend configuring a single cluster across all hosts (as opposed to 2 separate clusters with a relay) using a replicated-cache to store web session data.

                        If I configure 1-profile,1-cluster and 4-jvms then if there is a change to any of my datasource or messaging subsystem then I'll be impacting active servers right.

                        • 10. Re: HowTo enable session-replication in EAP7 ..?
                          Paul Ferraro Master

                          You can still use 2 profiles (remember a profile is just a set of common configuration) and 1 cluster.  By 1 cluster, I mean all 4 hosts communicate over the same JGroups channel with a view of 4 members.  The default TCP-based protocol stack uses MPING for discovery, which uses multicast.  Just make sure both profiles use the same multicast address/port and everything should just work.

                          • 11. Re: HowTo enable session-replication in EAP7 ..?
                            Vamshi Krishna Newbie

                            I am confused now, if I create 2 profiles and 1 cluster then I can assign the cluster to only 1 profile in server-group section.

                            • 12. Re: HowTo enable session-replication in EAP7 ..?
                              Paul Ferraro Master

                              What do you mean by "assign the cluster to only 1 profile"?  There is no configuration entity for "a cluster".

                              Servers will cluster if their JGroups configuration and network enables them to see each other (and assuming they share the same logical cluster name).

                              • 13. Re: HowTo enable session-replication in EAP7 ..?
                                Vamshi Krishna Newbie

                                I mean I can assign server-group to only 1 profile, below is the server-group section from domain.xml

                                 

                                    <server-groups>

                                        <server-group name="main-server-group" profile="full">

                                            <jvm name="default">

                                                <heap size="1000m" max-size="1000m"/>

                                            </jvm>

                                            <socket-binding-group ref="full-sockets"/>

                                        </server-group>

                                        <server-group name="other-server-group" profile="full-ha">

                                            <jvm name="default">

                                                <heap size="1000m" max-size="1000m"/>

                                            </jvm>

                                            <socket-binding-group ref="full-ha-sockets"/>

                                        </server-group>

                                    </server-groups>

                                • 14. Re: HowTo enable session-replication in EAP7 ..?
                                  Paul Ferraro Master

                                  A "server-group" is a management abstraction - it does not imply or necessitate a cluster.  A server-group is merely a group of servers that share the same configuration (i.e. profile).  Additionally, multiple server-groups can use the same profile.

                                  Whether servers from different server groups form a cluster has to do with whether their socket-bindings are compatible with each other.  Assuming each server resides on a unique host (meaning, all servers can use the same set of ports without conflict), 2 server-groups using the same "ha" or "full-ha" profile and the same socket-binding-group should form a single cluster.

                                  1 2 Previous Next