删除已归档的Elasticsearch索引设置

问题描述 投票:0回答:1

在Elasticsearch 5.x集群中,多个索引中已弃用的设置已移至已归档的命名空间。如何删除无用的设置?

跟进Removing an Elasticsearch index setting,在将2.x Elasticsearch集群迁移到5.x后,2.x索引级别设置index.cache.query.enable已移至archived.index.cache.query.enable。我尝试使用indices update API通过将其设置为null来删除此设置:

curl -XPUT http://server:9200/index1/_settings -d'{ "archive": { "index": { "cache": { "query": { "enable": null } } } } }'

不幸的是,这只会导致错误:

{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[SERVER][ip_address:9300][indices:admin/settings/update]"}],"type":"illegal_argument_exception","reason":"unknown setting [index.archive.index.cache.query.enable] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},"status":400}

请注意index中出现的额外index.archive.index.cache.query.enable。它在未提供时自动添加,这是问题的一部分:在设置中,archived命名空间与index命名空间处于同一级别,它不嵌套在它下面。

{
  "index1": {
    "settings": {
      "archived": {
        "index": {
          "cache": {
            "query": {
              "enable": "false"
            }
          }
        }
      },
      "index": {
        "creation_date": "1501560004104",
        "requests": {
          "cache": {
            "enable": "true"
          }
        },
        "number_of_shards": "5",
        "number_of_replicas": "1",
        "uuid": "OQ5GKLvKRZ-XUpd_dYCFdA",
        "version": {
          "created": "2040399",
          "upgraded": "5050299"
        }
      }
    }
  }
}
elasticsearch
1个回答
0
投票

不确定这是否已解决,但这是解决方案,_reindex在5.6中删除存档的设置。

参考:https://github.com/elastic/elasticsearch/issues/27533#issuecomment-347188242

© www.soinside.com 2019 - 2024. All rights reserved.