对于没有模板创建的所有新索引,我需要将index.number_of_replicas设置为0。
这不能再通过elasticsearch.yml来完成。建议的方法是使用模板,但是我正在寻找一种不使用模板的方法。
感谢您的帮助:)
发布于 2019-09-16 21:38:21
我知道的唯一方法是使用索引模板。
请注意,可以有任意多个index templates,而不是每个索引只有一个。您可以使用order
设置来控制它们的顺序(即它们如何相互覆盖):
# This template is low priority and applies to all indexes:
PUT _template/template_1
{
"index_patterns": ["*"], <-- applies to all indexes
"order": 0, <-- lowest priority
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
# This template has a higher priority and only applies to indexes foo*:
PUT _template/template_1
{
"index_patterns": ["foo*"], <-- only applies to foo*
"order": 3, <-- higher priority
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1 <-- overrides the number of replicas from base template
}
}
https://stackoverflow.com/questions/57957296
复制相似问题