9 Replies Latest reply on Jul 17, 2018 1:17 PM by johnnuy

    undertow load balancer monitoring

    johnnuy

      How would I go about remotely monitoring an undertow load balancer to determine which backend nodes are currently connected and available through the load balancer in EAP 7.1/Wildfly 11. 

       

      Previously with EAP 7.0/Wildfly 10 using an httpd modcluster load balancer I was able to query the modcluster instance using the "mod_cluster_manager" url to gain information about which nodes were currently connected and the state of them.

       

      I've setup our clustering as was described in this youtube video:

      WILDFLY-11/JBOSS EAP-7.1 - undertow load balancer implementation with new profile - YouTube

       

      thanks in advance,

      Jonny

        • 1. Re: undertow load balancer monitoring
          rhusar

          So you have moved from native implementation to pure-Java Undertow-based load balancer -- great.

           

          We have decided not to create a page but rather let users use the management API / CLI to obtain this information. IIRC you should be able to find the status by using the CLI at this address:

           

          [rhusar@ribera wildfly-14.0.0.Beta1-SNAPSHOT]$ ./bin/jboss-cli.sh -c

          [standalone@localhost:9990 /] /subsystem=undertow/configuration=filter/mod-cluster=load-balancer/balancer=

          Let me know if that works...

          1 of 1 people found this helpful
          • 2. Re: undertow load balancer monitoring
            johnnuy

            Thanks for the quick response!

             

            I was able to connect using the cli to get the information i was looking for using:

             

            --command="ls /subystem=undertown/configuration=filter/mode-cluster=load-balancer/balancer=mycluster/node=n1" 

            • 3. Re: undertow load balancer monitoring
              johnnuy

              Hit enter before I was done my comment, and not sure how to edit it...

               

              --command="ls /subsystem=undertow/configuration=filter/mod-cluster=load-balancer/balancer=mycluster/node"  returns the list of connected nodes

               

              n1

               

              n2

               

              etc

               

              --command="ls /subsystem=undertow/configuration=filter/mod-cluster=load-balancer/balancer=mycluster/node=n1" returns the information about the specific node

              • 4. Re: undertow load balancer monitoring
                rhusar

                Hit enter before I was done my comment, and not sure how to edit it...

                There should be at every post, on bottom left, "Actions" which drops down a list and click "Edit".

                • 5. Re: undertow load balancer monitoring
                  rhusar

                  There are also operations that you can call from the "worker", i.e. from WildFly, such as

                   

                  [standalone@localhost:9990 /] /subsystem=modcluster:read-proxies-configuration

                   

                  To find out all operation names you could run

                   

                  [standalone@localhost:9990 /] /subsystem=modcluster:read-operation-names

                  • 6. Re: undertow load balancer monitoring
                    johnnuy

                    Unfortunately the Actions drop down tells me "no actions available"

                    • 7. Re: undertow load balancer monitoring
                      johnnuy

                      I'm looking at implementing a custom http handler that will intercept the requests on the load balancer and convert the CLI commands to a Rest API, and serve a JSON response.  Is there any easy way to programatically call the Management API and CLI commands from within an http handler? 

                      • 8. Re: undertow load balancer monitoring
                        rhusar

                        Sure, just use the model controller client, which should be obtainable for in-VM use via org.jboss.as.controller.ModelControllerClientFactory#createClient

                        • 9. Re: undertow load balancer monitoring
                          johnnuy

                          Thanks again, I was able to get this working fairly quickly, but it required external credentials to create the ModelControllerClient using the ModelControllerClientConfiguration.Builder().

                           

                          I noticed there is a LocalModelControllerClient interface, but I can't find any documentation or examples on what it is or how to use it.  Is there a way to create a ModelControllerClient that will use the current web credentials or ejb credentials for the authenticated user instead of specifying them explicitly?