5 Replies Latest reply on Feb 24, 2015 11:39 PM by abhinav.gupta01

    How to configure undertow as a loadBalancer ?

    abhinav.gupta01

      Hi All,

       

      Our application requires that in a cluster setup , master should redirect request to slaves. Most of what I read is that , we can have apache httpd sitting on top of configuration which redirect requests.

      I am wondering if any such possibility is present in WildFly , using which master can redirect request to slaves. (may be round-robin or some other algorithm).

      If yes , please suggest me how to configure such a master-slave configuration ..

       

      Currently we are using wildfly 8.1 Final. If needed we can very well migrate to 8.2 Final .

      Thanks in Advance.

       

      Regards,

      Abhinav

        • 1. Re: How to configure undertow as a loadBalancer ?
          jokser

          Hi Abhinav,

           

          I can't understand why you don't want use Apache as frontend balancer. It's good common practice. There is mod_cluster module for Apache which created for easy configuring load-balance between Jboss AS/Wildfly instances. In Wildfly mod cluster subsystem you can implement any load-balancing strategy. You can find detailed information and good examples in Wildfly guides. It's not as difficult as it seems.

          In my understanding of master-slave architecture it's something like when you have 2 nodes master and slave. Master node consumes incoming requests while slave node "sleeps". When master node breaks slave node "wake ups" and starts to consume requests in place of master node. This behavior can be implemented using e.g. Linux Virtual Server.

           

          And I strongly recommend you update Wildfly to 8.2 version or update Undertow to the latest release. Undertow version from WF 8.0 and 8.1 contains critical bug with AJP connector which used in communication between Apache and WF instances by default.

          1 of 1 people found this helpful
          • 2. Re: How to configure undertow as a loadBalancer ?
            abhinav.gupta01

            Thanks. I will read more on mode_cluster and plan to upgrade to 8.2

             

            Actually before WildFly we use WebLogic Server. In that our master node , redirect EJB calls to slave nodes. I was trying to keep it same in WildFly as well.

            Also I read that WildFly 8.2 has Undertow reverse proxy configuration. Can I use to achieve same ? I am not sure how to configure that , didnt find any relevant examples as such.

            If you are aware of this reverse proxy , please suggest.

            • 3. Re: How to configure undertow as a loadBalancer ?
              jokser

              About clustered EJBs in Wildfly. You also don't need any reverse proxy and directly use Undertow. EJBs from different nodes automatically consolidate into one cluster when they are in the same server group. To lookup and invoke this EJBs from standalone client you need use jboss remote ejb client. One of the features of this client is you can know just one address of any node in your cluster. During communication process client retrieves cluster topology from this node so you can not worry about failover and you can implement any load-balancing strategy. All options are simply configured by .properties file. Moreover in Wildfly HTTP is used for remote ejb invocations, so you can just use your balancer address as remote EJB connection endpoint.

              Here it's useful articles about this process:

              http://blog.akquinet.de/2014/09/26/jboss-eap-wildfly-three-ways-to-invoke-remote-ejbs/

              http://blog.akquinet.de/2012/11/09/load-balancing-and-failover-of-remote-ejb-clients-in-eap6-and-jboss-as7/

               

              Also read Wildfly HA Guide section "Failover for clustered EJBs"

               

              Hope it will be helpful for you.

              1 of 1 people found this helpful
              • 4. Re: How to configure undertow as a loadBalancer ?
                skull

                The master does not redirect, you will need a apache with mod_cluster to do your job.

                I implemented this in our company and its works fine.

                I dont have any tutorial in my hands, but if you want i can help.

                • 5. Re: How to configure undertow as a loadBalancer ?
                  abhinav.gupta01

                  Thanks All.

                  I will work on to have a apache at front end. Will be back to you guys if stuck somewhere.