-
1. Re: undertow load balancer monitoring
rhusar May 31, 2018 3:45 PM (in response to johnnuy)1 of 1 people found this helpfulSo 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...
-
2. Re: undertow load balancer monitoring
johnnuy Jun 1, 2018 8:39 AM (in response to rhusar)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 Jun 1, 2018 8:43 AM (in response to 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 Jun 4, 2018 4:15 PM (in response to johnnuy)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 Jun 4, 2018 4:18 PM (in response to johnnuy)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 Jun 5, 2018 1:22 PM (in response to rhusar)Unfortunately the Actions drop down tells me "no actions available"
-
7. Re: undertow load balancer monitoring
johnnuy Jun 5, 2018 1:25 PM (in response to rhusar)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 Jun 19, 2018 1:12 PM (in response to johnnuy)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 Jul 17, 2018 1:17 PM (in response to rhusar)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?