0

I need to get ignite cluster size(no of server nodes running) preferably using control script or ignite rest api. I am able to get baseline nodes using command below but I don't see any command or rest api to return topology snapshot. Is there a way we could get this information to ignite client rather than looking into logs.

Workaround to get baseline nodes:

baselineNodes=$(kubectl --kubeconfig  config.conf exec <ignite-node> -n {client_name} -- /opt/ignite/apache-ignite/bin/./control.sh --baseline | grep "Number of baseline nodes" | cut -d ':' -f2 | sed 's/^ *//g')
curious_soul
  • 559
  • 1
  • 8
  • 29

2 Answers2

1

It seems that topology REST command could do the trick. Here's the documentation link.

http://host:port/ignite?cmd=top&attr=true&mtr=true&id=c981d2a1-878b-4c67-96f6-70f93a4cd241

Vladimir Pligin
  • 1,547
  • 11
  • 18
  • Thanks for quick response. I hope you mean below command, I will try this. http://host:port/ignite?cmd=log&from={from}&to={to}&path={pathToLogFile} – curious_soul Jan 31 '23 at 18:59
  • no, this one `http://host:port/ignite?cmd=top&attr=true&mtr=true&id=c981d2a1-878b-4c67-96f6-70f93a4cd241` – Vladimir Pligin Jan 31 '23 at 19:07
  • something is wrong with the anchors on the page – Vladimir Pligin Jan 31 '23 at 19:09
  • Umm, I have 2 queries. 1. client need to know the node id to use 2. response doesn't contain the cluster topology but node level metrics and caches. I was looking for something like below servers=3, clients=2, state=ACTIVE, CPUs=40, offheap=15.0GB, heap=12.0GB – curious_soul Feb 01 '23 at 05:54
0

Got help from ignite community and below command worked for me. Basically idea is to use metric to extract server nodes.

kubectl --kubeconfig  config.conf exec <ignite-node> -n {client_name} -- /opt/ignite/apache-ignite/bin/./control.sh --metric  cluster.TotalServerNodes | grep -v  "metric" | grep cluster.TotalServerNodes | cut -d " " -f5 | sed 's/^ *//g'

Quoting the reply received:

"You can query any metric value or system view content via control script [1], [2]

control.sh --system-view nodes

or [3]

control.sh —metric cluster.TotalBaselineNodes control.sh —metric cluster.TotalServerNodes control.sh —metric cluster.TotalClientNodes

[1] https://ignite.apache.org/docs/latest/tools/control-script#metric-command [2] https://ignite.apache.org/docs/latest/tools/control-script#system-view-command [3] https://ignite.apache.org/docs/2.11.1/monitoring-metrics/new-metrics#cluster"

curious_soul
  • 559
  • 1
  • 8
  • 29