将索引从弹性搜索1.x迁移到弹性搜索2.x的工具 [英] Tools to migrate index from elasticsearch 1.x to elasticsearch 2.x

查看:119
本文介绍了将索引从弹性搜索1.x迁移到弹性搜索2.x的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找将数据从1.x迁移到2.x弹性搜索的工具。请提供有什么可用的东西?

I am looking for the tools to migrate data from 1.x to 2.x elasticsearch. Please suggest if anything is available?

推荐答案

您有几个选择。您可以使用 Logstash ,以便从旧的1 .x ES到你的新的2.x ES:

You have a few options. You can use Logstash in order to copy indices from your old 1.x ES to your new 2.x ES:

input {
  elasticsearch {
   hosts => ["old-es:9200"]                     <--- source ES host
   index => "source_index"                      <--- source index to copy
   docinfo => true
  }
}
filter {
 mutate {
  remove_field => [ "@version", "@timestamp" ]  <--- remove added junk
 }
}
output {
 elasticsearch {
   hosts => ["new-es:9200]"                     <--- target ES host
   index => "%{[@metadata][_index]}"
   document_type => "%{[@metadata][_type]}"
   document_id => "%{[@metadata][_id]}"
 }
}

您还可以使用 elasticdump 并使用以下命令复制 source_index old-es:9200 到您的 new-es:9200 host:

You can also use elasticdump and use the following commands to copy source_index from old-es:9200 to your new-es:9200 host:

elasticdump \
  --input=http://old-es:9200/source_index \
  --output=http://new-es:9200/source_index \
  --type=analyzer
elasticdump \
  --input=http://old-es:9200/source_index \
  --output=http://new-es:9200/source_index \
  --type=mapping
elasticdump \
  --input=http://old-es:9200/source_index \
  --output=http://new-es:9200/source_index \
  --type=data

这篇关于将索引从弹性搜索1.x迁移到弹性搜索2.x的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆