2 Replies Latest reply on Apr 13, 2017 6:47 AM by Helper Helper

    JBoss EAP 7 undertow front end dynamic load balancing to backend - Issue

    Helper Helper Newbie

      I have been facing the following issue setting up undertow dynamic load balancing on my virtual box using centos 7.3 and using redhat eap 7.

       

      Host1=eap-lb.com(It uses host-slave.xml using domain.xml as startup)(host controller)

      Host2=eap-master.com(It uses host-master.xml using domain.xml as startup)(dc controller)

      Host3=eap-slave1.com(It uses host-slave.xml using domain.xml as startup)(host controller)

      Host4=eap-slave2.com(It uses host-slave.xml using domain.xml as startup)(host controller)

       

      Servers

       

      eap-lb.com/load_balancer_server

      eap-master.com/

      eap-slave1.com/server1_slave1

      eap-slave2.com/server1_slave2

       

      Group 1=clustered-group = It uses full-ha profile and full-ha-sockets

      Group 2=loadbalancer-group = It uses ha profile and ha-sockets.

       

      Sample application has been deployed to clustered-group, I can access the URL's from each individual host server.

       

      My problem, when I configured the front end load balancer the context which I have been trying is not able to access the application deployed on the back end server group.

       

      Sample URL : http://eap-lb.com:8100/cluster-demo/

      Error I get is : 404 - Not Found

       

      In the logs, Number of these appear in all of my server logs.

       

      (UndertowEventHandlerAdapter - 1) MODCLUSTER000042: Error null sending INFO command to

       

      Please could some one advise, what is wrong here.

       

      BTW, the following CLI commands have been executed on the DC controller host.

       

      1.  Add a mod_cluster filter to undertow

       

      /profile=ha/subsystem=undertow/configuration=filter/mod-cluster=modcluster:add(management-socket-binding=http,advertise-socket-binding=modcluster,security-key=secret)

       

      2.  Enable the desired undertow(virtual)hosts

       

      /profile=ha/subsystem=undertow/server=default-server/host=default-host/filter-ref=modcluster:add

       

      3.  Configure advertise key

       

      /profile=full-ha/subsystem=modcluster/mod-cluster-config=configuration:write-attribute(name=advertise-security-key,value=secret)

       

      4.  Configure the key on the load balancer server

       

      /profile=ha/subsystem=undertow/configuration=filter/mod-cluster=modcluster:write-attribute(name=security-key,value=secret)

       

      5.  Cluster members require a proxy to list to knwo which mod_cluster load balancer they send connection parms and application status to.

       

      /socket-binding-group=full-ha-sockets/remote-destination-outbound-socket-binding=lb:add(host=192.168.35.50, port=8080)

              

      /profile=full-ha/subsystem=modcluster/mod-cluster-config=configuration:write-attribute(name=proxies,value=[modcluster])

        • 1. Re: JBoss EAP 7 undertow front end dynamic load balancing to backend - Issue
          Anup Dey Apprentice

          Hi,

           

          The root cause is: the different environments are finding the other proxies through advertisement since they are all likely using the same multicast address by default.

           

          To avoid this you can use one of two approaches:

           

           

          1) Disable mod_cluster advertisement on JBoss EAP and Apache httpd side and just set the proxy-list to point to the desired Apache httpd server. For instance on the first set of jboss servers that you want to use Apache httpd 1:

           

          ~~~

            <mod-cluster-config advertise-socket="modcluster" advertise="false" proxy-list="apache1ip:port" connector="ajp">

          ~~~

           

          and on the second set that you want to use Apache httpd 2:

           

          ~~~

            <mod-cluster-config advertise-socket="modcluster" advertise="false" proxy-list="apache2ip:port" connector="ajp">

          ~~~

           

          now in Apache httpd 1 and Apache httpd 2 server md_cluster.conf add following to disable advertise mechanism :

           

          ~~~

          ServerAdvertise  Off

          ~~~

           

          2) If you want to use advertise, then give each apache/JBoss set a unique multicast address and port. On JBoss 1, configure a unique address/port:

           

          ~~~

            <socket-binding name="modcluster" port="0" multicast-address="x.x.x.x" multicast-port="12345"/>

          ~~~

           

          And configure that same address on apache 1's httpd/mod_cluster config:

           

          ~~~

            ServerAdvertise  On

            AdvertiseGroup x.x.x.x:12345

          ~~~

           

          And configure a different address/port on jboss2 and apache2:

           

          ~~~

            <socket-binding name="modcluster" port="0" multicast-address="x.x.x.x" multicast-port="12345"/>

          ~~~

           

          And configure that same address on apache 2's httpd/mod_cluster config:

           

          ~~~

             ServerAdvertise  On

             AdvertiseGroup x.x.x.x:12345

          ~~~

           

           

          Correct your Allow and Deny directives in your Apache's mod_cluster VirtualHost so that it allows JBoss ips, for example on httpd 2.2:

           

          ~~~

          <VirtualHost x.x.x.:1234>

              <Directory />

                  Order deny,allow

                  Allow from JBossIP

              </Directory>

              <Location /mod_cluster-manager>

                  SetHandler mod_cluster-manager

                  Order deny,allow

                  Allow from adminIP

              </Location>

                    KeepAliveTimeout 60

                    ServerAdvertise On

                    EnableMCPMReceive On

          </VirtualHost>

          ~~~

          • 2. Re: JBoss EAP 7 undertow front end dynamic load balancing to backend - Issue
            Helper Helper Newbie

            Thanks Anup.  As per the above configuration, I am not using any apache infront instead using undertow to do the load balancing.  Please could you review, Am I doing any thing wrong in my configuration especially the commands which I have been executing against the DC.