elasticsearch - 是否可以在ES v2.x中将index.number_of_replicas设置为静态索引设置?

标签 elasticsearch elasticsearch-2.0

在elasticsearch v1.x中,我可以静态设置index.number_of_replicas(在elasticsearch.yml文件中):

# Set the number of replicas (additional copies) of an index (1 by default):
index.number_of_replicas: 0

但是,我现在将v2.3的配置文件放在一起,此设置不再起作用。

例如,如果我将以上代码添加到elasticsearch.yml文件中并启动ES v2.3,则仍然使用number_of_replicas: 1自动创建Marvel索引。静态设置in the docs也未列出。

自v1.x以来,它是否已更改,或者我做错了什么?现在只能通过动态设置来完成吗?

最佳答案

该静态设置在2.3中仍然有效。您可以尝试通过简单地创建新索引而不指定任何设置来尝试:

PUT /test/test/1

在日志中,您会看到类似以下内容的内容:
[2016-05-30 05:49:45,836][INFO ][cluster.metadata         ] [dev-node-1] [test] creating index, cause [auto(index api)], templates [], shards [2]/[0], mappings [test]
[2]/[0]表示默认情况下,我设置了两个要创建的主碎片和0个副本碎片。

如果您在Marvel索引中看到副本碎片,那是因为必须有一个 .marvel-es template来指定不同的索引设置。

关于elasticsearch - 是否可以在ES v2.x中将index.number_of_replicas设置为静态索引设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37516772/

相关文章:

python - CentOS 6.4 + Haystack (2.1.0) + ElasticSearch (1.2.1) = SearchParseException ...解析失败

elasticsearch - 在Elasticsearch中使用术语查询

elasticsearch - 如何记录所有对 ElasticSearch 的请求?

java - Elasticsearch自定义插件: Add extra query parameter before search

elasticsearch - 如何在Elasticsearch中将类型映射修改为另一种类型

elasticsearch - ELK堆栈和缩放

c# - 如何使用Nest将具有数组值的settings属性添加到ES-index

elasticsearch - Elasticsearch未分析字段

elasticsearch - ElasticSearch查询嵌套对象无法按预期工作

elasticsearch - 设置可以从不同数据类型返回建议的 Elasticsearch suggesters