I’m not aware of any single command to do it, but there are a few options. I’ll 
list a few as they’re all imperfect.

There are some command-line JMX reader commands you could use to extract the 
information from Ignite’s metrics.

You could extract the information from the REST API. I needed to use the jq 
command to parse it into just a count:

http 'http://localhost:8080/ignite?cmd=top' | jq '[ .response[] ] | length' 

You could search the logs for “Topology snapshot” lines.

There’s also ignitevisorcmd that you can script.

Regards,
Stephen

> On 1 Feb 2023, at 09:32, Surinder Mehra <redni...@gmail.com> wrote:
> 
> Thanks, I am aware of it. But I needed this in a script. So either curl or 
> control options would be good.
> 
> On Wed, 1 Feb 2023, 14:51 Aleksandr Pakhomov, <apk...@gmail.com 
> <mailto:apk...@gmail.com>> wrote:
>> Hi, 
>> 
>> Do you have a chance to use a java client? 
>> 
>> https://ignite.apache.org/docs/latest/thin-clients/java-thin-client
>> 
>> It seems this could help 
>> igniteClient.cluster().forServers().nodes().count(); 
>> 
>> Best regards, 
>> Aleksandr
>> 
>>> On 1 Feb 2023, at 10:21, Surinder Mehra <redni...@gmail.com 
>>> <mailto:redni...@gmail.com>> wrote:
>>> 
>>> Hi,
>>> I am trying to find a way to fetch the count of server nodes in ignite 
>>> cluster but don't see any control script option or in Rest api. Could you 
>>> please suggest if it is possible. Below link shows this is exposed as a 
>>> cluster metric but not accessible through above two options.
>>> 
>>> https://ignite.apache.org/docs/latest/monitoring-metrics/new-metrics#cluster
>>>  
>>> Related stackoverflow post:  
>>> https://stackoverflow.com/questions/75301565/ignite-cluster-size-using-control-script/
>>> 
>>> Regards,
>>> Surinder
>> 

Reply via email to