如何设置 分片数量和 备份数量
PUT /my_index HTTP/1.1
Host: localhost:9200
Content-Type: application/json
Content-Length: 88
{
"settings": {
"number_of_shards": 100,
"number_of_replicas": 1
}
}
number_of_shards 在索引创建后 ,就无法修改了。 切记。
number_of_replicas 可以单独修改,修改 接口如下
PUT /my_index/_settings HTTP/1.1
Host: localhost:9200
Content-Type: application/json
Content-Length: 64
{
"index" : {
"number_of_replicas" : 2
}
}