在Linux上,您可以使用以下命令来查看ES(Elasticsearch)文档占用的内存总和:

  1. 使用curl命令查询Elasticsearch的状态API:

    curl -XGET 'http://localhost:9200/_cat/indices?v'
    

    这将返回一个包含索引的列表,其中包括每个索引的文档数和占用的内存大小。

  2. 使用grep和awk命令来提取内存总和:

    curl -XGET 'http://localhost:9200/_cat/indices?v' | grep -vE '^health|^index' | awk '{ sum += $7 } END { print sum }'
    

    这将返回所有索引的内存总和。

请注意,您需要将localhost:9200更改为实际的Elasticsearch主机和端口。

linux上怎么用命令查看es文档占用的内存总和

原文地址: https://www.cveoy.top/t/topic/izNP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录