简体   繁体   English

Elasticsearch从2.x重新索引到5.x

[英]Elasticsearch reindex from 2.x to 5.x

I did an upgrade of my elasticsearch instance from elasticsearch-2.x to elasticearch-5.6 . 我将我的elasticsearch实例从elasticsearch-2.x升级到elasticearch-5.6。 Everything seems to work fine. 一切似乎都正常。 But before i do an upgrade to version 6, I have to reindex data. 但是在升级到版本6之前,我必须重新索引数据。 Whats does reindexing mean? 重新索引是什么意思?

I have a script that is creating all data i need on elasticsearch. 我有一个脚本,可以创建我在elasticsearch上需要的所有数据。 Do i have to start this script. 我是否必须启动此脚本。 But in this case it would be the same like i would remove all indices and install all dumps back into elasticsearch. 但是在这种情况下,就像我将删除所有索引并将所有转储安装回Elasticsearch一样。

I dont know how to try this because i dont know the "right way" to do it. 我不知道如何尝试,因为我不知道这样做的“正确方法”。

EDIT I did now found the api with _reindex post. 编辑我现在确实找到了带有_reindex帖子的api。 Do i have to do this for all indexes i have or is there an application i don't know that is doing this maybe faster than me :-) 我是否必须为我拥有的所有索引执行此操作,或者是否存在我不知道该应用程序执行速度比我快的应用程序:-)

First, why is this necessary: Behind the scenes Apache Lucene is writing the data. 首先,为什么要这样做:在幕后,Apache Lucene正在编写数据。 Lucene can always write its current version and read the previous one. Lucene始终可以编写其当前版本并阅读前一个版本。

  • Elasticsearch 2.x == Lucene 5 Elasticsearch 2.x == Lucene 5
  • Elasticsearch 5.x == Lucene 6 Elasticsearch 5.x == Lucene 6
  • Elasticsearch 6.x == Lucene 7 Elasticsearch 6.x == Lucene 7

If you have upgraded from 2.x, you need to make sure that all the data has been written with Lucene 6 before you can upgrade to Elasticsearch 6.x. 如果您是从2.x升级的,则需要确保所有数据都已用Lucene 6写入,然后才能升级到Elasticsearch6.x。 You can actually check this in the version information of all the Lucene segments with GET /_segments (this might give you a lot of information). 您实际上可以使用GET /_segments在所有Lucene段的version信息中进行检查(这可能会给您很多信息)。

What you want to run to get this done is the reindex in place . 要完成此操作,您需要执行的是重新索引 And I can highly recommend the free X-Pack Basic migration assistant to make sure you have upgraded all indices and don't have any other hidden upgrade problems. 而且,我强烈建议您使用免费的X-Pack Basic迁移助手,以确保您已升级所有索引并且没有其他隐藏的升级问题。

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

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