当前位置: 首页 > 知识库问答 >
问题:

Elasticsearch每隔几小时警告一次未分配的碎片

年文柏
2023-03-14

我们的集群有3个elasticsearch data pods/3个主pods/1个客户端和1个导出器。问题是警报“ElasticSearch因断路异常而未分配碎片”。你可以在这个问题中进一步检查这个问题

eleasticsearch-data-0、1和2的堆利用率分别为68%、61%和63%。

我做了下面的API调用,可以看到碎片几乎是均匀分布的。

curl-s http://localhost:9200/_cat/shards grep elasticsearch-data-0 wc-l

145
145
142
{
    "allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes",
    "can_allocate": "no",
    "current_state": "unassigned",
    "index": "graph_24_18549",
    "node_allocation_decisions": [
        {
            "deciders": [
                {
                    "decider": "max_retry",
                    "decision": "NO",
                    "explanation": "shard has exceeded the maximum number of retries [50] on failed allocation attempts - manually call [/_cluster/reroute?retry_failed=true] to retry, [unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:18:44.115Z], failed_attempts[50], delayed=false, details[failed shard on node [nodeid1]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[nodeid1], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:16:42.146Z], failed_attempts[49], delayed=false, details[failed shard on node [nodeid2]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[nodeid2], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid2], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:15:05.849Z], failed_attempts[48], delayed=false, details[failed shard on node [nodeid1]: failed to perform indices:data/write/bulk[s] on replica [tsg_ngf_graph_1_mtermmetrics1_vertex_24_18549][0], node[nodeid1], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid3], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:11:50.143Z], failed_attempts[47], delayed=false, details[failed shard on node [nodeid2]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[o_9jyrmOSca9T12J4bY0Nw], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid4], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:08:10.182Z], failed_attempts[46], delayed=false, details[failed shard on node [nodeid1]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[nodeid1], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid6], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:07:03.102Z], failed_attempts[45], delayed=false, details[failed shard on node [nodeid2]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[nodeid2], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid7], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:05:53.267Z], failed_attempts[44], delayed=false, details[failed shard on node [nodeid2]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[nodeid2], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid8], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:04:24.507Z], failed_attempts[43], delayed=false, details[failed shard on node [nodeid1]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[nodeid1], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid9], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:03:02.018Z], failed_attempts[42], delayed=false, details[failed shard on node [nodeid2]: failed to perform indices:data/write/bulk[s] on replica [graph_24_18549][0], node[nodeid2], [R], recovery_source[peer recovery], s[INITIALIZING], a[id=someid10], unassigned_info[[reason=ALLOCATION_FAILED], at[2020-10-31T09:01:38.094Z], failed_attempts[41], delayed=false, details[failed shard on node [nodeid1]: failed recovery, failure RecoveryFailedException[[graph_24_18549][0]: Recovery failed from {elasticsearch-data-2}{}{} into {elasticsearch-data-1}{}{}{IP}{IP:9300}]; nested: RemoteTransportException[[elasticsearch-data-2][IP:9300][internal:index/shard/recovery/start_recovery]]; nested: CircuitBreakingException[[parent] Data too large, data for [<transport_request>] would be [2012997826/1.8gb], which is larger than the limit of [1972122419/1.8gb], real usage: [2012934784/1.8gb], new bytes reserved: [63042/61.5kb]]; ], allocation_status[no_attempt]], expected_shard_size[4338334540], failure RemoteTransportException[[elasticsearch-data-0][IP:9300][indices:data/write/bulk[s][r]]]; nested: AlreadyClosedException[engine is closed]; ], allocation_status[no_attempt]], expected_shard_size[5040039519], failure RemoteTransportException[[elasticsearch-data-1][IP:9300][indices:data/write/bulk[s][r]]]; nested: CircuitBreakingException[[parent] Data too large, data for [<transport_request>] would be [2452709390/2.2gb], which is larger than the limit of [1972122419/1.8gb], real usage: [2060112120/1.9gb], new bytes reserved: [392597270/374.4mb]]; ], allocation_status[no_attempt]], expected_shard_size[2606804616], failure RemoteTransportException[[elasticsearch-data-0][IP:9300][indices:data/write/bulk[s][r]]]; nested: AlreadyClosedException[engine is closed]; ], allocation_status[no_attempt]], expected_shard_size[4799579998], failure RemoteTransportException[[elasticsearch-data-0][IP:9300][indices:data/write/bulk[s][r]]]; nested: AlreadyClosedException[engine is closed]; ], allocation_status[no_attempt]], expected_shard_size[4012459974], failure RemoteTransportException[[elasticsearch-data-1][IP:9300][indices:data/write/bulk[s][r]]]; nested: CircuitBreakingException[[parent] Data too large, data for [<transport_request>] would be [2045921066/1.9gb], which is larger than the limit of [1972122419/1.8gb], real usage: [1770141176/1.6gb], new bytes reserved: [275779890/263mb]]; ], allocation_status[no_attempt]], expected_shard_size[3764296412], failure RemoteTransportException[[elasticsearch-data-0][IP:9300][indices:data/write/bulk[s][r]]]; nested: AlreadyClosedException[engine is closed]; ], allocation_status[no_attempt]], expected_shard_size[2631720247], failure RemoteTransportException[[elasticsearch-data-1][IP:9300][indices:data/write/bulk[s][r]]]; nested: CircuitBreakingException[[parent] Data too large, data for [<transport_request>] would be [2064366222/1.9gb], which is larger than the limit of [1972122419/1.8gb], real usage: [1838754456/1.7gb], new bytes reserved: [225611766/215.1mb]]; ], allocation_status[no_attempt]], expected_shard_size[3255872204], failure RemoteTransportException[[elasticsearch-data-0][IP:9300][indices:data/write/bulk[s][r]]]; nested: CircuitBreakingException[[parent] Data too large, data for [<transport_request>] would be [2132674062/1.9gb], which is larger than the limit of [1972122419/1.8gb], real usage: [1902340880/1.7gb], new bytes reserved: [230333182/219.6mb]]; ], allocation_status[no_attempt]], expected_shard_size[2956220256], failure RemoteTransportException[[elasticsearch-data-1][IP:9300][indices:data/write/bulk[s][r]]]; nested: CircuitBreakingException[[parent] Data too large, data for [<transport_request>] would be [2092139364/1.9gb], which is larger than the limit of [1972122419/1.8gb], real usage: [1855009224/1.7gb], new bytes reserved: [237130140/226.1mb]]; ], allocation_status[no_attempt]]]"
                },
{
                    "decider": "same_shard",
                    "decision": "NO",
                    "explanation": "the shard cannot be allocated to the same node on which a copy of the shard already exists [[graph_24_18549][0], node[nodeid2], [P], s[STARTED], a[id=someid]]"
                }
            ],
            "node_decision": "no",
            "node_id": "nodeid2",
            "node_name": "elasticsearch-data-2",
            "transport_address": "IP:9300"
        }

现在需要做什么?因为我没看到堆在射击。我已经尝试过下面的API,它帮助并分配所有未分配的碎片,但问题每隔几个小时就会出现。

curl-xpost':9200/_cluster/reroute?retry_failed

共有1个答案

司寇星海
2023-03-14

您使用的是哪个ElasticSearch版本?7.9.17.10.1由于CircuitBreakingException和更好的索引压力,具有更好的重试失败复制

我建议您尝试升级集群。Version7.10.1似乎已经为我修复了这个问题。查看更多信息:不支持未分配的碎片/CircuitBreakingException/小于-1字节的值的帮助

 类似资料:
  • 我想创建一个闹钟,它会在预定义的时间每天响。我是否需要为每小时创建一个PendingIntent并将其添加到AlarmManager中,或者是否有更简单的方法来实现这一点?

  • 问题内容: 我有一个具有4个节点的ES集群: 我不得不重新启动search03,当它回来时,它又重新加入了群集,没有问题,但是留下了7个未分配的碎片。 现在,我的集群处于黄色状态。解决此问题的最佳方法是什么? 删除(取消)分片? 将分片移动到另一个节点? 将分片分配给节点? 将“ number_of_replicas”更新为2? 还有其他东西吗? 有趣的是,当添加新索引时,该节点开始在该节点上工作

  • centOS上的elasticsearch 1.7.x 我们的三节点集群变成了两节点集群。一切都很好。每个碎片我们都有3个复制品,所以我们都有了。 但现在集群运行状况是黄色的,我们有: 我们已经将ElasticSearch.yml中的副本计数设置更改为1(从2)并在两个节点上重新启动ES。这没有什么区别。 下一步是什么? 我看到了如何重新分配碎片,但没有看到如何消除未分配的碎片。

  • 我有一个包含4个节点的ES集群: 我不得不重新启动search03,当它回来时,它没有问题地重新加入了集群,但是留下了7个未分配的碎片。 现在我的集群处于黄色状态。解决这个问题最好的办法是什么? 删除(取消)碎片? 将碎片移动到另一个节点? 将碎片分配给节点? 将“number_of_replicas”更新为2? 完全是其他吗? 有趣的是,当添加了一个新的索引时,该节点开始处理它,并与集群的其余部

  • 问题内容: 我想尝试通过以下方式使用@Schedule批注: 根据日志,CronService运行良好,但是计划的任务“ runsEveryMinute”不起作用。 使用EJB计划任务如何工作? 问题答案: 按照该Javadoc中的注释,默认值是: 除小时,分钟和秒外的所有字段;和 默认情况下为小时,分钟和秒。 通过将小时值保留为默认值,它要求计时器在午夜之后每分钟运行一小时(即00:00、00:

  • 问题内容: 我在Django中的应用程序 可以 创建一些 非常大的SQL查询。我目前使用一个对象,作为我需要的数据,然后使用一个,以返回要显示给用户的内容。 显然,我可以让用户等待一分钟,同时正在执行这些许多查询集并从数据库中提取查询,然后返回此单一HTML页面。 理想情况下,我想在需要时更新页面,例如: 这可能吗? 问题答案: 我最近发现HttpResponse可以是生成器: 这将逐步将结果返回