[英]Does Elasticsearch check for the number of nodes available in the cluster before creating the shards(in cases when default shard size is selected)
[英]Elasticsearch 7.5.2 cluster is creating only one shard for an index by default
早期的 Elasticsearch 将主分片的默认数量设置为 5,这是从您正在使用的 Elasticsearch 7.X 更改的,因此您只能看到 1 个主分片。
此更改的Elasticsearch 链接以及有关此SO 答案的更多信息。
除了API,它是适用于该@Kamal已经提到了特定的索引,您可以指定在此设置elasticsearch.yml
,这将是对创建直到你重写使用API调用各项指标有效。
配置添加到您的elasticsearch.yml
index.number_of_shards: {your desired number of shards}
注意:这是针对无法动态更改的主分片,因此请谨慎设置,与可以动态更改the number of replicas
不同。
那是正确的。 邮政版本7,如提及Elasticsearch默认创建与碎片大小为1指数在这里
在创建索引时,您始终可以使用以下设置指定索引分片。
PUT <your_index_name>
{
"settings" : {
"index" : {
"number_of_shards" : 5
}
}
}
希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.