【发布时间】:2017-05-03 02:11:45
【问题描述】:
创建索引后是否可以减少 ElasticSearch 搜索引擎中的分片数量?
我试过了:
$ curl -XPUT 'localhost:9200/myindex/_settings' -d '{"index" : {"number_of_shards" : 3}}'
但它给出了一个错误:
{"error":"ElasticsearchIllegalArgumentException[can't change the number of shards for an index]","status":400}
【问题讨论】:
-
你用的是什么版本的es?
-
@eliasah 在我的开发服务器上:版本:1.4.4,构建:c88f77f/2015-02-19T13:05:36Z,JVM:1.7.0_75
-
您唯一的选择是使用更少的分片创建新索引,并使用 stream2es 等工具将旧索引中的所有数据重新索引到新索引
标签: elasticsearch