Migrating ElasticSearch 2.x to ElasticSearch 5.x

原文地址:https://rahulsinghai.blogspot.com/2017/09/migrating-elasticsearch-2x-to.html

查看Upgrade Elasticsearch表格,看看可以采取哪种办法进行升级。

Full cluster upgrade (2.x to 5.x)

1.Install Elasticsearch Migration Helper on old cluster. This plugin will help you to check whether you can upgrade directly to the next major version of Elasticsearch, or whether you need to make changes to your data and cluster before doing so.

cd /work/elk/elasticsearch-2.4.3/
curl -O -L https://github.com/elastic/elasticsearch-migration/releases/download/v2.0.4/elasticsearch-migration-2.0.4.zip
./bin/plugin install file:///work/elk/elasticsearch-2.4.3/elasticsearch-migration-2.0.4.zip

2.Start old ElasticSearch:

./bin/elasticsearch -d

3.Browse elasticsearch-migration,地址是:http://localhost:9200/_plugin/elasticsearch-migration/

4.Click on “Cluster Checkup” > “Run checks now”. Check all the suggestions.
5.”Reindex Helper”: Elasticsearch is able to read indices created in the previous major version only. For instance, Elasticsearch 5.x can use indices created in Elasticsearch 2.x, but not those created in Elasticsearch 1.x or before. Hence, all indices created before v2.0.0 need to be reindexed before they can be used in Elasticsearch 5.x. The reindex helper upgrades old indices at the click of a button. Works in Elasticsearch 2.3.x and 2.4.x only.

此文章中其他部分,还介绍了如何使用snapshot到方式进行升级到具体操作。

另外的迁移办法

此办法参考:https://blog.csdn.net/u012062455/article/details/79571898

1.直接将elasticsearch5的配置文件config/elasticsearch.yml文件中,path.data的地址,指向elasticsearch2的data地址。另外,为了保证elasticsearch2不被破坏,可以复制原来的elasticsearch2的data目录。
2.将elasticsearch的config下面的配置文件,拷贝到elasticsearch5的配置目录中。

注意:这种办法,是elasticsearch2和elasticsearch5,都可以访问得到的目录。

猜你喜欢

转载自blog.csdn.net/yangyangrenren/article/details/81120911