elasticsearch 常用命令

本文汇总了Elasticsearch中常用的命令操作,包括索引管理、健康状态查询、分片管理等,适用于日常运维及故障排查场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

// 查询所有索引
curl 'localhost:9200/_cat/indices?v'
//查询群集健康状态
curl localhost:9200/_cat/health
// 查看所有索引占用情况
curl -XGET 'localhost:9200/_cat/segments?v&h=si,sm'
// 查看 索引 fenci 的占用内存情况 sm
curl -XGET 'localhost:9200/_cat/segments/fenci?v&h=si,sm'
//删除索引(根据正则表达式)
curl -XDELETE 'http://localhost:9200/logstash-index-log*'
//删除所有索引
curl -XDELETE http://localhost:9200/_all
//es查看索引的mapping情况
curl -XGET "http://localhost:9200/logstash-index-log-20171127/_mapping?pretty"
// 关闭索引
curl -XPOST http://localhost:9200/logstash-index-log-20171127/_close/
//打开索引
curl -XPOST http://localhost:9200/logstash-index-log-20171127/_open/

//查询分片信息
curl -XGET 'localhost:9200/_cat/shards'
//手动删除副本分片
curl -XPUT "http://localhost:9200/_settings" -d' {  "number_of_replicas" : 0 } '
//查询得到master节点的唯一标识 
curl -XGET 'localhost:9200/_nodes/process?pretty'
//查看segment的情况
curl -XGET 'localhost:9200/_cat/segments'
//查看备份的snapshot
curl -XGET  'localhost:9200/_snapshot/my_backup/snapshotname-2018-08-02_14-19-33/_status'

官方API:https://www.elastic.co/guide/en/elasticsearch/reference

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值