Elasticsearch常用查询语句
节点状态相关
检查节点是否运行
1
curl -XGET http://localhost:9200
检查节点健康状态
1
curl -XGET http://localhost:9200/_cluster/health\?pretty
检查群集节点状态
1
curl -XGET http://192.168.248.148:9200/_cat/nodes?v
分片状态相关
- 检查分片健康
1
curl http://localhost:9200/_cat/indices
- 检查所有分片
1
curl -XGET http://localhost:9200/_cat/shards
- 删除分片
1
curl -XDELETE http://127.0.0.1:9200/wazuh-alerts-3.x-2021.05.16
- 设置分片数
1
curl -XPUT "127.0.0.1:9200/_cluster/settings" -H 'Content-Type: application/json' -d '{"transient":{"cluster":{"max_shards_per_node":20000}}}'
存储相关
- 设置存储水位
1
2
3
4
5
6
7
8
9
10
11
12curl -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 on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.