我的安装工作正常,但由于2'额外的'其中显示未分配的分片。如何删除这些额外的碎片?我当前的设置是0个副本和2个分片。
curl -XGET 'http://localhost:9200/_cluster/health/tags?level=shards&pretty=true'
{
"cluster_name" : "elasticsearch_inspire",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 2,
"active_shards" : 2,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 2,
"indices" : {
"v1_tags" : {
"status" : "yellow",
"number_of_shards" : 2,
"number_of_replicas" : 1,
"active_primary_shards" : 2,
"active_shards" : 2,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 2,
"shards" : {
"0" : {
"status" : "yellow",
"primary_active" : true,
"active_shards" : 1,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 1
},
"1" : {
"status" : "yellow",
"primary_active" : true,
"active_shards" : 1,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 1
}
}
}
}
}
答案 0 :(得分:2)
我最近遇到过这个问题,ES进程在所有节点上重新启动,我有一些未分配的分片(群集运行状况为红色)。 我做了以下操作来手动分配分片并为我做了诀窍(不需要重新启动)
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands": [
{
"allocate": {
"index": "INDEXNAME",
"shard": "SHARDNUMBER",
"node": "PICKANODE",
"allow_primary": 1
}
}
]
}'
答案 1 :(得分:0)
重新启动节点似乎是解决它的唯一方法。
如果有人的攻击性较低,请发布:)