0

我正在 ES 上通过使用以下命令限制分片数在 ES 中创建一些新索引

curl  -XPUT localhost:9200/es_test_index  '{ "settings : { "number_of_shards" ; 2 } }'

但是有一个小问题,索引正在创建但没有分片为 2,而不是默认分片计数为 5。谁能告诉我如何更改它。

正在开发 ES 5.1.1

谢谢

4

1 回答 1

0

你有一个错字需要使用:而不是;加上你错过了-dswitch ,试试这样:

curl  -XPUT localhost:9200/es_test_index -d '{ "settings : { "number_of_shards": 2 } }'
                                          ^                                  ^
                                          |                                  |
                                       add this                           fix this
于 2017-02-08T07:18:55.697 回答