我创建了一个包含3个主碎片的索引,但是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
}我认为只有副本碎片的数量可以改变,主碎片的数量在创建索引时是固定的,第四个主碎片从何而来?
发布于 2014-08-28 16:28:45
由于您的示例以奇妙的语法显示事物,所以我假设您使用的是惊奇。它将为自己的数据创建一个索引(这是您正在看到的第四个碎片)。试试GET /_cat/shards看看这个。
https://stackoverflow.com/questions/25552774
复制相似问题