如何熟悉Kibana下的Elasticsearch常用命令?
- By : Will
- Category : Elastic Stack
Elastic Stack
1 前言
一个问题,一篇文章,一出故事。
笔者偶有Elasticsearch API,由于命令不常用容易遗忘,故而整理此文,以便查询。
2 最佳实践
查询集群健康状态,
GET /_cluster/health GET /_cluster/health?level=indices GET /_cluster/health?wait_for_status=yellow&timeout=50s
查询集群节点状态,
GET _cat/nodes?v
强制所有挂起的索引存盘,
POST _flush/synced
禁用节点分片,
PUT /_cluster/settings { "transient" : { "cluster.routing.allocation.enable" : "none" } }
启用节点分片,
PUT /_cluster/settings { "transient" : { "cluster.routing.allocation.enable" : "null" } }
重新分配未成功或失败的分片,
POST /_cluster/reroute?retry_failed=true
获取集群索引信息,
GET _cat/indices?v
解除某些故障原因导致的索引只读保护,
PUT _settings { "index": { "blocks": { "read_only_allow_delete": "false" } } }
没有评论