elasticsearch排查命令
时间: 2023-07-08 21:48:20 浏览: 70
下面是一些常用的 Elasticsearch 排查命令:
1. 查看 Elasticsearch 集群健康状态:
```
curl -X GET "localhost:9200/_cat/health?v"
```
2. 查看 Elasticsearch 集群中的节点列表:
```
curl -X GET "localhost:9200/_cat/nodes?v"
```
3. 查看 Elasticsearch 中的索引列表:
```
curl -X GET "localhost:9200/_cat/indices?v"
```
4. 查看 Elasticsearch 中的文档数量:
```
curl -X GET "localhost:9200/_cat/count?v"
```
5. 查看 Elasticsearch 中的分片状态:
```
curl -X GET "localhost:9200/_cat/shards?v"
```
6. 查看 Elasticsearch 中的搜索结果:
```
curl -X GET "localhost:9200/<index-name>/_search?q=<search-query>"
```
7. 查看 Elasticsearch 中的映射信息:
```
curl -X GET "localhost:9200/<index-name>/_mapping"
```
8. 查看 Elasticsearch 中的聚合信息:
```
curl -X GET "localhost:9200/<index-name>/_search?size=0&pretty" -H 'Content-Type: application/json' -d'
{
"aggs": {
"agg_name": {
"terms": {
"field": "field_name"
}
}
}
}
'
```
以上是一些常用的 Elasticsearch 排查命令,可以根据具体情况选择使用。