es常用接口請求方式
集群狀態查詢
可以看到整個集群的索引數、分片數、文檔數、內存使用等等信息。
http://localhost:9200/_cluster/stats
http://localhost:9200/_cat/nodes
http://localhost:9200/_cat/indices
http://localhost:9200/_cluster/state
http://localhost:9200/_cat/aliases
GET _nodes/_all/stats/fs?pretty=true
健康狀況
http://localhost:9200/_cat/health?v
空間使用
查詢每個節點的空間使用情況,預估數據大小
http://localhost:9200/_cat/allocation?v
分片分布
http://localhost:9200/_cat/shards
索引狀態
可以看到索引的數據條數、磁盤大小、分片個數【可以使用別名】。
http://localhost:9200/索引名/_stats
集群配置信息
http://localhost:9200/_cluster/settings?pretty
開發工具執行(kibana開發工具)
POST /你的索引/_delete_by_query
{
"query": {
"range": {
"@timestamp": {
"lt": "now-15d",
"format": "epoch_millis"
}
}
}
}
清空指定索引里面的所有數據
POST /your_index_name/_delete_by_query
{
"query": {
"match_all": {}
}
}
浙公網安備 33010602011771號