我创建了一个包含3个primarys分片的索引,但ElasticSearch返回并指示有4个主分片。
# Deleting the data in the cluster
DELETE /_all
# Create an index with 3 primary shards with 1 replica each
PUT /blogs
{
"settings" : {
"number_of_shards" : 3,
"number_of_replicas" : 1
}
}
# Retrieve the cluster health
GET /_cluster/health
以下是回复:
{
"cluster_name": "clus",
"status": "yellow",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"active_primary_shards": 4,
"active_shards": 4,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 4
}
我认为只有副本分片的数量可以改变,并且主分片的数量在创建索引时是固定的,哪里来自第四个主分片?
答案 0 :(得分:0)
由于您的示例以奇迹语法显示,我假设您使用的是奇迹。它将为它自己的数据创建一个索引(这是你看到的第四个碎片)。请尝试GET /_cat/shards
查看此内容。