首页 / ELEASTATICSEARCH / Elasticsearch7.11 "reason" : "INDEX_CREATED" a copy of this shard is already allocated to this node
Elasticsearch7.11 "reason" : "INDEX_CREATED" a copy of this shard is already allocated to this node
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Elasticsearch7.11 "reason" : "INDEX_CREATED" a copy of this shard is already allocated to this node,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2563字,纯文字阅读大概需要4分钟。
内容图文
- 在kiban终端中, 运行集群健康状态命令
GET /_cluster/health
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 11,
"active_shards" : 11,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 2,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 84.61538461538461
}
- 运行命令查看集群yellow的详细原因
附上官网命令链接:https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html
GET /_cluster/allocation/explain
{
"index" : "rread_me",
"shard" : 0,
"primary" : false,
"current_state" : "unassigned",
"unassigned_info" : {
"reason" : "INDEX_CREATED",
"at" : "2021-03-04T06:23:29.218Z",
"last_allocation_status" : "no_attempt"
},
"can_allocate" : "no",
"allocate_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",
"node_allocation_decisions" : [
{
"node_id" : "p8hSt2cqQfShoeuGQSFe9Q",
"node_name" : "node-1",
"transport_address" : "xxx.xx.xx.xx:9300",
"node_attributes" : {
"ml.machine_memory" : "1922101248",
"xpack.installed" : "true",
"transform.node" : "true",
"ml.max_open_jobs" : "20"
},
"node_decision" : "no",
"deciders" : [
{
"decider" : "same_shard",
"decision" : "NO",
"explanation" : "a copy of this shard is already allocated to this node [[rread_me][0], node[p8hSt2cqQfShoeuGQSFe9Q], [P], s[STARTED], a[id=ntehmVVoS7yeIiTyahaL6A]]"
}
]
}
]
}
- 根据集群异常的解释信息,定位原因
在返回结果中给出了导致分片未分配的详细信息,reason 给出了分片最初未分配的原因,可以理解成 unassigned 是什么操作触发的;
allocate_explanation 则进一步的说明,该分片无法被分配到任何节点,而无法分配的具体原因在 deciders 的 explanation 信息中详细描述。这些信息足够我们诊断问题。
本案例中
a copy of this shard is already allocated to this node
是集群yellow的详细原因, 这个由于这个复制分片已经分配到此节点, 那么解决方案就是把复制分片设置为0【number_of_replicas: 0】, 根据上面的解释是index:rread_me已有分片,
PUT /rread_me/_settings
{
"number_of_replicas": 0
}
- 继续查看集群健康状态
GET /_cluster/health
{
"cluster_name" : "elasticsearch",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 11,
"active_shards" : 11,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
Elasticsearch7.11 "reason" : "INDEX_CREATED" a copy of this shard is already allocated to this node
原文:https://www.cnblogs.com/simple-record/p/14480169.html
内容总结
以上是互联网集市为您收集整理的Elasticsearch7.11 "reason" : "INDEX_CREATED" a copy of this shard is already allocated to this node全部内容,希望文章能够帮你解决Elasticsearch7.11 "reason" : "INDEX_CREATED" a copy of this shard is already allocated to this node所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。