使用较新版本的Elasticsearch索引。

huangapple go评论83阅读模式
英文:

Use Elasticsearch Index from newer Version

问题

可以使用(例如重新索引)来自较新的Elasticsearch版本的现有索引吗?我尝试通过快照API来做,但遇到了以下问题:

快照是使用Elasticsearch版本[7.5.0]创建的,高于此节点的版本[7.4.2]

我们需要使用较新的索引的原因是,我们想要尝试一个尚未适用于新版本的插件,但必须在由较新版本索引的数据上进行实验。

英文:

Is it possible to use (e.g. reindex) an existing index from a newer Elasticsearch version? I tried to do it via the snapshots API, but that fails with:

> the snapshot was created with Elasticsearch version [7.5.0] which is higher than the version of this node [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.

答案1

得分: 1

快照 API 无法工作,因为您试图在早于创建索引的实例之前恢复索引。

您需要将索引数据放在 7.5 实例上,并在 7.4.2 实例上使用 reindex API 进行远程重新索引

类似这样:

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

您还可以使用 Logstash 管道从您的 7.5 实例读取并将其索引到您的 7.4.2 实例。

类似这样:

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

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.

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

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.

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"
  }
} 

huangapple
  • 本文由 发表于 2020年1月6日 22:50:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/59614146.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定