如何从索引中删除动态设置?不是改变它的价值,而是完全删除它。
我必须将2.xElasticearch集群迁移到最新的5.x版本。运行elasticsearch-迁移插件后,我看到一个红色警告(意思是“如果不解决这个问题,您就无法升级”)。在“索引设置”中:“已替换的设置”-> index.cache.query.enable已被index.requests.cache.enable替换。但是,changes.html没有告诉如何删除设置,https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices.html也不知道(除非我遗漏了一些东西)。
我可以使用REST:curl -XPUT http://server:9200/index1/_settings -d"{ "index": { "requests": { "cache": { "enable": "true" } } } }"添加新设置。但是这并不会删除旧的设置,elasticsearch-迁移警告也不会消失。
再次使用API,我可以将index.cache.query.enable值从true更改为false,但这并不是要删除它。我尝试将其设置为null,但这没有任何效果。因此,我被困在一个设置,我无法摆脱,并阻止迁移(根据elastic-migration插件)。
发布于 2017-09-04 12:03:32
在ElasticSearch2.x中似乎没有删除索引设置的解决方案
尽管如此,关于index.cache.query.enable的错误并不是阻塞。我将集群从2.x更新到5.x,没有修正这个警告。更新后的集群运行良好,问题设置已自动移动到archived命名空间。
发布于 2017-09-02 19:20:43
在快照还原API中有一个ignore_index_settings;您不必更改旧集群中的设置。
同样在Elasticsearch 5.0+中,您可以使用null,但是这对您的用例不起作用。只为下一次迁移;)
PS:delete a file on the filesystem to remove any setting in the cluster state似乎是可能的,但我还没有测试过它,我肯定不会推荐它。
https://stackoverflow.com/questions/45986005
复制相似问题