1 查看es狀態信息的常用命令
#查詢集羣狀態
GET _cluster/health
#查詢每個節點堆設置的大小
GET _cat/nodes?h=heap.max
#查詢某個索引的分片、段以及所內存
GET _cat/segments/logstash-info-2019.05.22?v&h=shard,segment,size,size.momery
#查詢node上所有segment佔用的memory的總和
GET /_cat/nodes?v&h=name,port,sm
減少數據節點上segment內存佔用的方式
- 刪除不用的索引
- 關閉索引(文件仍然存在於磁盤,只是釋放掉內存),需要時可以打開。
- 定期對不再更新的索引force merge。
ES的heap是如何被瓜分掉的?
- segment memory
- filter cache
- field data cache
- bulk queue
- indexing buffer
- state buffer
- 超大搜索聚合結果集的fetch
- 對高cardinality字段做terms aggregation