![](/img/trans.png)
[英]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.