Elasticsearch:如何查询连接数?

Elasticsearch: How to query for number of connections?

如何询问我的 Elasticsearch 服务器现在有多少连接打开?

这个和插座的数量一样吗? (我也不知道如何得到这些数字)

而且这个和客户端的数量不一样吧,因为每个客户端可能会打开多个连接?

找不到关于此的任何信息,但我确实发现您可以在 Elasticsearch 客户端为每个客户端指定 maxSockets:https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html

请求层使用 RESTful API,因此在处理任何请求后连接不会保持打开状态。

因此,如果您试图衡量 Elasticsearch 服务的并发请求数(无论是查询、索引还是批量请求),您可能需要监控每个节点上的 thread_pool:

https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html

或者您正在寻找有关发现层的更多信息?

ES 没有连接数。
但是您可以获得一些关于 ES 健康的信息,更多信息 here:

curl 'localhost:9200/_cat/health?v'

并且您可以获得有关分片、段、索引、搜索计数等的扩展统计信息...更多信息 here :

curl -XGET 'http://localhost:9200/_stats'