在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/