【发布时间】:2020-09-27 07:45:28
【问题描述】:
我正在使用 Apache Ignite 2.8.0。 我开发了用于监控 Ignite 性能的小型仪表板。 现在我的问题是找到服务器的数量。 首先我找到了节点的总数(在节点变量中),然后
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
但这需要很多时间,我不希望这样。 有没有什么简单的方法可以通过使用 REST API http 请求来查找在 Apache Ignite 中运行的服务器数量?
【问题讨论】:
-
您尝试过#topology 方法吗? apacheignite.readme.io/docs/rest-api#topology
-
监控可以使用WebConsole免费使用gridgain.com/docs/web-console/latest/…
-
我也在使用它.. 但我需要历史记录。例如,我需要显示上周发生的记录。所以我开发了一个使用 MySQL 的工具。
-
是的,我尝试过 top 命令。但是我没有找到服务器的数量。
-
我有一个疑问 .. 对于客户端节点 tcpPort 始终为 '0' .. 对吗?