gpt4 book ai didi

elasticsearch - 减少 ElasticSearch 中的分片数量

转载 作者:行者123 更新时间:2023-11-29 02:46:08 25 4
gpt4 key购买 nike

创建索引后是否可以减少 ElasticSearch 搜索引擎中的分片数量?

我试过了:

$ curl -XPUT 'localhost:9200/myindex/_settings' -d '{"index" : {"number_of_shards" : 3}}'

但它给出了一个错误:

{"error":"ElasticsearchIllegalArgumentException[can't change the number of shards for an index]","status":400}

最佳答案

这不再是事实,在 5.x 中,您可以将索引的数量减少到一个整数。例如,您可以从 12 下降到 1、2、3 或 6(请参阅 docs)。但是您必须将其设置为只读模式,自然缩小过程需要大量 IO。

关于elasticsearch - 减少 ElasticSearch 中的分片数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29962491/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com