9 Replies Latest reply on Apr 13, 2017 8:10 AM by pferraro

    wildfly 10 session replication issue

    bages

      I tried to configure a cluster with a load balancer with Wildfly 10 based on the Wildfly 10 High Availability guide:

      https://docs.jboss.org/author/display/WFLY10/Clustering+and+Domain+Setup+Walkthrough

       

      It works fine, except session replication (to test it i used a simple jsp that prints out the session ID). It seems to be not replicated at all. When I trigger a failover, on the new machine a new session id is created.

       

      Please note, that doing the same procedure with Wildfly 9, session replication works fine.

       

      Did anyone face similar issues on Wildfly 10?

        • 1. Re: wildfly 10 session replication issue
          wdfink

          Not that I'm aware of.

          Did you see the cluster is build in the logfiles?

          Do you use the default "ha" or "full-ha" configuration?

          Could you attach the configuration, start option and log exerpt?

          • 2. Re: wildfly 10 session replication issue
            bages

            I am not entirely sure what i am supposed to see in case of a proper cluster startup, but my guess is the cluster is not built. I tried to check the cluster configuration with a small servlet based on this arcticle: http://www.mastertheboss.com/jboss-server/jboss-cluster/jboss-cluster-discover-cluster-members

            In the servlet I simply log out all discovered cluster nodes base on this code snippet:

             

                    Channel channel = (Channel) CurrentServiceContainer.getServiceContainer().getService(ServiceName.JBOSS.append("jgroups", "channel", "web")).getValue();

             

                    List<org.jgroups.Address> members = channel.getView().getMembers();

                    List< IpAddress> addresses = new ArrayList< IpAddress>();

             

             

                    for (org.jgroups.Address member: members) {

                        PhysicalAddress physicalAddr = (PhysicalAddress)channel.down(new Event(Event.GET_PHYSICAL_ADDRESS, member));

                        IpAddress ipAddr = ( IpAddress)physicalAddr;

                        System.out.println("Found IP: "+ipAddr.getIpAddress().getHostAddress());

                        addresses.add(ipAddr);

                    }

             

             

            On Wildfly 9 this properly prints the two cluster nodes. In Wildfly 10 it simply prints localhost (127.0.0.1).

             

             

             

            I have put the cluster nodes under "other-server-group" which is using full-ha profile.

             

             

            I have attached the startup logs (i am using master-slave configuration, both hosts running 1-1 cluster server node) and the used configuration.

            • 3. Re: wildfly 10 session replication issue
              xxlali

              Hi Sandor,

               

              We are facing the same issue with standalone(not domain mode) clustering with "ha" configuration xml file. We tested it on our current production environment Wildfly 8.2 and it works fine. We want to run it on the new release Wildfly 10 to upgrade to latest changes however cluster forms(nodes registers to each other) but session is not replicated on a failover case. Have you found any solution for the problem?

              • 4. Re: wildfly 10 session replication issue
                bages

                Hi Ali,

                 

                no solution yet. Right now this topic has lower priority in my project, but I will definitely post here if a solution is found later.

                • 5. Re: wildfly 10 session replication issue
                  xxlali

                  Hi Sandor,

                   

                  We have found a solution.

                   

                  We have a web-fragment.xml for general purpose configuration and a web.xml for project specific configuration. With these configurations, clustering does not work.

                  But if we delete web-fragment.xml and move its content to web.xml, everything works fine.

                  Maybe this is the case for you too.

                  • 6. Re: wildfly 10 session replication issue
                    wdfink

                    Yes,

                    if you have web-fragment.xml files this might switch <distributable> which is enabled in web.xml back to false - unfortunately without any warning.

                    This will be fixed with [WFLY-6626] Add log message indicating disabled <distributable/> flag from web-fragments

                    • 7. Re: wildfly 10 session replication issue
                      danielserva

                      Hi,

                      I am facing the same issue in my environment, but I don't have any web-fragment.xml in my application.

                      Has anyone found a solution for this?

                      • 8. Re: wildfly 10 session replication issue
                        adveyes

                        The problem lies in "interface" attribute of the udp related socket bindings at both master and slave domain.xml. You have to change

                         

                        <socket-binding name="jgroups-udp" interface="private"... />

                        and

                        <socket-binding name="jgroups-udp-fd" interface="private"... />

                         

                        to

                         

                        <socket-binding name="jgroups-udp" interface="public"...

                        and

                        <socket-binding name="jgroups-udp-fd" interface="public"... />

                        • 9. Re: wildfly 10 session replication issue
                          pferraro

                          Ideally, you would modify the "private" interface to some non-loopback interface, rather than modify jgroups to use the "public" interface.  The rationale behind this interface segregation is that most deployments of WildFly would have one interface for servicing public requests (e.g. WAN, load balancer, etc) and another interface for LAN/intra-server/clustering traffic.