0
votes

I am Using Apache Ignite 2.8.0. I have developed small dash board that is used to monitor the performance of Ignite. Now my problem is finding the number of servers. first i have find the total number of nodes(in node variable), then

    total_servers = 0
    port = 8080

    for j in range(0,node + 1):   
      if(persistence == True):
        url_cache = "http://localhost:" + str(port) + "/ignite?cmd=top&sessionToken=" +sessionToken

      else:
        url_cache = "http://localhost:" + str(port) + "/ignite?cmd=top"            
      try:
                    print(j)
                    try:
                        res = requests.get(url = url_cache)
                        print(res.status_code)
                        if(res.status_code == 200):
                             total_servers = total_servers + 1
                    except:
                        pass
      except:
             pass

      port = port + 1  

But it will take much time, i don't want that. is there any simple way to finding the number of servers running in Apache Ignite by using REST API http request?

2
Have you tried the #topology method? apacheignite.readme.io/docs/rest-api#topologyAlexandr Shapkin
As for monitoring, you can use the WebConsole which is free to use gridgain.com/docs/web-console/latest/…Alexandr Shapkin
i am using that also.. but i need history records. for example i need to show the records which has been happened previous week. so i have developed one tool using MySQL.Balaji G
yes i have tried top command. but there i didn't found the number of servers.Balaji G
i have one doubt .. for client node tcpPort is always '0' .. am i right?Balaji G

2 Answers

1
votes

From REST you can run SQL command SELECT * FROM SYS.NODES; to determine that:

~/Downloads/apache-ignite-2.8.1-bin% wget -q -O- http://localhost:8080/ignite\?cmd=qryfldexe\&pageSize\=10\&cacheName\=default\&qry=select\ \*\ from\ sys.nodes | jq .response.items
[
  [
    "3304155a-bc83-402f-a884-59d39f074d3a",
    "0:0:0:0:0:0:0:1%lo,127.0.0.1,172.17.0.1,192.168.1.7:47500",
    "2.8.1#20200521-sha1:86422096",
    false,
    false,
    1,
    "[0:0:0:0:0:0:0:1%lo, 127.0.0.1, 172.17.0.1, 192.168.1.7]",
    "[192.168.1.7, 172.17.0.1]",
    true
  ]
]

(assumes you have cache named default for API purposes)

0
votes

Finally i have found one Answer.. if it's wrong please suggest me,

http://localhost:8080/ignite?cmd=node&id=a427-a04631d64c98&attr=true

in response["attributes"]["org.apache.ignite.cache.client"] => false,