将elasticsearch日志迁移到其他群集

fkvaft9z  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(1)|浏览(363)

我在kubernetes(aks)上部署了elasticsearch。我在使用官方的elastic的docker图像进行部署。日志存储在持久的azure磁盘中。如何将这些日志迁移到具有类似设置的另一个集群?只有那些符合基于日志日期时间的筛选条件的日志才需要迁移。

balp4ylt

balp4ylt1#

请使用reindex api来实现同样的功能

POST _reindex
{
  "source": {
    "remote": {
      "host": "http://oldhost:9200",
      "username": "user",
      "password": "pass"
    },
    "index": "source",
    "query": {
      "match": {
        "test": "data"
      }
    }
  },
  "dest": {
    "index": "dest"
  }
}

注:
在目标示例上运行上述命令。
确保源示例在elasticsearch.yml中被列为白名单

reindex.remote.whitelist: oldhost:9200

使用下面的查询参数异步运行进程

POST _reindex?wait_for_completion=false

相关问题