我在一台计算机上只有一个节点,索引有 5 个没有副本的分片。以下是一些描述我的 elasticsearch 节点的参数(以下列表中忽略了健康索引):
GET /_cat/indices?v
health status index pri rep docs.count docs.deleted store.size pri.store.size
red open datas 5 0 344999414 0 43.9gb 43.9gb
GET _cat/shards
datas 4 p STARTED 114991132 14.6gb 127.0.0.1 Eric the Red
datas 3 p STARTED 114995287 14.6gb 127.0.0.1 Eric the Red
datas 2 p STARTED 115012995 14.6gb 127.0.0.1 Eric the Red
datas 1 p UNASSIGNED
datas 0 p UNASSIGNED
shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
14 65.9gb 710gb 202.8gb 912.8gb 77 127.0.0.1 127.0.0.1 Eric the Red
3 UNASSIGNED
Run Code Online (Sandbox Code Playgroud)
尽管似乎不支持删除创建的分片,但如上面的评论所述,将具有未分配分片的索引的副本数量减少到零可能会完成这项工作,至少对于单节点集群是这样。
PUT /{my_index}/_settings
{
"index" : {
"number_of_replicas" : 0
}
}
Run Code Online (Sandbox Code Playgroud)
您可以尝试按照以下方式删除未分配的分片(但不确定它是否适用于数据索引,是否适用于 Marvel 索引)
1)安装elasticsearch插件-head。参考Elastic Search Head插件安装
2)打开你的elasticsearch插件 - brwoser中的head URL。从这里您可以轻松查看哪些是未分配的分片以及其他相关信息。这将显示有关该分片的信息。
{
"state": "UNASSIGNED",
"primary": true,
"node": null,
"relocating_node": null,
"shard": 0,
"index": ".marvel-es-2016.05.18",
"version": 0,
"unassigned_info": {
"reason": "DANGLING_INDEX_IMPORTED",
"at": "2016-05-25T05:59:50.678Z"
}
}
Run Code Online (Sandbox Code Playgroud)
从这里您可以复制索引名称,即.marvel-es-2016.05.18
。
3)现在您可以运行此查询sense
DELETE .marvel-es-2016.05.18
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助 !
归档时间: |
|
查看次数: |
17332 次 |
最近记录: |