ELK常用命令


1、查询当前所有的索引

#curl 'localhost:9200/_cat/indices?v'

 

2、查看集群健康状态

#curl 'localhost:9200/_cat/health?v'

绿色表示一切正常, 黄色表示所有的数据可用但是部分副本还没有分配,红色表示部分数据因为某些原因不可用

3、产看node情况

#curl 'localhost:9200/_cat/nodes?v'

4、创建索引

#curl -XPUT 'localhost:9200/customer?pretty'

5、删除某个索引

#curl -XDELETE 'localhost:9200/customer?pretty'

删除多个索引

#curl -XDELETE 'localhost:9200/customer-*?pretty'

#curl -XDELETE 'localhost:9200/customer,customer2?pretty'

 

6、索引的增删改查有一个类似的格式,总结如下:

  curl -X<REST Verb> <Node>:<Port>/<Index>/<Type>/<ID>

  <REST Verb>:REST风格的语法谓词

  <Node>:节点ip

  <port>:节点端口号,默认9200

  <Index>:索引名

  <Type>:索引类型

  <ID>:操作对象的ID号


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM