简体   繁体   English

使用较新版本的 Elasticsearch Index

[英]Use Elasticsearch Index from newer Version

Is it possible to use (eg reindex) an existing index from a newer Elasticsearch version?是否可以使用(例如重新索引)来自较新 Elasticsearch 版本的现有索引? I tried to do it via the snapshots API, but that fails with:我试图通过快照 API 来做到这一点,但失败了:

the snapshot was created with Elasticsearch version [7.5.0] which is higher than the version of this node [7.4.2]快照是使用 Elasticsearch 版本 [7.5.0] 创建的,该版本高于此节点的版本 [7.4.2]

The reason we need to use the newer index is that we want to experiment with a plugin that is not yet available for the new version, but the experiments must be done on data indexed by the newer version.我们需要使用较新的索引的原因是我们想用一个新版本尚不可用的插件进行试验,但必须在由较新版本索引的数据上进行试验。

The snapshot API won't work since you are trying to restore the index on an instance older than the instance that created the index.快照 API 将不起作用,因为您尝试在比创建索引的实例更旧的实例上恢复索引。

You will need to have your index data on a 7.5 instance and use the reindex API on a 7.4.2 instance to reindex from remote您需要在 7.5 实例上拥有索引数据,并在 7.4.2 实例上使用reindex API 从远程重新索引

It is something like this:它是这样的:

POST _reindex
{
  "source": {
    "remote": {
      "host": "http://7-5-remote-host:9200"
    },
    "index": "source"
  },
  "dest": {
    "index": "dest"
  }
}

You can also use a logstash pipeline to read from your 7.5 instance and index on your 7.4.2 instance.您还可以使用 logstash 管道从 7.5 实例中读取数据并在 7.4.2 实例上建立索引。

Something like this:像这样的东西:

input {
  elasticsearch {
    hosts => "http://7-5-instance:9200"
    index => "your-index"
  }
}
output {
  elasticsearch {
    hosts => "http://7-4-instance:9200"
    index => "your-index"
  }
} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM