增加elasticsearch kubernetes中的碎片数

shyt4zoc  于 2021-06-13  发布在  ElasticSearch
关注(0)|答案(2)|浏览(600)

部署了一个 ElasticsearchGKE . eck有3个主节点和2个数据节点。当创建一个索引时,一个碎片和一个副本得到400个错误响应,当碎片数达到1000。
可以增加碎片数吗?请建议增加碎片数的方法。
错误详细信息

Invalid NEST response built from a unsuccessful (400) low level call on PUT: /t-2af14520-e76d-4091-a51d-1c89cf990e97
Audit trail of this API call:
[1] BadResponse: Node: http://eck.com/ Took: 00:00:00.2833118
OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 400 from: PUT /t-2af14520-e76d-4091-a51d-1c89cf990e97. ServerError: Type: illegal_argument_exception Reason: "Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [2000]/[2000] maximum shards open;"
Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
Response:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
kulphzqa

kulphzqa1#

大英公园的答案是正确的。您可以增加cluster.max\u shards\u per\u nodes的限制。但您应该考虑到,他们对集群设置此限制是有原因的。您将遇到堆使用率、低搜索/索引性能和集群不稳定等问题。
所以我建议尽量减少簇中索引和碎片的数量。为此,可以使用收缩api或重新索引api。https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.htmlhttps://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

xoefb8l8

xoefb8l82#

您可以如下更改碎片编号。有关更多详细信息,请参阅群集更新设置api。我建议你在考试后使用它。

PUT /_cluster/settings
{
    "persistent" : {
        "cluster.max_shards_per_nodes" : 3000
    }
}

相关问题