Elasticsearch常用查询语句
节点状态相关
检查节点是否运行
curl -XGET http://localhost:9200
检查节点健康状态
curl -XGET http://localhost:9200/_cluster/health\?pretty
检查群集节点状态
curl -XGET http://192.168.248.148:9200/_cat/nodes?v
分片状态相关
- 检查分片健康
curl http://localhost:9200/_cat/indices
- 检查所有分片
curl -XGET http://localhost:9200/_cat/shards
- 删除分片
curl -XDELETE http://127.0.0.1:9200/wazuh-alerts-3.x-2021.05.16
- 设置分片数
curl -XPUT "127.0.0.1:9200/_cluster/settings" -H 'Content-Type: application/json' -d '{"transient":{"cluster":{"max_shards_per_node":20000}}}'
存储相关
- 设置存储水位
curl -X PUT "http://127.0.0.1:9200/_cluster/settings" -H 'Content-Type: application/json' -d' { "persistent": { "cluster.routing.allocation.disk.watermark.low":"90%" } } '
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.