solrj - get metrics from all nodes

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

solrj - get metrics from all nodes

lstusr 5u93n4
Hi All,

I'm attempting to connect to the metrics api in solrj to query metrics from
my cluster. Using the CloudSolrClient, I get routed to one node, and get
metrics only from that node.

I'm building my request like this:

    GenericSolrRequest req = new GenericSolrRequest(METHOD.GET,
"/admin/metrics", new MapSolrParams(params));

     NamedList<Object> resp = getCloudSolrClient().request(req);

And this returns metrics only from the node that gets selected by the
LbHttpClient (I think).

Is there an easy way to query all of the nodes for their metrics in solrj?

Kyle
Reply | Threaded
Open this post in threaded view
|

Re: solrj - get metrics from all nodes

ChienHuaWang
I observed the exactly same thing - the metrics for only one node.
Looking for the solution to get the metrics of all the nodes.
Could anyone advice?

Thanks,
Chien



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: solrj - get metrics from all nodes

ChienHuaWang
For people who is also looking for the solution - you can append
"node=node_name" in metrics request to get specific data of node.
If anyone know how to get the data if all the nodes together, please kindly
share, thanks.


Regards,
Chien



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: solrj - get metrics from all nodes

Jan Høydahl / Cominvent
The admin UI does this my requesting &nodes=<node1>,<node2>,…
You will get a master response with each sub response as key:value pairs.
The list of node_names can be found in live_nodes in CLUSTERSTATUS api.

Jan

> 27. jun. 2020 kl. 02:09 skrev ChienHuaWang <[hidden email]>:
>
> For people who is also looking for the solution - you can append
> "node=node_name" in metrics request to get specific data of node.
> If anyone know how to get the data if all the nodes together, please kindly
> share, thanks.
>
>
> Regards,
> Chien
>
>
>
> --
> Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Reply | Threaded
Open this post in threaded view
|

Re: solrj - get metrics from all nodes

ChienHuaWang
Hi Jan,

Thanks for the response.
Could you please share more detail how you request the metric with multiple
nodes same time?
I do something as below, but only get one node info, the data I'm interested
most is, ex: CONTAINER.fs.totalSpace, CONTAINER.fs.usableSpace. etc..


solr/admin/metrics?group=node&node=node1_name,node2_name




--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: solrj - get metrics from all nodes

Jan Høydahl / Cominvent
Use nodes=, not node=

> 30. jun. 2020 kl. 02:02 skrev ChienHuaWang <[hidden email]>:
>
> Hi Jan,
>
> Thanks for the response.
> Could you please share more detail how you request the metric with multiple
> nodes same time?
> I do something as below, but only get one node info, the data I'm interested
> most is, ex: CONTAINER.fs.totalSpace, CONTAINER.fs.usableSpace. etc..
>
>
> solr/admin/metrics?group=node&node=node1_name,node2_name
>
>
>
>
> --
> Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Reply | Threaded
Open this post in threaded view
|

Re: solrj - get metrics from all nodes

ChienHuaWang
Thanks for Jan's response.

I tried to set this "nodes" parameter by ModifiableSolrParams. But the null
is return from GenericSolrRequest.
Could anyone advise the best approach to setup this parameter for multiple
nodes?


Thanks,
Chien



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html